Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into merge
This commit is contained in:
commit
65127d28e3
4
Documentation/DocBook/.gitignore
vendored
4
Documentation/DocBook/.gitignore
vendored
@ -4,3 +4,7 @@
|
|||||||
*.html
|
*.html
|
||||||
*.9.gz
|
*.9.gz
|
||||||
*.9
|
*.9
|
||||||
|
*.aux
|
||||||
|
*.dvi
|
||||||
|
*.log
|
||||||
|
*.out
|
||||||
|
@ -333,12 +333,23 @@ The "xxx" is not interpreted by the cgroup code, but will appear in
|
|||||||
|
|
||||||
To mount a cgroup hierarchy with just the cpuset and numtasks
|
To mount a cgroup hierarchy with just the cpuset and numtasks
|
||||||
subsystems, type:
|
subsystems, type:
|
||||||
# mount -t cgroup -o cpuset,numtasks hier1 /dev/cgroup
|
# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
|
||||||
|
|
||||||
To change the set of subsystems bound to a mounted hierarchy, just
|
To change the set of subsystems bound to a mounted hierarchy, just
|
||||||
remount with different options:
|
remount with different options:
|
||||||
|
# mount -o remount,cpuset,ns hier1 /dev/cgroup
|
||||||
|
|
||||||
# mount -o remount,cpuset,ns /dev/cgroup
|
Now memory is removed from the hierarchy and ns is added.
|
||||||
|
|
||||||
|
Note this will add ns to the hierarchy but won't remove memory or
|
||||||
|
cpuset, because the new options are appended to the old ones:
|
||||||
|
# mount -o remount,ns /dev/cgroup
|
||||||
|
|
||||||
|
To Specify a hierarchy's release_agent:
|
||||||
|
# mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \
|
||||||
|
xxx /dev/cgroup
|
||||||
|
|
||||||
|
Note that specifying 'release_agent' more than once will return failure.
|
||||||
|
|
||||||
Note that changing the set of subsystems is currently only supported
|
Note that changing the set of subsystems is currently only supported
|
||||||
when the hierarchy consists of a single (root) cgroup. Supporting
|
when the hierarchy consists of a single (root) cgroup. Supporting
|
||||||
@ -349,6 +360,11 @@ Then under /dev/cgroup you can find a tree that corresponds to the
|
|||||||
tree of the cgroups in the system. For instance, /dev/cgroup
|
tree of the cgroups in the system. For instance, /dev/cgroup
|
||||||
is the cgroup that holds the whole system.
|
is the cgroup that holds the whole system.
|
||||||
|
|
||||||
|
If you want to change the value of release_agent:
|
||||||
|
# echo "/sbin/new_release_agent" > /dev/cgroup/release_agent
|
||||||
|
|
||||||
|
It can also be changed via remount.
|
||||||
|
|
||||||
If you want to create a new cgroup under /dev/cgroup:
|
If you want to create a new cgroup under /dev/cgroup:
|
||||||
# cd /dev/cgroup
|
# cd /dev/cgroup
|
||||||
# mkdir my_cgroup
|
# mkdir my_cgroup
|
||||||
@ -476,11 +492,13 @@ cgroup->parent is still valid. (Note - can also be called for a
|
|||||||
newly-created cgroup if an error occurs after this subsystem's
|
newly-created cgroup if an error occurs after this subsystem's
|
||||||
create() method has been called for the new cgroup).
|
create() method has been called for the new cgroup).
|
||||||
|
|
||||||
void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||||
|
|
||||||
Called before checking the reference count on each subsystem. This may
|
Called before checking the reference count on each subsystem. This may
|
||||||
be useful for subsystems which have some extra references even if
|
be useful for subsystems which have some extra references even if
|
||||||
there are not tasks in the cgroup.
|
there are not tasks in the cgroup. If pre_destroy() returns error code,
|
||||||
|
rmdir() will fail with it. From this behavior, pre_destroy() can be
|
||||||
|
called multiple times against a cgroup.
|
||||||
|
|
||||||
int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||||
struct task_struct *task)
|
struct task_struct *task)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Memory Resource Controller(Memcg) Implementation Memo.
|
Memory Resource Controller(Memcg) Implementation Memo.
|
||||||
Last Updated: 2009/1/19
|
Last Updated: 2009/1/20
|
||||||
Base Kernel Version: based on 2.6.29-rc2.
|
Base Kernel Version: based on 2.6.29-rc2.
|
||||||
|
|
||||||
Because VM is getting complex (one of reasons is memcg...), memcg's behavior
|
Because VM is getting complex (one of reasons is memcg...), memcg's behavior
|
||||||
@ -360,3 +360,21 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
|
|||||||
# kill malloc task.
|
# kill malloc task.
|
||||||
|
|
||||||
Of course, tmpfs v.s. swapoff test should be tested, too.
|
Of course, tmpfs v.s. swapoff test should be tested, too.
|
||||||
|
|
||||||
|
9.8 OOM-Killer
|
||||||
|
Out-of-memory caused by memcg's limit will kill tasks under
|
||||||
|
the memcg. When hierarchy is used, a task under hierarchy
|
||||||
|
will be killed by the kernel.
|
||||||
|
In this case, panic_on_oom shouldn't be invoked and tasks
|
||||||
|
in other groups shouldn't be killed.
|
||||||
|
|
||||||
|
It's not difficult to cause OOM under memcg as following.
|
||||||
|
Case A) when you can swapoff
|
||||||
|
#swapoff -a
|
||||||
|
#echo 50M > /memory.limit_in_bytes
|
||||||
|
run 51M of malloc
|
||||||
|
|
||||||
|
Case B) when you use mem+swap limitation.
|
||||||
|
#echo 50M > memory.limit_in_bytes
|
||||||
|
#echo 50M > memory.memsw.limit_in_bytes
|
||||||
|
run 51M of malloc
|
||||||
|
@ -255,6 +255,16 @@ Who: Jan Engelhardt <jengelh@computergmbh.de>
|
|||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
What: GPIO autorequest on gpio_direction_{input,output}() in gpiolib
|
||||||
|
When: February 2010
|
||||||
|
Why: All callers should use explicit gpio_request()/gpio_free().
|
||||||
|
The autorequest mechanism in gpiolib was provided mostly as a
|
||||||
|
migration aid for legacy GPIO interfaces (for SOC based GPIOs).
|
||||||
|
Those users have now largely migrated. Platforms implementing
|
||||||
|
the GPIO interfaces without using gpiolib will see no changes.
|
||||||
|
Who: David Brownell <dbrownell@users.sourceforge.net>
|
||||||
|
---------------------------
|
||||||
|
|
||||||
What: b43 support for firmware revision < 410
|
What: b43 support for firmware revision < 410
|
||||||
When: The schedule was July 2008, but it was decided that we are going to keep the
|
When: The schedule was July 2008, but it was decided that we are going to keep the
|
||||||
code as long as there are no major maintanance headaches.
|
code as long as there are no major maintanance headaches.
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -123,7 +123,10 @@ platform-specific implementation issue.
|
|||||||
|
|
||||||
Using GPIOs
|
Using GPIOs
|
||||||
-----------
|
-----------
|
||||||
One of the first things to do with a GPIO, often in board setup code when
|
The first thing a system should do with a GPIO is allocate it, using
|
||||||
|
the gpio_request() call; see later.
|
||||||
|
|
||||||
|
One of the next things to do with a GPIO, often in board setup code when
|
||||||
setting up a platform_device using the GPIO, is mark its direction:
|
setting up a platform_device using the GPIO, is mark its direction:
|
||||||
|
|
||||||
/* set as input or output, returning 0 or negative errno */
|
/* set as input or output, returning 0 or negative errno */
|
||||||
@ -141,8 +144,8 @@ This helps avoid signal glitching during system startup.
|
|||||||
|
|
||||||
For compatibility with legacy interfaces to GPIOs, setting the direction
|
For compatibility with legacy interfaces to GPIOs, setting the direction
|
||||||
of a GPIO implicitly requests that GPIO (see below) if it has not been
|
of a GPIO implicitly requests that GPIO (see below) if it has not been
|
||||||
requested already. That compatibility may be removed in the future;
|
requested already. That compatibility is being removed from the optional
|
||||||
explicitly requesting GPIOs is strongly preferred.
|
gpiolib framework.
|
||||||
|
|
||||||
Setting the direction can fail if the GPIO number is invalid, or when
|
Setting the direction can fail if the GPIO number is invalid, or when
|
||||||
that particular GPIO can't be used in that mode. It's generally a bad
|
that particular GPIO can't be used in that mode. It's generally a bad
|
||||||
@ -195,7 +198,7 @@ This requires sleeping, which can't be done from inside IRQ handlers.
|
|||||||
|
|
||||||
Platforms that support this type of GPIO distinguish them from other GPIOs
|
Platforms that support this type of GPIO distinguish them from other GPIOs
|
||||||
by returning nonzero from this call (which requires a valid GPIO number,
|
by returning nonzero from this call (which requires a valid GPIO number,
|
||||||
either explicitly or implicitly requested):
|
which should have been previously allocated with gpio_request):
|
||||||
|
|
||||||
int gpio_cansleep(unsigned gpio);
|
int gpio_cansleep(unsigned gpio);
|
||||||
|
|
||||||
@ -212,10 +215,9 @@ for GPIOs that can't be accessed from IRQ handlers, these calls act the
|
|||||||
same as the spinlock-safe calls.
|
same as the spinlock-safe calls.
|
||||||
|
|
||||||
|
|
||||||
Claiming and Releasing GPIOs (OPTIONAL)
|
Claiming and Releasing GPIOs
|
||||||
---------------------------------------
|
----------------------------
|
||||||
To help catch system configuration errors, two calls are defined.
|
To help catch system configuration errors, two calls are defined.
|
||||||
However, many platforms don't currently support this mechanism.
|
|
||||||
|
|
||||||
/* request GPIO, returning 0 or negative errno.
|
/* request GPIO, returning 0 or negative errno.
|
||||||
* non-null labels may be useful for diagnostics.
|
* non-null labels may be useful for diagnostics.
|
||||||
@ -244,13 +246,6 @@ Some platforms may also use knowledge about what GPIOs are active for
|
|||||||
power management, such as by powering down unused chip sectors and, more
|
power management, such as by powering down unused chip sectors and, more
|
||||||
easily, gating off unused clocks.
|
easily, gating off unused clocks.
|
||||||
|
|
||||||
These two calls are optional because not not all current Linux platforms
|
|
||||||
offer such functionality in their GPIO support; a valid implementation
|
|
||||||
could return success for all gpio_request() calls. Unlike the other calls,
|
|
||||||
the state they represent doesn't normally match anything from a hardware
|
|
||||||
register; it's just a software bitmap which clearly is not necessary for
|
|
||||||
correct operation of hardware or (bug free) drivers.
|
|
||||||
|
|
||||||
Note that requesting a GPIO does NOT cause it to be configured in any
|
Note that requesting a GPIO does NOT cause it to be configured in any
|
||||||
way; it just marks that GPIO as in use. Separate code must handle any
|
way; it just marks that GPIO as in use. Separate code must handle any
|
||||||
pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown).
|
pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown).
|
||||||
|
100
Documentation/networking/vxge.txt
Normal file
100
Documentation/networking/vxge.txt
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
Neterion's (Formerly S2io) X3100 Series 10GbE PCIe Server Adapter Linux driver
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
Contents
|
||||||
|
--------
|
||||||
|
|
||||||
|
1) Introduction
|
||||||
|
2) Features supported
|
||||||
|
3) Configurable driver parameters
|
||||||
|
4) Troubleshooting
|
||||||
|
|
||||||
|
1) Introduction:
|
||||||
|
----------------
|
||||||
|
This Linux driver supports all Neterion's X3100 series 10 GbE PCIe I/O
|
||||||
|
Virtualized Server adapters.
|
||||||
|
The X3100 series supports four modes of operation, configurable via
|
||||||
|
firmware -
|
||||||
|
Single function mode
|
||||||
|
Multi function mode
|
||||||
|
SRIOV mode
|
||||||
|
MRIOV mode
|
||||||
|
The functions share a 10GbE link and the pci-e bus, but hardly anything else
|
||||||
|
inside the ASIC. Features like independent hw reset, statistics, bandwidth/
|
||||||
|
priority allocation and guarantees, GRO, TSO, interrupt moderation etc are
|
||||||
|
supported independently on each function.
|
||||||
|
|
||||||
|
(See below for a complete list of features supported for both IPv4 and IPv6)
|
||||||
|
|
||||||
|
2) Features supported:
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
i) Single function mode (up to 17 queues)
|
||||||
|
|
||||||
|
ii) Multi function mode (up to 17 functions)
|
||||||
|
|
||||||
|
iii) PCI-SIG's I/O Virtualization
|
||||||
|
- Single Root mode: v1.0 (up to 17 functions)
|
||||||
|
- Multi-Root mode: v1.0 (up to 17 functions)
|
||||||
|
|
||||||
|
iv) Jumbo frames
|
||||||
|
X3100 Series supports MTU up to 9600 bytes, modifiable using
|
||||||
|
ifconfig command.
|
||||||
|
|
||||||
|
v) Offloads supported: (Enabled by default)
|
||||||
|
Checksum offload (TCP/UDP/IP) on transmit and receive paths
|
||||||
|
TCP Segmentation Offload (TSO) on transmit path
|
||||||
|
Generic Receive Offload (GRO) on receive path
|
||||||
|
|
||||||
|
vi) MSI-X: (Enabled by default)
|
||||||
|
Resulting in noticeable performance improvement (up to 7% on certain
|
||||||
|
platforms).
|
||||||
|
|
||||||
|
vii) NAPI: (Enabled by default)
|
||||||
|
For better Rx interrupt moderation.
|
||||||
|
|
||||||
|
viii)RTH (Receive Traffic Hash): (Enabled by default)
|
||||||
|
Receive side steering for better scaling.
|
||||||
|
|
||||||
|
ix) Statistics
|
||||||
|
Comprehensive MAC-level and software statistics displayed using
|
||||||
|
"ethtool -S" option.
|
||||||
|
|
||||||
|
x) Multiple hardware queues: (Enabled by default)
|
||||||
|
Up to 17 hardware based transmit and receive data channels, with
|
||||||
|
multiple steering options (transmit multiqueue enabled by default).
|
||||||
|
|
||||||
|
3) Configurable driver parameters:
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
i) max_config_dev
|
||||||
|
Specifies maximum device functions to be enabled.
|
||||||
|
Valid range: 1-8
|
||||||
|
|
||||||
|
ii) max_config_port
|
||||||
|
Specifies number of ports to be enabled.
|
||||||
|
Valid range: 1,2
|
||||||
|
Default: 1
|
||||||
|
|
||||||
|
iii)max_config_vpath
|
||||||
|
Specifies maximum VPATH(s) configured for each device function.
|
||||||
|
Valid range: 1-17
|
||||||
|
|
||||||
|
iv) vlan_tag_strip
|
||||||
|
Enables/disables vlan tag stripping from all received tagged frames that
|
||||||
|
are not replicated at the internal L2 switch.
|
||||||
|
Valid range: 0,1 (disabled, enabled respectively)
|
||||||
|
Default: 1
|
||||||
|
|
||||||
|
v) addr_learn_en
|
||||||
|
Enable learning the mac address of the guest OS interface in
|
||||||
|
virtualization environment.
|
||||||
|
Valid range: 0,1 (disabled, enabled respectively)
|
||||||
|
Default: 0
|
||||||
|
|
||||||
|
4) Troubleshooting:
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
To resolve an issue with the source code or X3100 series adapter, please collect
|
||||||
|
the statistics, register dumps using ethool, relevant logs and email them to
|
||||||
|
support@neterion.com.
|
@ -10,6 +10,8 @@ fs.txt
|
|||||||
- documentation for /proc/sys/fs/*.
|
- documentation for /proc/sys/fs/*.
|
||||||
kernel.txt
|
kernel.txt
|
||||||
- documentation for /proc/sys/kernel/*.
|
- documentation for /proc/sys/kernel/*.
|
||||||
|
net.txt
|
||||||
|
- documentation for /proc/sys/net/*.
|
||||||
sunrpc.txt
|
sunrpc.txt
|
||||||
- documentation for /proc/sys/sunrpc/*.
|
- documentation for /proc/sys/sunrpc/*.
|
||||||
vm.txt
|
vm.txt
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
Documentation for /proc/sys/fs/* kernel version 2.2.10
|
Documentation for /proc/sys/fs/* kernel version 2.2.10
|
||||||
(c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
|
(c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
|
||||||
|
(c) 2009, Shen Feng<shen@cn.fujitsu.com>
|
||||||
|
|
||||||
For general info and legal blurb, please look in README.
|
For general info and legal blurb, please look in README.
|
||||||
|
|
||||||
@ -14,7 +15,12 @@ kernel. Since some of the files _can_ be used to screw up your
|
|||||||
system, it is advisable to read both documentation and source
|
system, it is advisable to read both documentation and source
|
||||||
before actually making adjustments.
|
before actually making adjustments.
|
||||||
|
|
||||||
|
1. /proc/sys/fs
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
Currently, these files are in /proc/sys/fs:
|
Currently, these files are in /proc/sys/fs:
|
||||||
|
- aio-max-nr
|
||||||
|
- aio-nr
|
||||||
- dentry-state
|
- dentry-state
|
||||||
- dquot-max
|
- dquot-max
|
||||||
- dquot-nr
|
- dquot-nr
|
||||||
@ -30,8 +36,15 @@ Currently, these files are in /proc/sys/fs:
|
|||||||
- super-max
|
- super-max
|
||||||
- super-nr
|
- super-nr
|
||||||
|
|
||||||
Documentation for the files in /proc/sys/fs/binfmt_misc is
|
==============================================================
|
||||||
in Documentation/binfmt_misc.txt.
|
|
||||||
|
aio-nr & aio-max-nr:
|
||||||
|
|
||||||
|
aio-nr is the running total of the number of events specified on the
|
||||||
|
io_setup system call for all currently active aio contexts. If aio-nr
|
||||||
|
reaches aio-max-nr then io_setup will fail with EAGAIN. Note that
|
||||||
|
raising aio-max-nr does not result in the pre-allocation or re-sizing
|
||||||
|
of any kernel data structures.
|
||||||
|
|
||||||
==============================================================
|
==============================================================
|
||||||
|
|
||||||
@ -178,3 +191,60 @@ requests. aio-max-nr allows you to change the maximum value
|
|||||||
aio-nr can grow to.
|
aio-nr can grow to.
|
||||||
|
|
||||||
==============================================================
|
==============================================================
|
||||||
|
|
||||||
|
|
||||||
|
2. /proc/sys/fs/binfmt_misc
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
Documentation for the files in /proc/sys/fs/binfmt_misc is
|
||||||
|
in Documentation/binfmt_misc.txt.
|
||||||
|
|
||||||
|
|
||||||
|
3. /proc/sys/fs/mqueue - POSIX message queues filesystem
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
The "mqueue" filesystem provides the necessary kernel features to enable the
|
||||||
|
creation of a user space library that implements the POSIX message queues
|
||||||
|
API (as noted by the MSG tag in the POSIX 1003.1-2001 version of the System
|
||||||
|
Interfaces specification.)
|
||||||
|
|
||||||
|
The "mqueue" filesystem contains values for determining/setting the amount of
|
||||||
|
resources used by the file system.
|
||||||
|
|
||||||
|
/proc/sys/fs/mqueue/queues_max is a read/write file for setting/getting the
|
||||||
|
maximum number of message queues allowed on the system.
|
||||||
|
|
||||||
|
/proc/sys/fs/mqueue/msg_max is a read/write file for setting/getting the
|
||||||
|
maximum number of messages in a queue value. In fact it is the limiting value
|
||||||
|
for another (user) limit which is set in mq_open invocation. This attribute of
|
||||||
|
a queue must be less or equal then msg_max.
|
||||||
|
|
||||||
|
/proc/sys/fs/mqueue/msgsize_max is a read/write file for setting/getting the
|
||||||
|
maximum message size value (it is every message queue's attribute set during
|
||||||
|
its creation).
|
||||||
|
|
||||||
|
|
||||||
|
4. /proc/sys/fs/epoll - Configuration options for the epoll interface
|
||||||
|
--------------------------------------------------------
|
||||||
|
|
||||||
|
This directory contains configuration options for the epoll(7) interface.
|
||||||
|
|
||||||
|
max_user_instances
|
||||||
|
------------------
|
||||||
|
|
||||||
|
This is the maximum number of epoll file descriptors that a single user can
|
||||||
|
have open at a given time. The default value is 128, and should be enough
|
||||||
|
for normal users.
|
||||||
|
|
||||||
|
max_user_watches
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Every epoll file descriptor can store a number of files to be monitored
|
||||||
|
for event readiness. Each one of these monitored files constitutes a "watch".
|
||||||
|
This configuration option sets the maximum number of "watches" that are
|
||||||
|
allowed for each user.
|
||||||
|
Each "watch" costs roughly 90 bytes on a 32bit kernel, and roughly 160 bytes
|
||||||
|
on a 64bit one.
|
||||||
|
The current default value for max_user_watches is the 1/32 of the available
|
||||||
|
low memory, divided for the "watch" cost in bytes.
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
Documentation for /proc/sys/kernel/* kernel version 2.2.10
|
Documentation for /proc/sys/kernel/* kernel version 2.2.10
|
||||||
(c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
|
(c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
|
||||||
|
(c) 2009, Shen Feng<shen@cn.fujitsu.com>
|
||||||
|
|
||||||
For general info and legal blurb, please look in README.
|
For general info and legal blurb, please look in README.
|
||||||
|
|
||||||
@ -18,6 +19,7 @@ Currently, these files might (depending on your configuration)
|
|||||||
show up in /proc/sys/kernel:
|
show up in /proc/sys/kernel:
|
||||||
- acpi_video_flags
|
- acpi_video_flags
|
||||||
- acct
|
- acct
|
||||||
|
- auto_msgmni
|
||||||
- core_pattern
|
- core_pattern
|
||||||
- core_uses_pid
|
- core_uses_pid
|
||||||
- ctrl-alt-del
|
- ctrl-alt-del
|
||||||
@ -33,6 +35,7 @@ show up in /proc/sys/kernel:
|
|||||||
- msgmax
|
- msgmax
|
||||||
- msgmnb
|
- msgmnb
|
||||||
- msgmni
|
- msgmni
|
||||||
|
- nmi_watchdog
|
||||||
- osrelease
|
- osrelease
|
||||||
- ostype
|
- ostype
|
||||||
- overflowgid
|
- overflowgid
|
||||||
@ -40,6 +43,7 @@ show up in /proc/sys/kernel:
|
|||||||
- panic
|
- panic
|
||||||
- pid_max
|
- pid_max
|
||||||
- powersave-nap [ PPC only ]
|
- powersave-nap [ PPC only ]
|
||||||
|
- panic_on_unrecovered_nmi
|
||||||
- printk
|
- printk
|
||||||
- randomize_va_space
|
- randomize_va_space
|
||||||
- real-root-dev ==> Documentation/initrd.txt
|
- real-root-dev ==> Documentation/initrd.txt
|
||||||
@ -55,6 +59,7 @@ show up in /proc/sys/kernel:
|
|||||||
- sysrq ==> Documentation/sysrq.txt
|
- sysrq ==> Documentation/sysrq.txt
|
||||||
- tainted
|
- tainted
|
||||||
- threads-max
|
- threads-max
|
||||||
|
- unknown_nmi_panic
|
||||||
- version
|
- version
|
||||||
|
|
||||||
==============================================================
|
==============================================================
|
||||||
@ -381,3 +386,51 @@ can be ORed together:
|
|||||||
512 - A kernel warning has occurred.
|
512 - A kernel warning has occurred.
|
||||||
1024 - A module from drivers/staging was loaded.
|
1024 - A module from drivers/staging was loaded.
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
auto_msgmni:
|
||||||
|
|
||||||
|
Enables/Disables automatic recomputing of msgmni upon memory add/remove or
|
||||||
|
upon ipc namespace creation/removal (see the msgmni description above).
|
||||||
|
Echoing "1" into this file enables msgmni automatic recomputing.
|
||||||
|
Echoing "0" turns it off.
|
||||||
|
auto_msgmni default value is 1.
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
nmi_watchdog:
|
||||||
|
|
||||||
|
Enables/Disables the NMI watchdog on x86 systems. When the value is non-zero
|
||||||
|
the NMI watchdog is enabled and will continuously test all online cpus to
|
||||||
|
determine whether or not they are still functioning properly. Currently,
|
||||||
|
passing "nmi_watchdog=" parameter at boot time is required for this function
|
||||||
|
to work.
|
||||||
|
|
||||||
|
If LAPIC NMI watchdog method is in use (nmi_watchdog=2 kernel parameter), the
|
||||||
|
NMI watchdog shares registers with oprofile. By disabling the NMI watchdog,
|
||||||
|
oprofile may have more registers to utilize.
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
unknown_nmi_panic:
|
||||||
|
|
||||||
|
The value in this file affects behavior of handling NMI. When the value is
|
||||||
|
non-zero, unknown NMI is trapped and then panic occurs. At that time, kernel
|
||||||
|
debugging information is displayed on console.
|
||||||
|
|
||||||
|
NMI switch that most IA32 servers have fires unknown NMI up, for example.
|
||||||
|
If a system hangs up, try pressing the NMI switch.
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
panic_on_unrecovered_nmi:
|
||||||
|
|
||||||
|
The default Linux behaviour on an NMI of either memory or unknown is to continue
|
||||||
|
operation. For many environments such as scientific computing it is preferable
|
||||||
|
that the box is taken out and the error dealt with than an uncorrected
|
||||||
|
parity/ECC error get propogated.
|
||||||
|
|
||||||
|
A small number of systems do generate NMI's for bizarre random reasons such as
|
||||||
|
power management so the default is off. That sysctl works like the existing
|
||||||
|
panic controls already in that directory.
|
||||||
|
|
||||||
|
175
Documentation/sysctl/net.txt
Normal file
175
Documentation/sysctl/net.txt
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
Documentation for /proc/sys/net/* kernel version 2.4.0-test11-pre4
|
||||||
|
(c) 1999 Terrehon Bowden <terrehon@pacbell.net>
|
||||||
|
Bodo Bauer <bb@ricochet.net>
|
||||||
|
(c) 2000 Jorge Nerin <comandante@zaralinux.com>
|
||||||
|
(c) 2009 Shen Feng <shen@cn.fujitsu.com>
|
||||||
|
|
||||||
|
For general info and legal blurb, please look in README.
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
This file contains the documentation for the sysctl files in
|
||||||
|
/proc/sys/net and is valid for Linux kernel version 2.4.0-test11-pre4.
|
||||||
|
|
||||||
|
The interface to the networking parts of the kernel is located in
|
||||||
|
/proc/sys/net. The following table shows all possible subdirectories.You may
|
||||||
|
see only some of them, depending on your kernel's configuration.
|
||||||
|
|
||||||
|
|
||||||
|
Table : Subdirectories in /proc/sys/net
|
||||||
|
..............................................................................
|
||||||
|
Directory Content Directory Content
|
||||||
|
core General parameter appletalk Appletalk protocol
|
||||||
|
unix Unix domain sockets netrom NET/ROM
|
||||||
|
802 E802 protocol ax25 AX25
|
||||||
|
ethernet Ethernet protocol rose X.25 PLP layer
|
||||||
|
ipv4 IP version 4 x25 X.25 protocol
|
||||||
|
ipx IPX token-ring IBM token ring
|
||||||
|
bridge Bridging decnet DEC net
|
||||||
|
ipv6 IP version 6
|
||||||
|
..............................................................................
|
||||||
|
|
||||||
|
1. /proc/sys/net/core - Network core options
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
rmem_default
|
||||||
|
------------
|
||||||
|
|
||||||
|
The default setting of the socket receive buffer in bytes.
|
||||||
|
|
||||||
|
rmem_max
|
||||||
|
--------
|
||||||
|
|
||||||
|
The maximum receive socket buffer size in bytes.
|
||||||
|
|
||||||
|
wmem_default
|
||||||
|
------------
|
||||||
|
|
||||||
|
The default setting (in bytes) of the socket send buffer.
|
||||||
|
|
||||||
|
wmem_max
|
||||||
|
--------
|
||||||
|
|
||||||
|
The maximum send socket buffer size in bytes.
|
||||||
|
|
||||||
|
message_burst and message_cost
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
These parameters are used to limit the warning messages written to the kernel
|
||||||
|
log from the networking code. They enforce a rate limit to make a
|
||||||
|
denial-of-service attack impossible. A higher message_cost factor, results in
|
||||||
|
fewer messages that will be written. Message_burst controls when messages will
|
||||||
|
be dropped. The default settings limit warning messages to one every five
|
||||||
|
seconds.
|
||||||
|
|
||||||
|
warnings
|
||||||
|
--------
|
||||||
|
|
||||||
|
This controls console messages from the networking stack that can occur because
|
||||||
|
of problems on the network like duplicate address or bad checksums. Normally,
|
||||||
|
this should be enabled, but if the problem persists the messages can be
|
||||||
|
disabled.
|
||||||
|
|
||||||
|
netdev_budget
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Maximum number of packets taken from all interfaces in one polling cycle (NAPI
|
||||||
|
poll). In one polling cycle interfaces which are registered to polling are
|
||||||
|
probed in a round-robin manner. The limit of packets in one such probe can be
|
||||||
|
set per-device via sysfs class/net/<device>/weight .
|
||||||
|
|
||||||
|
netdev_max_backlog
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Maximum number of packets, queued on the INPUT side, when the interface
|
||||||
|
receives packets faster than kernel can process them.
|
||||||
|
|
||||||
|
optmem_max
|
||||||
|
----------
|
||||||
|
|
||||||
|
Maximum ancillary buffer size allowed per socket. Ancillary data is a sequence
|
||||||
|
of struct cmsghdr structures with appended data.
|
||||||
|
|
||||||
|
2. /proc/sys/net/unix - Parameters for Unix domain sockets
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
There is only one file in this directory.
|
||||||
|
unix_dgram_qlen limits the max number of datagrams queued in Unix domain
|
||||||
|
socket's buffer. It will not take effect unless PF_UNIX flag is spicified.
|
||||||
|
|
||||||
|
|
||||||
|
3. /proc/sys/net/ipv4 - IPV4 settings
|
||||||
|
-------------------------------------------------------
|
||||||
|
Please see: Documentation/networking/ip-sysctl.txt and ipvs-sysctl.txt for
|
||||||
|
descriptions of these entries.
|
||||||
|
|
||||||
|
|
||||||
|
4. Appletalk
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
The /proc/sys/net/appletalk directory holds the Appletalk configuration data
|
||||||
|
when Appletalk is loaded. The configurable parameters are:
|
||||||
|
|
||||||
|
aarp-expiry-time
|
||||||
|
----------------
|
||||||
|
|
||||||
|
The amount of time we keep an ARP entry before expiring it. Used to age out
|
||||||
|
old hosts.
|
||||||
|
|
||||||
|
aarp-resolve-time
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
The amount of time we will spend trying to resolve an Appletalk address.
|
||||||
|
|
||||||
|
aarp-retransmit-limit
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
The number of times we will retransmit a query before giving up.
|
||||||
|
|
||||||
|
aarp-tick-time
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Controls the rate at which expires are checked.
|
||||||
|
|
||||||
|
The directory /proc/net/appletalk holds the list of active Appletalk sockets
|
||||||
|
on a machine.
|
||||||
|
|
||||||
|
The fields indicate the DDP type, the local address (in network:node format)
|
||||||
|
the remote address, the size of the transmit pending queue, the size of the
|
||||||
|
received queue (bytes waiting for applications to read) the state and the uid
|
||||||
|
owning the socket.
|
||||||
|
|
||||||
|
/proc/net/atalk_iface lists all the interfaces configured for appletalk.It
|
||||||
|
shows the name of the interface, its Appletalk address, the network range on
|
||||||
|
that address (or network number for phase 1 networks), and the status of the
|
||||||
|
interface.
|
||||||
|
|
||||||
|
/proc/net/atalk_route lists each known network route. It lists the target
|
||||||
|
(network) that the route leads to, the router (may be directly connected), the
|
||||||
|
route flags, and the device the route is using.
|
||||||
|
|
||||||
|
|
||||||
|
5. IPX
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
The IPX protocol has no tunable values in proc/sys/net.
|
||||||
|
|
||||||
|
The IPX protocol does, however, provide proc/net/ipx. This lists each IPX
|
||||||
|
socket giving the local and remote addresses in Novell format (that is
|
||||||
|
network:node:port). In accordance with the strange Novell tradition,
|
||||||
|
everything but the port is in hex. Not_Connected is displayed for sockets that
|
||||||
|
are not tied to a specific remote address. The Tx and Rx queue sizes indicate
|
||||||
|
the number of bytes pending for transmission and reception. The state
|
||||||
|
indicates the state the socket is in and the uid is the owning uid of the
|
||||||
|
socket.
|
||||||
|
|
||||||
|
The /proc/net/ipx_interface file lists all IPX interfaces. For each interface
|
||||||
|
it gives the network number, the node number, and indicates if the network is
|
||||||
|
the primary network. It also indicates which device it is bound to (or
|
||||||
|
Internal for internal networks) and the Frame Type if appropriate. Linux
|
||||||
|
supports 802.3, 802.2, 802.2 SNAP and DIX (Blue Book) ethernet framing for
|
||||||
|
IPX.
|
||||||
|
|
||||||
|
The /proc/net/ipx_route table holds a list of IPX routes. For each route it
|
||||||
|
gives the destination network, the router node (or Directly) and the network
|
||||||
|
address of the router (or Connected) for internal networks.
|
13
MAINTAINERS
13
MAINTAINERS
@ -1945,6 +1945,12 @@ L: lm-sensors@lm-sensors.org
|
|||||||
W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
|
W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
|
HYPERVISOR VIRTUAL CONSOLE DRIVER
|
||||||
|
L: linuxppc-dev@ozlabs.org
|
||||||
|
L: linux-kernel@vger.kernel.org
|
||||||
|
S: Odd Fixes
|
||||||
|
F: drivers/char/hvc_*
|
||||||
|
|
||||||
GSPCA FINEPIX SUBDRIVER
|
GSPCA FINEPIX SUBDRIVER
|
||||||
P: Frank Zago
|
P: Frank Zago
|
||||||
M: frank@zago.net
|
M: frank@zago.net
|
||||||
@ -3098,7 +3104,7 @@ M: shemminger@linux-foundation.org
|
|||||||
L: netem@lists.linux-foundation.org
|
L: netem@lists.linux-foundation.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
NETERION (S2IO) Xframe 10GbE DRIVER
|
NETERION (S2IO) 10GbE DRIVER (xframe/vxge)
|
||||||
P: Ramkrishna Vepa
|
P: Ramkrishna Vepa
|
||||||
M: ram.vepa@neterion.com
|
M: ram.vepa@neterion.com
|
||||||
P: Rastapur Santosh
|
P: Rastapur Santosh
|
||||||
@ -3107,8 +3113,11 @@ P: Sivakumar Subramani
|
|||||||
M: sivakumar.subramani@neterion.com
|
M: sivakumar.subramani@neterion.com
|
||||||
P: Sreenivasa Honnur
|
P: Sreenivasa Honnur
|
||||||
M: sreenivasa.honnur@neterion.com
|
M: sreenivasa.honnur@neterion.com
|
||||||
|
P: Anil Murthy
|
||||||
|
M: anil.murthy@neterion.com
|
||||||
L: netdev@vger.kernel.org
|
L: netdev@vger.kernel.org
|
||||||
W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/TitleIndex?anonymous
|
W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
|
||||||
|
W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
|
||||||
S: Supported
|
S: Supported
|
||||||
|
|
||||||
NETFILTER/IPTABLES/IPCHAINS
|
NETFILTER/IPTABLES/IPCHAINS
|
||||||
|
@ -166,6 +166,9 @@ static inline void __raw_write_unlock(raw_rwlock_t * lock)
|
|||||||
lock->lock = 0;
|
lock->lock = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
#define _raw_write_relax(lock) cpu_relax()
|
#define _raw_write_relax(lock) cpu_relax()
|
||||||
|
@ -272,7 +272,7 @@ alpha_vfork(struct pt_regs *regs)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct * p, struct pt_regs * regs)
|
struct task_struct * p, struct pt_regs * regs)
|
||||||
{
|
{
|
||||||
|
@ -217,6 +217,9 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
|
|||||||
/* read_can_lock - would read_trylock() succeed? */
|
/* read_can_lock - would read_trylock() succeed? */
|
||||||
#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
|
#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
#define _raw_write_relax(lock) cpu_relax()
|
#define _raw_write_relax(lock) cpu_relax()
|
||||||
|
@ -301,7 +301,7 @@ void release_thread(struct task_struct *dead_task)
|
|||||||
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
|
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
|
||||||
|
|
||||||
int
|
int
|
||||||
copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start,
|
copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
||||||
unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs)
|
unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct thread_info *thread = task_thread_info(p);
|
struct thread_info *thread = task_thread_info(p);
|
||||||
|
@ -332,7 +332,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
|
|||||||
|
|
||||||
asmlinkage void ret_from_fork(void);
|
asmlinkage void ret_from_fork(void);
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ asmlinkage int bfin_clone(struct pt_regs *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
copy_thread(int nr, unsigned long clone_flags,
|
copy_thread(unsigned long clone_flags,
|
||||||
unsigned long usp, unsigned long topstk,
|
unsigned long usp, unsigned long topstk,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
|
|||||||
*/
|
*/
|
||||||
asmlinkage void ret_from_fork(void);
|
asmlinkage void ret_from_fork(void);
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
|
|||||||
extern asmlinkage void ret_from_fork(void);
|
extern asmlinkage void ret_from_fork(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -121,6 +121,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock)
|
||||||
|
#define _raw_write_lock_flags(lock, flags) _raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/fs_struct.h>
|
|
||||||
#include <linux/init_task.h>
|
#include <linux/init_task.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
@ -204,7 +204,7 @@ void prepare_to_copy(struct task_struct *tsk)
|
|||||||
/*
|
/*
|
||||||
* set up the kernel stack and exception frames for a new process
|
* set up the kernel stack and exception frames for a new process
|
||||||
*/
|
*/
|
||||||
int copy_thread(int nr, unsigned long clone_flags,
|
int copy_thread(unsigned long clone_flags,
|
||||||
unsigned long usp, unsigned long topstk,
|
unsigned long usp, unsigned long topstk,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -191,7 +191,7 @@ asmlinkage int h8300_clone(struct pt_regs *regs)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags,
|
int copy_thread(unsigned long clone_flags,
|
||||||
unsigned long usp, unsigned long topstk,
|
unsigned long usp, unsigned long topstk,
|
||||||
struct task_struct * p, struct pt_regs * regs)
|
struct task_struct * p, struct pt_regs * regs)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,6 @@ CONFIG_BOUNCE=y
|
|||||||
CONFIG_NR_QUICK=1
|
CONFIG_NR_QUICK=1
|
||||||
CONFIG_VIRT_TO_BUS=y
|
CONFIG_VIRT_TO_BUS=y
|
||||||
CONFIG_UNEVICTABLE_LRU=y
|
CONFIG_UNEVICTABLE_LRU=y
|
||||||
CONFIG_MMU_NOTIFIER=y
|
|
||||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||||
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
|
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
|
||||||
CONFIG_ARCH_FLATMEM_ENABLE=y
|
CONFIG_ARCH_FLATMEM_ENABLE=y
|
||||||
@ -416,8 +415,6 @@ CONFIG_SGI_IOC4=y
|
|||||||
# CONFIG_ENCLOSURE_SERVICES is not set
|
# CONFIG_ENCLOSURE_SERVICES is not set
|
||||||
CONFIG_SGI_XP=m
|
CONFIG_SGI_XP=m
|
||||||
# CONFIG_HP_ILO is not set
|
# CONFIG_HP_ILO is not set
|
||||||
CONFIG_SGI_GRU=m
|
|
||||||
# CONFIG_SGI_GRU_DEBUG is not set
|
|
||||||
# CONFIG_C2PORT is not set
|
# CONFIG_C2PORT is not set
|
||||||
CONFIG_HAVE_IDE=y
|
CONFIG_HAVE_IDE=y
|
||||||
CONFIG_IDE=y
|
CONFIG_IDE=y
|
||||||
|
@ -120,6 +120,38 @@ do { \
|
|||||||
#define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0)
|
#define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0)
|
||||||
#define __raw_write_can_lock(rw) (*(volatile int *)(rw) == 0)
|
#define __raw_write_can_lock(rw) (*(volatile int *)(rw) == 0)
|
||||||
|
|
||||||
|
#ifdef ASM_SUPPORTED
|
||||||
|
|
||||||
|
static __always_inline void
|
||||||
|
__raw_read_lock_flags(raw_rwlock_t *lock, unsigned long flags)
|
||||||
|
{
|
||||||
|
__asm__ __volatile__ (
|
||||||
|
"tbit.nz p6, p0 = %1,%2\n"
|
||||||
|
"br.few 3f\n"
|
||||||
|
"1:\n"
|
||||||
|
"fetchadd4.rel r2 = [%0], -1;;\n"
|
||||||
|
"(p6) ssm psr.i\n"
|
||||||
|
"2:\n"
|
||||||
|
"hint @pause\n"
|
||||||
|
"ld4 r2 = [%0];;\n"
|
||||||
|
"cmp4.lt p7,p0 = r2, r0\n"
|
||||||
|
"(p7) br.cond.spnt.few 2b\n"
|
||||||
|
"(p6) rsm psr.i\n"
|
||||||
|
";;\n"
|
||||||
|
"3:\n"
|
||||||
|
"fetchadd4.acq r2 = [%0], 1;;\n"
|
||||||
|
"cmp4.lt p7,p0 = r2, r0\n"
|
||||||
|
"(p7) br.cond.spnt.few 1b\n"
|
||||||
|
: : "r"(lock), "r"(flags), "i"(IA64_PSR_I_BIT)
|
||||||
|
: "p6", "p7", "r2", "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock(lock) __raw_read_lock_flags(lock, 0)
|
||||||
|
|
||||||
|
#else /* !ASM_SUPPORTED */
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(rw, flags) __raw_read_lock(rw)
|
||||||
|
|
||||||
#define __raw_read_lock(rw) \
|
#define __raw_read_lock(rw) \
|
||||||
do { \
|
do { \
|
||||||
raw_rwlock_t *__read_lock_ptr = (rw); \
|
raw_rwlock_t *__read_lock_ptr = (rw); \
|
||||||
@ -131,6 +163,8 @@ do { \
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#endif /* !ASM_SUPPORTED */
|
||||||
|
|
||||||
#define __raw_read_unlock(rw) \
|
#define __raw_read_unlock(rw) \
|
||||||
do { \
|
do { \
|
||||||
raw_rwlock_t *__read_lock_ptr = (rw); \
|
raw_rwlock_t *__read_lock_ptr = (rw); \
|
||||||
@ -138,20 +172,33 @@ do { \
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#ifdef ASM_SUPPORTED
|
#ifdef ASM_SUPPORTED
|
||||||
#define __raw_write_lock(rw) \
|
|
||||||
do { \
|
static __always_inline void
|
||||||
__asm__ __volatile__ ( \
|
__raw_write_lock_flags(raw_rwlock_t *lock, unsigned long flags)
|
||||||
"mov ar.ccv = r0\n" \
|
{
|
||||||
"dep r29 = -1, r0, 31, 1;;\n" \
|
__asm__ __volatile__ (
|
||||||
"1:\n" \
|
"tbit.nz p6, p0 = %1, %2\n"
|
||||||
"ld4 r2 = [%0];;\n" \
|
"mov ar.ccv = r0\n"
|
||||||
"cmp4.eq p0,p7 = r0,r2\n" \
|
"dep r29 = -1, r0, 31, 1\n"
|
||||||
"(p7) br.cond.spnt.few 1b \n" \
|
"br.few 3f;;\n"
|
||||||
"cmpxchg4.acq r2 = [%0], r29, ar.ccv;;\n" \
|
"1:\n"
|
||||||
"cmp4.eq p0,p7 = r0, r2\n" \
|
"(p6) ssm psr.i\n"
|
||||||
"(p7) br.cond.spnt.few 1b;;\n" \
|
"2:\n"
|
||||||
:: "r"(rw) : "ar.ccv", "p7", "r2", "r29", "memory"); \
|
"hint @pause\n"
|
||||||
} while(0)
|
"ld4 r2 = [%0];;\n"
|
||||||
|
"cmp4.eq p0,p7 = r0, r2\n"
|
||||||
|
"(p7) br.cond.spnt.few 2b\n"
|
||||||
|
"(p6) rsm psr.i\n"
|
||||||
|
";;\n"
|
||||||
|
"3:\n"
|
||||||
|
"cmpxchg4.acq r2 = [%0], r29, ar.ccv;;\n"
|
||||||
|
"cmp4.eq p0,p7 = r0, r2\n"
|
||||||
|
"(p7) br.cond.spnt.few 1b;;\n"
|
||||||
|
: : "r"(lock), "r"(flags), "i"(IA64_PSR_I_BIT)
|
||||||
|
: "ar.ccv", "p6", "p7", "r2", "r29", "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
#define __raw_write_lock(rw) __raw_write_lock_flags(rw, 0)
|
||||||
|
|
||||||
#define __raw_write_trylock(rw) \
|
#define __raw_write_trylock(rw) \
|
||||||
({ \
|
({ \
|
||||||
@ -174,6 +221,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *x)
|
|||||||
|
|
||||||
#else /* !ASM_SUPPORTED */
|
#else /* !ASM_SUPPORTED */
|
||||||
|
|
||||||
|
#define __raw_write_lock_flags(l, flags) __raw_write_lock(l)
|
||||||
|
|
||||||
#define __raw_write_lock(l) \
|
#define __raw_write_lock(l) \
|
||||||
({ \
|
({ \
|
||||||
__u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1); \
|
__u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1); \
|
||||||
|
@ -305,5 +305,11 @@ static inline int uv_num_possible_blades(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
|
||||||
|
{
|
||||||
|
/* not currently needed on ia64 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* __ASM_IA64_UV_HUB__ */
|
#endif /* __ASM_IA64_UV_HUB__ */
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
* Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
|
* Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ASM_IA64_UV_MMRS__
|
#ifndef _ASM_IA64_UV_UV_MMRS_H
|
||||||
#define __ASM_IA64_UV_MMRS__
|
#define _ASM_IA64_UV_UV_MMRS_H
|
||||||
|
|
||||||
#define UV_MMR_ENABLE (1UL << 63)
|
#define UV_MMR_ENABLE (1UL << 63)
|
||||||
|
|
||||||
@ -242,6 +242,158 @@ union uvh_event_occurred0_u {
|
|||||||
#define UVH_EVENT_OCCURRED0_ALIAS 0x0000000000070008UL
|
#define UVH_EVENT_OCCURRED0_ALIAS 0x0000000000070008UL
|
||||||
#define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0
|
#define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR0_TLB_INT0_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG 0x61b00UL
|
||||||
|
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr0_tlb_int0_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr0_tlb_int0_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR0_TLB_INT1_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG 0x61b40UL
|
||||||
|
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr0_tlb_int1_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr0_tlb_int1_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR1_TLB_INT0_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG 0x61f00UL
|
||||||
|
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr1_tlb_int0_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr1_tlb_int0_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR1_TLB_INT1_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG 0x61f40UL
|
||||||
|
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr1_tlb_int1_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr1_tlb_int1_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
/* UVH_INT_CMPB */
|
/* UVH_INT_CMPB */
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
@ -670,4 +822,4 @@ union uvh_si_alias2_overlay_config_u {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* __ASM_IA64_UV_MMRS__ */
|
#endif /* _ASM_IA64_UV_UV_MMRS_H */
|
||||||
|
@ -413,7 +413,7 @@ ia64_load_extra (struct task_struct *task)
|
|||||||
* so there is nothing to worry about.
|
* so there is nothing to worry about.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
copy_thread (int nr, unsigned long clone_flags,
|
copy_thread(unsigned long clone_flags,
|
||||||
unsigned long user_stack_base, unsigned long user_stack_size,
|
unsigned long user_stack_base, unsigned long user_stack_size,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -225,7 +225,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
|
|||||||
return 0; /* Task didn't use the fpu at all. */
|
return 0; /* Task didn't use the fpu at all. */
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
|
int copy_thread(unsigned long clone_flags, unsigned long spu,
|
||||||
unsigned long unused, struct task_struct *tsk, struct pt_regs *regs)
|
unsigned long unused, struct task_struct *tsk, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct pt_regs *childregs = task_pt_regs(tsk);
|
struct pt_regs *childregs = task_pt_regs(tsk);
|
||||||
|
@ -233,7 +233,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs)
|
|||||||
parent_tidptr, child_tidptr);
|
parent_tidptr, child_tidptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct * p, struct pt_regs * regs)
|
struct task_struct * p, struct pt_regs * regs)
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs)
|
|||||||
return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
|
return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags,
|
int copy_thread(unsigned long clone_flags,
|
||||||
unsigned long usp, unsigned long topstk,
|
unsigned long usp, unsigned long topstk,
|
||||||
struct task_struct * p, struct pt_regs * regs)
|
struct task_struct * p, struct pt_regs * regs)
|
||||||
{
|
{
|
||||||
|
@ -480,6 +480,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
|
@ -350,16 +350,18 @@
|
|||||||
#define __NR_dup3 (__NR_Linux + 327)
|
#define __NR_dup3 (__NR_Linux + 327)
|
||||||
#define __NR_pipe2 (__NR_Linux + 328)
|
#define __NR_pipe2 (__NR_Linux + 328)
|
||||||
#define __NR_inotify_init1 (__NR_Linux + 329)
|
#define __NR_inotify_init1 (__NR_Linux + 329)
|
||||||
|
#define __NR_preadv (__NR_Linux + 330)
|
||||||
|
#define __NR_pwritev (__NR_Linux + 331)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Offset of the last Linux o32 flavoured syscall
|
* Offset of the last Linux o32 flavoured syscall
|
||||||
*/
|
*/
|
||||||
#define __NR_Linux_syscalls 329
|
#define __NR_Linux_syscalls 331
|
||||||
|
|
||||||
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
|
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
|
||||||
|
|
||||||
#define __NR_O32_Linux 4000
|
#define __NR_O32_Linux 4000
|
||||||
#define __NR_O32_Linux_syscalls 329
|
#define __NR_O32_Linux_syscalls 331
|
||||||
|
|
||||||
#if _MIPS_SIM == _MIPS_SIM_ABI64
|
#if _MIPS_SIM == _MIPS_SIM_ABI64
|
||||||
|
|
||||||
@ -656,16 +658,18 @@
|
|||||||
#define __NR_dup3 (__NR_Linux + 286)
|
#define __NR_dup3 (__NR_Linux + 286)
|
||||||
#define __NR_pipe2 (__NR_Linux + 287)
|
#define __NR_pipe2 (__NR_Linux + 287)
|
||||||
#define __NR_inotify_init1 (__NR_Linux + 288)
|
#define __NR_inotify_init1 (__NR_Linux + 288)
|
||||||
|
#define __NR_preadv (__NR_Linux + 289)
|
||||||
|
#define __NR_pwritev (__NR_Linux + 290)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Offset of the last Linux 64-bit flavoured syscall
|
* Offset of the last Linux 64-bit flavoured syscall
|
||||||
*/
|
*/
|
||||||
#define __NR_Linux_syscalls 288
|
#define __NR_Linux_syscalls 290
|
||||||
|
|
||||||
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
|
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
|
||||||
|
|
||||||
#define __NR_64_Linux 5000
|
#define __NR_64_Linux 5000
|
||||||
#define __NR_64_Linux_syscalls 288
|
#define __NR_64_Linux_syscalls 290
|
||||||
|
|
||||||
#if _MIPS_SIM == _MIPS_SIM_NABI32
|
#if _MIPS_SIM == _MIPS_SIM_NABI32
|
||||||
|
|
||||||
@ -966,16 +970,18 @@
|
|||||||
#define __NR_dup3 (__NR_Linux + 290)
|
#define __NR_dup3 (__NR_Linux + 290)
|
||||||
#define __NR_pipe2 (__NR_Linux + 291)
|
#define __NR_pipe2 (__NR_Linux + 291)
|
||||||
#define __NR_inotify_init1 (__NR_Linux + 292)
|
#define __NR_inotify_init1 (__NR_Linux + 292)
|
||||||
|
#define __NR_preadv (__NR_Linux + 293)
|
||||||
|
#define __NR_pwritev (__NR_Linux + 294)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Offset of the last N32 flavoured syscall
|
* Offset of the last N32 flavoured syscall
|
||||||
*/
|
*/
|
||||||
#define __NR_Linux_syscalls 292
|
#define __NR_Linux_syscalls 294
|
||||||
|
|
||||||
#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
|
#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
|
||||||
|
|
||||||
#define __NR_N32_Linux 6000
|
#define __NR_N32_Linux 6000
|
||||||
#define __NR_N32_Linux_syscalls 292
|
#define __NR_N32_Linux_syscalls 294
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ void flush_thread(void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused, struct task_struct *p, struct pt_regs *regs)
|
unsigned long unused, struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct thread_info *ti = task_thread_info(p);
|
struct thread_info *ti = task_thread_info(p);
|
||||||
|
@ -650,6 +650,8 @@ einval: li v0, -ENOSYS
|
|||||||
sys sys_dup3 3
|
sys sys_dup3 3
|
||||||
sys sys_pipe2 2
|
sys sys_pipe2 2
|
||||||
sys sys_inotify_init1 1
|
sys sys_inotify_init1 1
|
||||||
|
sys sys_preadv 6 /* 4330 */
|
||||||
|
sys sys_pwritev 6
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/* We pre-compute the number of _instruction_ bytes needed to
|
/* We pre-compute the number of _instruction_ bytes needed to
|
||||||
|
@ -487,4 +487,6 @@ sys_call_table:
|
|||||||
PTR sys_dup3
|
PTR sys_dup3
|
||||||
PTR sys_pipe2
|
PTR sys_pipe2
|
||||||
PTR sys_inotify_init1
|
PTR sys_inotify_init1
|
||||||
|
PTR sys_preadv
|
||||||
|
PTR sys_pwritev /* 5390 */
|
||||||
.size sys_call_table,.-sys_call_table
|
.size sys_call_table,.-sys_call_table
|
||||||
|
@ -413,4 +413,6 @@ EXPORT(sysn32_call_table)
|
|||||||
PTR sys_dup3 /* 5290 */
|
PTR sys_dup3 /* 5290 */
|
||||||
PTR sys_pipe2
|
PTR sys_pipe2
|
||||||
PTR sys_inotify_init1
|
PTR sys_inotify_init1
|
||||||
|
PTR sys_preadv
|
||||||
|
PTR sys_pwritev
|
||||||
.size sysn32_call_table,.-sysn32_call_table
|
.size sysn32_call_table,.-sysn32_call_table
|
||||||
|
@ -533,4 +533,6 @@ sys_call_table:
|
|||||||
PTR sys_dup3
|
PTR sys_dup3
|
||||||
PTR sys_pipe2
|
PTR sys_pipe2
|
||||||
PTR sys_inotify_init1
|
PTR sys_inotify_init1
|
||||||
|
PTR compat_sys_preadv /* 4330 */
|
||||||
|
PTR compat_sys_pwritev
|
||||||
.size sys_call_table,.-sys_call_table
|
.size sys_call_table,.-sys_call_table
|
||||||
|
@ -193,7 +193,7 @@ void prepare_to_copy(struct task_struct *tsk)
|
|||||||
* set up the kernel stack for a new thread and copy arch-specific thread
|
* set up the kernel stack for a new thread and copy arch-specific thread
|
||||||
* control information
|
* control information
|
||||||
*/
|
*/
|
||||||
int copy_thread(int nr, unsigned long clone_flags,
|
int copy_thread(unsigned long clone_flags,
|
||||||
unsigned long c_usp, unsigned long ustk_size,
|
unsigned long c_usp, unsigned long ustk_size,
|
||||||
struct task_struct *p, struct pt_regs *kregs)
|
struct task_struct *p, struct pt_regs *kregs)
|
||||||
{
|
{
|
||||||
|
@ -187,6 +187,9 @@ static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw)
|
|||||||
return !rw->counter;
|
return !rw->counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
#define _raw_write_relax(lock) cpu_relax()
|
#define _raw_write_relax(lock) cpu_relax()
|
||||||
|
@ -263,7 +263,7 @@ sys_vfork(struct pt_regs *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused, /* in ia64 this is "user_stack_size" */
|
unsigned long unused, /* in ia64 this is "user_stack_size" */
|
||||||
struct task_struct * p, struct pt_regs * pregs)
|
struct task_struct * p, struct pt_regs * pregs)
|
||||||
{
|
{
|
||||||
|
@ -27,16 +27,6 @@ config DEBUG_STACK_USAGE
|
|||||||
|
|
||||||
This option will slow down process creation somewhat.
|
This option will slow down process creation somewhat.
|
||||||
|
|
||||||
config DEBUG_PAGEALLOC
|
|
||||||
bool "Debug page memory allocations"
|
|
||||||
depends on DEBUG_KERNEL && !HIBERNATION
|
|
||||||
depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
|
||||||
help
|
|
||||||
Unmap pages from the kernel linear mapping after free_pages().
|
|
||||||
This results in a large slowdown, but helps to find certain types
|
|
||||||
of memory corruptions.
|
|
||||||
|
|
||||||
|
|
||||||
config HCALL_STATS
|
config HCALL_STATS
|
||||||
bool "Hypervisor call instrumentation"
|
bool "Hypervisor call instrumentation"
|
||||||
depends on PPC_PSERIES && DEBUG_FS
|
depends on PPC_PSERIES && DEBUG_FS
|
||||||
|
@ -287,6 +287,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
|
|||||||
rw->lock = 0;
|
rw->lock = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) __spin_yield(lock)
|
#define _raw_spin_relax(lock) __spin_yield(lock)
|
||||||
#define _raw_read_relax(lock) __rw_yield(lock)
|
#define _raw_read_relax(lock) __rw_yield(lock)
|
||||||
#define _raw_write_relax(lock) __rw_yield(lock)
|
#define _raw_write_relax(lock) __rw_yield(lock)
|
||||||
|
@ -598,7 +598,7 @@ void prepare_to_copy(struct task_struct *tsk)
|
|||||||
/*
|
/*
|
||||||
* Copy a thread..
|
* Copy a thread..
|
||||||
*/
|
*/
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused, struct task_struct *p,
|
unsigned long unused, struct task_struct *p,
|
||||||
struct pt_regs *regs)
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -482,7 +482,7 @@ static void vio_cmo_balance(struct work_struct *work)
|
|||||||
cmo->excess.size = cmo->entitled - cmo->reserve.size;
|
cmo->excess.size = cmo->entitled - cmo->reserve.size;
|
||||||
cmo->excess.free = cmo->excess.size - need;
|
cmo->excess.free = cmo->excess.size - need;
|
||||||
|
|
||||||
cancel_delayed_work(container_of(work, struct delayed_work, work));
|
cancel_delayed_work(to_delayed_work(work));
|
||||||
spin_unlock_irqrestore(&vio_cmo.lock, flags);
|
spin_unlock_irqrestore(&vio_cmo.lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
|
|||||||
if (dentry->d_inode)
|
if (dentry->d_inode)
|
||||||
goto out_dput;
|
goto out_dput;
|
||||||
|
|
||||||
mode &= ~current->fs->umask;
|
mode &= ~current_umask();
|
||||||
|
|
||||||
if (flags & SPU_CREATE_GANG)
|
if (flags & SPU_CREATE_GANG)
|
||||||
ret = spufs_create_gang(nd->path.dentry->d_inode,
|
ret = spufs_create_gang(nd->path.dentry->d_inode,
|
||||||
|
@ -6,13 +6,4 @@ config TRACE_IRQFLAGS_SUPPORT
|
|||||||
|
|
||||||
source "lib/Kconfig.debug"
|
source "lib/Kconfig.debug"
|
||||||
|
|
||||||
config DEBUG_PAGEALLOC
|
|
||||||
bool "Debug page memory allocations"
|
|
||||||
depends on DEBUG_KERNEL
|
|
||||||
depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
|
||||||
help
|
|
||||||
Unmap pages from the kernel linear mapping after free_pages().
|
|
||||||
This results in a slowdown, but helps to find certain types of
|
|
||||||
memory corruptions.
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -172,6 +172,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
|
|||||||
return _raw_write_trylock_retry(rw);
|
return _raw_write_trylock_retry(rw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
#define _raw_write_relax(lock) cpu_relax()
|
#define _raw_write_relax(lock) cpu_relax()
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ void release_thread(struct task_struct *dead_task)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
|
int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -216,6 +216,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
|
|||||||
return (oldval > (RW_LOCK_BIAS - 1));
|
return (oldval > (RW_LOCK_BIAS - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
#define _raw_write_relax(lock) cpu_relax()
|
#define _raw_write_relax(lock) cpu_relax()
|
||||||
|
@ -170,7 +170,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
|
|||||||
|
|
||||||
asmlinkage void ret_from_fork(void);
|
asmlinkage void ret_from_fork(void);
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -425,7 +425,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
|
|||||||
|
|
||||||
asmlinkage void ret_from_fork(void);
|
asmlinkage void ret_from_fork(void);
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -22,15 +22,6 @@ config DEBUG_DCFLUSH
|
|||||||
config STACK_DEBUG
|
config STACK_DEBUG
|
||||||
bool "Stack Overflow Detection Support"
|
bool "Stack Overflow Detection Support"
|
||||||
|
|
||||||
config DEBUG_PAGEALLOC
|
|
||||||
bool "Debug page memory allocations"
|
|
||||||
depends on DEBUG_KERNEL && !HIBERNATION
|
|
||||||
depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
|
||||||
help
|
|
||||||
Unmap pages from the kernel linear mapping after free_pages().
|
|
||||||
This results in a large slowdown, but helps to find certain types
|
|
||||||
of memory corruptions.
|
|
||||||
|
|
||||||
config MCOUNT
|
config MCOUNT
|
||||||
bool
|
bool
|
||||||
depends on SPARC64
|
depends on SPARC64
|
||||||
|
@ -177,6 +177,8 @@ static inline int __read_trylock(raw_rwlock_t *rw)
|
|||||||
#define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0)
|
#define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0)
|
||||||
|
|
||||||
#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
|
#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
|
||||||
|
#define __raw_read_lock_flags(rw, flags) __raw_read_lock(rw)
|
||||||
|
#define __raw_write_lock_flags(rw, flags) __raw_write_lock(rw)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
|
@ -211,9 +211,11 @@ static int inline __write_trylock(raw_rwlock_t *lock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define __raw_read_lock(p) __read_lock(p)
|
#define __raw_read_lock(p) __read_lock(p)
|
||||||
|
#define __raw_read_lock_flags(p, f) __read_lock(p)
|
||||||
#define __raw_read_trylock(p) __read_trylock(p)
|
#define __raw_read_trylock(p) __read_trylock(p)
|
||||||
#define __raw_read_unlock(p) __read_unlock(p)
|
#define __raw_read_unlock(p) __read_unlock(p)
|
||||||
#define __raw_write_lock(p) __write_lock(p)
|
#define __raw_write_lock(p) __write_lock(p)
|
||||||
|
#define __raw_write_lock_flags(p, f) __write_lock(p)
|
||||||
#define __raw_write_unlock(p) __write_unlock(p)
|
#define __raw_write_unlock(p) __write_unlock(p)
|
||||||
#define __raw_write_trylock(p) __write_trylock(p)
|
#define __raw_write_trylock(p) __write_trylock(p)
|
||||||
|
|
||||||
|
@ -455,7 +455,7 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
|
|||||||
*/
|
*/
|
||||||
extern void ret_from_fork(void);
|
extern void ret_from_fork(void);
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
|
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -561,7 +561,7 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
|
|||||||
* Parent --> %o0 == childs pid, %o1 == 0
|
* Parent --> %o0 == childs pid, %o1 == 0
|
||||||
* Child --> %o0 == parents pid, %o1 == 1
|
* Child --> %o0 == parents pid, %o1 == 1
|
||||||
*/
|
*/
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
|
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -757,7 +757,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
|
|||||||
void (*proc)(unsigned char *, unsigned char *, void *);
|
void (*proc)(unsigned char *, unsigned char *, void *);
|
||||||
unsigned char addr_buf[4], netmask_buf[4];
|
unsigned char addr_buf[4], netmask_buf[4];
|
||||||
|
|
||||||
if (dev->open != uml_net_open)
|
if (dev->netdev_ops->ndo_open != uml_net_open)
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
|
||||||
lp = netdev_priv(dev);
|
lp = netdev_priv(dev);
|
||||||
|
@ -179,7 +179,7 @@ void fork_handler(void)
|
|||||||
userspace(¤t->thread.regs.regs);
|
userspace(¤t->thread.regs.regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
|
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||||
unsigned long stack_top, struct task_struct * p,
|
unsigned long stack_top, struct task_struct * p,
|
||||||
struct pt_regs *regs)
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
|
|||||||
|
|
||||||
fs = get_fs();
|
fs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
ret = um_execve(filename, argv, envp);
|
ret = um_execve((char *)filename, (char __user *__user *)argv,
|
||||||
|
(char __user *__user *) envp);
|
||||||
set_fs(fs);
|
set_fs(fs);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -9,6 +9,17 @@
|
|||||||
|
|
||||||
#define old_mmap old_mmap_i386
|
#define old_mmap old_mmap_i386
|
||||||
|
|
||||||
|
#define ptregs_fork sys_fork
|
||||||
|
#define ptregs_execve sys_execve
|
||||||
|
#define ptregs_iopl sys_iopl
|
||||||
|
#define ptregs_vm86old sys_vm86old
|
||||||
|
#define ptregs_sigreturn sys_sigreturn
|
||||||
|
#define ptregs_clone sys_clone
|
||||||
|
#define ptregs_vm86 sys_vm86
|
||||||
|
#define ptregs_rt_sigreturn sys_rt_sigreturn
|
||||||
|
#define ptregs_sigaltstack sys_sigaltstack
|
||||||
|
#define ptregs_vfork sys_vfork
|
||||||
|
|
||||||
.section .rodata,"a"
|
.section .rodata,"a"
|
||||||
|
|
||||||
#include "../../x86/kernel/syscall_table_32.S"
|
#include "../../x86/kernel/syscall_table_32.S"
|
||||||
|
@ -72,15 +72,6 @@ config DEBUG_STACK_USAGE
|
|||||||
|
|
||||||
This option will slow down process creation somewhat.
|
This option will slow down process creation somewhat.
|
||||||
|
|
||||||
config DEBUG_PAGEALLOC
|
|
||||||
bool "Debug page memory allocations"
|
|
||||||
depends on DEBUG_KERNEL
|
|
||||||
depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
|
||||||
---help---
|
|
||||||
Unmap pages from the kernel linear mapping after free_pages().
|
|
||||||
This results in a large slowdown, but helps to find certain types
|
|
||||||
of memory corruptions.
|
|
||||||
|
|
||||||
config DEBUG_PER_CPU_MAPS
|
config DEBUG_PER_CPU_MAPS
|
||||||
bool "Debug access to per_cpu maps"
|
bool "Debug access to per_cpu maps"
|
||||||
depends on DEBUG_KERNEL
|
depends on DEBUG_KERNEL
|
||||||
|
@ -828,4 +828,6 @@ ia32_sys_call_table:
|
|||||||
.quad sys_dup3 /* 330 */
|
.quad sys_dup3 /* 330 */
|
||||||
.quad sys_pipe2
|
.quad sys_pipe2
|
||||||
.quad sys_inotify_init1
|
.quad sys_inotify_init1
|
||||||
|
.quad compat_sys_preadv
|
||||||
|
.quad compat_sys_pwritev
|
||||||
ia32_syscall_end:
|
ia32_syscall_end:
|
||||||
|
@ -295,6 +295,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
|
|||||||
: "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory");
|
: "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock)
|
||||||
|
#define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock)
|
||||||
|
|
||||||
#define _raw_spin_relax(lock) cpu_relax()
|
#define _raw_spin_relax(lock) cpu_relax()
|
||||||
#define _raw_read_relax(lock) cpu_relax()
|
#define _raw_read_relax(lock) cpu_relax()
|
||||||
#define _raw_write_relax(lock) cpu_relax()
|
#define _raw_write_relax(lock) cpu_relax()
|
||||||
|
@ -338,6 +338,8 @@
|
|||||||
#define __NR_dup3 330
|
#define __NR_dup3 330
|
||||||
#define __NR_pipe2 331
|
#define __NR_pipe2 331
|
||||||
#define __NR_inotify_init1 332
|
#define __NR_inotify_init1 332
|
||||||
|
#define __NR_preadv 333
|
||||||
|
#define __NR_pwritev 334
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
|
|
||||||
|
@ -653,6 +653,10 @@ __SYSCALL(__NR_dup3, sys_dup3)
|
|||||||
__SYSCALL(__NR_pipe2, sys_pipe2)
|
__SYSCALL(__NR_pipe2, sys_pipe2)
|
||||||
#define __NR_inotify_init1 294
|
#define __NR_inotify_init1 294
|
||||||
__SYSCALL(__NR_inotify_init1, sys_inotify_init1)
|
__SYSCALL(__NR_inotify_init1, sys_inotify_init1)
|
||||||
|
#define __NR_preadv 295
|
||||||
|
__SYSCALL(__NR_preadv, sys_preadv)
|
||||||
|
#define __NR_pwritev 296
|
||||||
|
__SYSCALL(__NR_pwritev, sys_pwritev)
|
||||||
|
|
||||||
|
|
||||||
#ifndef __NO_STUBS
|
#ifndef __NO_STUBS
|
||||||
|
@ -11,11 +11,13 @@
|
|||||||
#ifndef _ASM_X86_UV_UV_HUB_H
|
#ifndef _ASM_X86_UV_UV_HUB_H
|
||||||
#define _ASM_X86_UV_UV_HUB_H
|
#define _ASM_X86_UV_UV_HUB_H
|
||||||
|
|
||||||
|
#ifdef CONFIG_X86_64
|
||||||
#include <linux/numa.h>
|
#include <linux/numa.h>
|
||||||
#include <linux/percpu.h>
|
#include <linux/percpu.h>
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
#include <asm/percpu.h>
|
#include <asm/percpu.h>
|
||||||
|
#include <asm/uv/uv_mmrs.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -397,6 +399,7 @@ static inline void uv_set_scir_bits(unsigned char value)
|
|||||||
uv_write_local_mmr8(uv_hub_info->scir.offset, value);
|
uv_write_local_mmr8(uv_hub_info->scir.offset, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
|
static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
|
||||||
{
|
{
|
||||||
if (uv_cpu_hub_info(cpu)->scir.state != value) {
|
if (uv_cpu_hub_info(cpu)->scir.state != value) {
|
||||||
@ -405,4 +408,15 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
|
||||||
|
{
|
||||||
|
unsigned long val;
|
||||||
|
|
||||||
|
val = (1UL << UVH_IPI_INT_SEND_SHFT) |
|
||||||
|
((apicid & 0x3f) << UVH_IPI_INT_APIC_ID_SHFT) |
|
||||||
|
(vector << UVH_IPI_INT_VECTOR_SHFT);
|
||||||
|
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_X86_64 */
|
||||||
#endif /* _ASM_X86_UV_UV_HUB_H */
|
#endif /* _ASM_X86_UV_UV_HUB_H */
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
* License. See the file "COPYING" in the main directory of this archive
|
* License. See the file "COPYING" in the main directory of this archive
|
||||||
@ -242,6 +243,158 @@ union uvh_event_occurred0_u {
|
|||||||
#define UVH_EVENT_OCCURRED0_ALIAS 0x0000000000070008UL
|
#define UVH_EVENT_OCCURRED0_ALIAS 0x0000000000070008UL
|
||||||
#define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0
|
#define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR0_TLB_INT0_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG 0x61b00UL
|
||||||
|
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr0_tlb_int0_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr0_tlb_int0_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR0_TLB_INT1_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG 0x61b40UL
|
||||||
|
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr0_tlb_int1_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr0_tlb_int1_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR1_TLB_INT0_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG 0x61f00UL
|
||||||
|
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr1_tlb_int0_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr1_tlb_int0_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================================= */
|
||||||
|
/* UVH_GR1_TLB_INT1_CONFIG */
|
||||||
|
/* ========================================================================= */
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG 0x61f40UL
|
||||||
|
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_VECTOR_SHFT 0
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DM_SHFT 8
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_SHFT 11
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_STATUS_SHFT 12
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_P_SHFT 13
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_T_SHFT 15
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_M_SHFT 16
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_SHFT 32
|
||||||
|
#define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL
|
||||||
|
|
||||||
|
union uvh_gr1_tlb_int1_config_u {
|
||||||
|
unsigned long v;
|
||||||
|
struct uvh_gr1_tlb_int1_config_s {
|
||||||
|
unsigned long vector_ : 8; /* RW */
|
||||||
|
unsigned long dm : 3; /* RW */
|
||||||
|
unsigned long destmode : 1; /* RW */
|
||||||
|
unsigned long status : 1; /* RO */
|
||||||
|
unsigned long p : 1; /* RO */
|
||||||
|
unsigned long rsvd_14 : 1; /* */
|
||||||
|
unsigned long t : 1; /* RO */
|
||||||
|
unsigned long m : 1; /* RW */
|
||||||
|
unsigned long rsvd_17_31: 15; /* */
|
||||||
|
unsigned long apic_id : 32; /* RW */
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
/* UVH_INT_CMPB */
|
/* UVH_INT_CMPB */
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
@ -118,17 +118,12 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
|
|||||||
|
|
||||||
static void uv_send_IPI_one(int cpu, int vector)
|
static void uv_send_IPI_one(int cpu, int vector)
|
||||||
{
|
{
|
||||||
unsigned long val, apicid;
|
unsigned long apicid;
|
||||||
int pnode;
|
int pnode;
|
||||||
|
|
||||||
apicid = per_cpu(x86_cpu_to_apicid, cpu);
|
apicid = per_cpu(x86_cpu_to_apicid, cpu);
|
||||||
pnode = uv_apicid_to_pnode(apicid);
|
pnode = uv_apicid_to_pnode(apicid);
|
||||||
|
uv_hub_send_ipi(pnode, apicid, vector);
|
||||||
val = (1UL << UVH_IPI_INT_SEND_SHFT) |
|
|
||||||
(apicid << UVH_IPI_INT_APIC_ID_SHFT) |
|
|
||||||
(vector << UVH_IPI_INT_VECTOR_SHFT);
|
|
||||||
|
|
||||||
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
|
static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
|
||||||
|
@ -245,7 +245,7 @@ void prepare_to_copy(struct task_struct *tsk)
|
|||||||
unlazy_fpu(tsk);
|
unlazy_fpu(tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
|
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -278,7 +278,7 @@ void prepare_to_copy(struct task_struct *tsk)
|
|||||||
unlazy_fpu(tsk);
|
unlazy_fpu(tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
|
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct *p, struct pt_regs *regs)
|
struct task_struct *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
@ -1455,6 +1455,6 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs)
|
|||||||
* system call instruction.
|
* system call instruction.
|
||||||
*/
|
*/
|
||||||
if (test_thread_flag(TIF_SINGLESTEP) &&
|
if (test_thread_flag(TIF_SINGLESTEP) &&
|
||||||
tracehook_consider_fatal_signal(current, SIGTRAP, SIG_DFL))
|
tracehook_consider_fatal_signal(current, SIGTRAP))
|
||||||
send_sigtrap(current, regs, 0, TRAP_BRKPT);
|
send_sigtrap(current, regs, 0, TRAP_BRKPT);
|
||||||
}
|
}
|
||||||
|
@ -332,3 +332,5 @@ ENTRY(sys_call_table)
|
|||||||
.long sys_dup3 /* 330 */
|
.long sys_dup3 /* 330 */
|
||||||
.long sys_pipe2
|
.long sys_pipe2
|
||||||
.long sys_inotify_init1
|
.long sys_inotify_init1
|
||||||
|
.long sys_preadv
|
||||||
|
.long sys_pwritev
|
||||||
|
@ -172,7 +172,7 @@ void prepare_to_copy(struct task_struct *tsk)
|
|||||||
* childregs.
|
* childregs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long unused,
|
unsigned long unused,
|
||||||
struct task_struct * p, struct pt_regs * regs)
|
struct task_struct * p, struct pt_regs * regs)
|
||||||
{
|
{
|
||||||
|
@ -177,6 +177,7 @@ static int print_unex = 1;
|
|||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/mod_devicetable.h>
|
||||||
#include <linux/buffer_head.h> /* for invalidate_buffers() */
|
#include <linux/buffer_head.h> /* for invalidate_buffers() */
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
|
||||||
@ -4597,6 +4598,13 @@ MODULE_AUTHOR("Alain L. Knaff");
|
|||||||
MODULE_SUPPORTED_DEVICE("fd");
|
MODULE_SUPPORTED_DEVICE("fd");
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
|
/* This doesn't actually get used other than for module information */
|
||||||
|
static const struct pnp_device_id floppy_pnpids[] = {
|
||||||
|
{ "PNP0700", 0 },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
__setup("floppy=", floppy_setup);
|
__setup("floppy=", floppy_setup);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Note that you can not swap over this thing, yet. Seems to work but
|
* Note that you can not swap over this thing, yet. Seems to work but
|
||||||
* deadlocks sometimes - you can not swap over TCP in general.
|
* deadlocks sometimes - you can not swap over TCP in general.
|
||||||
*
|
*
|
||||||
* Copyright 1997-2000 Pavel Machek <pavel@ucw.cz>
|
* Copyright 1997-2000, 2008 Pavel Machek <pavel@suse.cz>
|
||||||
* Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com>
|
* Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com>
|
||||||
*
|
*
|
||||||
* This file is released under GPLv2 or later.
|
* This file is released under GPLv2 or later.
|
||||||
@ -276,7 +276,7 @@ static int nbd_send_req(struct nbd_device *lo, struct request *req)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_out:
|
error_out:
|
||||||
return 1;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct request *nbd_find_request(struct nbd_device *lo,
|
static struct request *nbd_find_request(struct nbd_device *lo,
|
||||||
@ -467,9 +467,7 @@ static void nbd_handle_req(struct nbd_device *lo, struct request *req)
|
|||||||
mutex_unlock(&lo->tx_lock);
|
mutex_unlock(&lo->tx_lock);
|
||||||
printk(KERN_ERR "%s: Attempted send on closed socket\n",
|
printk(KERN_ERR "%s: Attempted send on closed socket\n",
|
||||||
lo->disk->disk_name);
|
lo->disk->disk_name);
|
||||||
req->errors++;
|
goto error_out;
|
||||||
nbd_end_request(req);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lo->active_req = req;
|
lo->active_req = req;
|
||||||
@ -531,7 +529,7 @@ static int nbd_thread(void *data)
|
|||||||
* { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); }
|
* { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void do_nbd_request(struct request_queue * q)
|
static void do_nbd_request(struct request_queue *q)
|
||||||
{
|
{
|
||||||
struct request *req;
|
struct request *req;
|
||||||
|
|
||||||
@ -568,27 +566,17 @@ static void do_nbd_request(struct request_queue * q)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
/* Must be called with tx_lock held */
|
||||||
unsigned int cmd, unsigned long arg)
|
|
||||||
|
static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *lo,
|
||||||
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct nbd_device *lo = bdev->bd_disk->private_data;
|
|
||||||
struct file *file;
|
|
||||||
int error;
|
|
||||||
struct request sreq ;
|
|
||||||
struct task_struct *thread;
|
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
BUG_ON(lo->magic != LO_MAGIC);
|
|
||||||
|
|
||||||
/* Anyone capable of this syscall can do *real bad* things */
|
|
||||||
dprintk(DBG_IOCTL, "%s: nbd_ioctl cmd=%s(0x%x) arg=%lu\n",
|
|
||||||
lo->disk->disk_name, ioctl_cmd_to_ascii(cmd), cmd, arg);
|
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case NBD_DISCONNECT:
|
case NBD_DISCONNECT: {
|
||||||
|
struct request sreq;
|
||||||
|
|
||||||
printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name);
|
printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name);
|
||||||
|
|
||||||
blk_rq_init(NULL, &sreq);
|
blk_rq_init(NULL, &sreq);
|
||||||
sreq.cmd_type = REQ_TYPE_SPECIAL;
|
sreq.cmd_type = REQ_TYPE_SPECIAL;
|
||||||
nbd_cmd(&sreq) = NBD_CMD_DISC;
|
nbd_cmd(&sreq) = NBD_CMD_DISC;
|
||||||
@ -599,29 +587,29 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||||||
*/
|
*/
|
||||||
sreq.sector = 0;
|
sreq.sector = 0;
|
||||||
sreq.nr_sectors = 0;
|
sreq.nr_sectors = 0;
|
||||||
if (!lo->sock)
|
if (!lo->sock)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
mutex_lock(&lo->tx_lock);
|
nbd_send_req(lo, &sreq);
|
||||||
nbd_send_req(lo, &sreq);
|
|
||||||
mutex_unlock(&lo->tx_lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
case NBD_CLEAR_SOCK:
|
case NBD_CLEAR_SOCK: {
|
||||||
error = 0;
|
struct file *file;
|
||||||
mutex_lock(&lo->tx_lock);
|
|
||||||
lo->sock = NULL;
|
lo->sock = NULL;
|
||||||
mutex_unlock(&lo->tx_lock);
|
|
||||||
file = lo->file;
|
file = lo->file;
|
||||||
lo->file = NULL;
|
lo->file = NULL;
|
||||||
nbd_clear_que(lo);
|
nbd_clear_que(lo);
|
||||||
BUG_ON(!list_empty(&lo->queue_head));
|
BUG_ON(!list_empty(&lo->queue_head));
|
||||||
if (file)
|
if (file)
|
||||||
fput(file);
|
fput(file);
|
||||||
return error;
|
return 0;
|
||||||
case NBD_SET_SOCK:
|
}
|
||||||
|
|
||||||
|
case NBD_SET_SOCK: {
|
||||||
|
struct file *file;
|
||||||
if (lo->file)
|
if (lo->file)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
error = -EINVAL;
|
|
||||||
file = fget(arg);
|
file = fget(arg);
|
||||||
if (file) {
|
if (file) {
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file->f_path.dentry->d_inode;
|
||||||
@ -630,12 +618,14 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||||||
lo->sock = SOCKET_I(inode);
|
lo->sock = SOCKET_I(inode);
|
||||||
if (max_part > 0)
|
if (max_part > 0)
|
||||||
bdev->bd_invalidated = 1;
|
bdev->bd_invalidated = 1;
|
||||||
error = 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
fput(file);
|
fput(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return error;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
case NBD_SET_BLKSIZE:
|
case NBD_SET_BLKSIZE:
|
||||||
lo->blksize = arg;
|
lo->blksize = arg;
|
||||||
lo->bytesize &= ~(lo->blksize-1);
|
lo->bytesize &= ~(lo->blksize-1);
|
||||||
@ -643,35 +633,50 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||||||
set_blocksize(bdev, lo->blksize);
|
set_blocksize(bdev, lo->blksize);
|
||||||
set_capacity(lo->disk, lo->bytesize >> 9);
|
set_capacity(lo->disk, lo->bytesize >> 9);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case NBD_SET_SIZE:
|
case NBD_SET_SIZE:
|
||||||
lo->bytesize = arg & ~(lo->blksize-1);
|
lo->bytesize = arg & ~(lo->blksize-1);
|
||||||
bdev->bd_inode->i_size = lo->bytesize;
|
bdev->bd_inode->i_size = lo->bytesize;
|
||||||
set_blocksize(bdev, lo->blksize);
|
set_blocksize(bdev, lo->blksize);
|
||||||
set_capacity(lo->disk, lo->bytesize >> 9);
|
set_capacity(lo->disk, lo->bytesize >> 9);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case NBD_SET_TIMEOUT:
|
case NBD_SET_TIMEOUT:
|
||||||
lo->xmit_timeout = arg * HZ;
|
lo->xmit_timeout = arg * HZ;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case NBD_SET_SIZE_BLOCKS:
|
case NBD_SET_SIZE_BLOCKS:
|
||||||
lo->bytesize = ((u64) arg) * lo->blksize;
|
lo->bytesize = ((u64) arg) * lo->blksize;
|
||||||
bdev->bd_inode->i_size = lo->bytesize;
|
bdev->bd_inode->i_size = lo->bytesize;
|
||||||
set_blocksize(bdev, lo->blksize);
|
set_blocksize(bdev, lo->blksize);
|
||||||
set_capacity(lo->disk, lo->bytesize >> 9);
|
set_capacity(lo->disk, lo->bytesize >> 9);
|
||||||
return 0;
|
return 0;
|
||||||
case NBD_DO_IT:
|
|
||||||
|
case NBD_DO_IT: {
|
||||||
|
struct task_struct *thread;
|
||||||
|
struct file *file;
|
||||||
|
int error;
|
||||||
|
|
||||||
if (lo->pid)
|
if (lo->pid)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
if (!lo->file)
|
if (!lo->file)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
mutex_unlock(&lo->tx_lock);
|
||||||
|
|
||||||
thread = kthread_create(nbd_thread, lo, lo->disk->disk_name);
|
thread = kthread_create(nbd_thread, lo, lo->disk->disk_name);
|
||||||
if (IS_ERR(thread))
|
if (IS_ERR(thread)) {
|
||||||
|
mutex_lock(&lo->tx_lock);
|
||||||
return PTR_ERR(thread);
|
return PTR_ERR(thread);
|
||||||
|
}
|
||||||
wake_up_process(thread);
|
wake_up_process(thread);
|
||||||
error = nbd_do_it(lo);
|
error = nbd_do_it(lo);
|
||||||
kthread_stop(thread);
|
kthread_stop(thread);
|
||||||
|
|
||||||
|
mutex_lock(&lo->tx_lock);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
sock_shutdown(lo, 1);
|
sock_shutdown(lo, 0);
|
||||||
file = lo->file;
|
file = lo->file;
|
||||||
lo->file = NULL;
|
lo->file = NULL;
|
||||||
nbd_clear_que(lo);
|
nbd_clear_que(lo);
|
||||||
@ -684,6 +689,8 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||||||
if (max_part > 0)
|
if (max_part > 0)
|
||||||
ioctl_by_bdev(bdev, BLKRRPART, 0);
|
ioctl_by_bdev(bdev, BLKRRPART, 0);
|
||||||
return lo->harderror;
|
return lo->harderror;
|
||||||
|
}
|
||||||
|
|
||||||
case NBD_CLEAR_QUE:
|
case NBD_CLEAR_QUE:
|
||||||
/*
|
/*
|
||||||
* This is for compatibility only. The queue is always cleared
|
* This is for compatibility only. The queue is always cleared
|
||||||
@ -691,6 +698,7 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||||||
*/
|
*/
|
||||||
BUG_ON(!lo->sock && !list_empty(&lo->queue_head));
|
BUG_ON(!lo->sock && !list_empty(&lo->queue_head));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case NBD_PRINT_DEBUG:
|
case NBD_PRINT_DEBUG:
|
||||||
printk(KERN_INFO "%s: next = %p, prev = %p, head = %p\n",
|
printk(KERN_INFO "%s: next = %p, prev = %p, head = %p\n",
|
||||||
bdev->bd_disk->disk_name,
|
bdev->bd_disk->disk_name,
|
||||||
@ -698,7 +706,29 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||||||
&lo->queue_head);
|
&lo->queue_head);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -EINVAL;
|
return -ENOTTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
|
||||||
|
unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
struct nbd_device *lo = bdev->bd_disk->private_data;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
|
BUG_ON(lo->magic != LO_MAGIC);
|
||||||
|
|
||||||
|
/* Anyone capable of this syscall can do *real bad* things */
|
||||||
|
dprintk(DBG_IOCTL, "%s: nbd_ioctl cmd=%s(0x%x) arg=%lu\n",
|
||||||
|
lo->disk->disk_name, ioctl_cmd_to_ascii(cmd), cmd, arg);
|
||||||
|
|
||||||
|
mutex_lock(&lo->tx_lock);
|
||||||
|
error = __nbd_ioctl(bdev, lo, cmd, arg);
|
||||||
|
mutex_unlock(&lo->tx_lock);
|
||||||
|
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct block_device_operations nbd_fops =
|
static struct block_device_operations nbd_fops =
|
||||||
|
@ -713,7 +713,7 @@ static struct ctl_table_header *sysctl_header;
|
|||||||
*/
|
*/
|
||||||
#define TICK_CALIBRATE (1000UL)
|
#define TICK_CALIBRATE (1000UL)
|
||||||
|
|
||||||
static unsigned long hpet_calibrate(struct hpets *hpetp)
|
static unsigned long __hpet_calibrate(struct hpets *hpetp)
|
||||||
{
|
{
|
||||||
struct hpet_timer __iomem *timer = NULL;
|
struct hpet_timer __iomem *timer = NULL;
|
||||||
unsigned long t, m, count, i, flags, start;
|
unsigned long t, m, count, i, flags, start;
|
||||||
@ -750,6 +750,26 @@ static unsigned long hpet_calibrate(struct hpets *hpetp)
|
|||||||
return (m - start) / i;
|
return (m - start) / i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned long hpet_calibrate(struct hpets *hpetp)
|
||||||
|
{
|
||||||
|
unsigned long ret = -1;
|
||||||
|
unsigned long tmp;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Try to calibrate until return value becomes stable small value.
|
||||||
|
* If SMI interruption occurs in calibration loop, the return value
|
||||||
|
* will be big. This avoids its impact.
|
||||||
|
*/
|
||||||
|
for ( ; ; ) {
|
||||||
|
tmp = __hpet_calibrate(hpetp);
|
||||||
|
if (ret <= tmp)
|
||||||
|
break;
|
||||||
|
ret = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int hpet_alloc(struct hpet_data *hdp)
|
int hpet_alloc(struct hpet_data *hdp)
|
||||||
{
|
{
|
||||||
u64 cap, mcfg;
|
u64 cap, mcfg;
|
||||||
|
@ -1488,7 +1488,8 @@ static void rekey_seq_generator(struct work_struct *work)
|
|||||||
keyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS;
|
keyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS;
|
||||||
smp_wmb();
|
smp_wmb();
|
||||||
ip_cnt++;
|
ip_cnt++;
|
||||||
schedule_delayed_work(&rekey_work, REKEY_INTERVAL);
|
schedule_delayed_work(&rekey_work,
|
||||||
|
round_jiffies_relative(REKEY_INTERVAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct keydata *get_keyptr(void)
|
static inline struct keydata *get_keyptr(void)
|
||||||
|
@ -298,6 +298,7 @@ struct slgt_info {
|
|||||||
|
|
||||||
unsigned int rbuf_fill_level;
|
unsigned int rbuf_fill_level;
|
||||||
unsigned int if_mode;
|
unsigned int if_mode;
|
||||||
|
unsigned int base_clock;
|
||||||
|
|
||||||
/* device status */
|
/* device status */
|
||||||
|
|
||||||
@ -1156,22 +1157,26 @@ static long set_params32(struct slgt_info *info, struct MGSL_PARAMS32 __user *ne
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
spin_lock(&info->lock);
|
spin_lock(&info->lock);
|
||||||
info->params.mode = tmp_params.mode;
|
if (tmp_params.mode == MGSL_MODE_BASE_CLOCK) {
|
||||||
info->params.loopback = tmp_params.loopback;
|
info->base_clock = tmp_params.clock_speed;
|
||||||
info->params.flags = tmp_params.flags;
|
} else {
|
||||||
info->params.encoding = tmp_params.encoding;
|
info->params.mode = tmp_params.mode;
|
||||||
info->params.clock_speed = tmp_params.clock_speed;
|
info->params.loopback = tmp_params.loopback;
|
||||||
info->params.addr_filter = tmp_params.addr_filter;
|
info->params.flags = tmp_params.flags;
|
||||||
info->params.crc_type = tmp_params.crc_type;
|
info->params.encoding = tmp_params.encoding;
|
||||||
info->params.preamble_length = tmp_params.preamble_length;
|
info->params.clock_speed = tmp_params.clock_speed;
|
||||||
info->params.preamble = tmp_params.preamble;
|
info->params.addr_filter = tmp_params.addr_filter;
|
||||||
info->params.data_rate = tmp_params.data_rate;
|
info->params.crc_type = tmp_params.crc_type;
|
||||||
info->params.data_bits = tmp_params.data_bits;
|
info->params.preamble_length = tmp_params.preamble_length;
|
||||||
info->params.stop_bits = tmp_params.stop_bits;
|
info->params.preamble = tmp_params.preamble;
|
||||||
info->params.parity = tmp_params.parity;
|
info->params.data_rate = tmp_params.data_rate;
|
||||||
|
info->params.data_bits = tmp_params.data_bits;
|
||||||
|
info->params.stop_bits = tmp_params.stop_bits;
|
||||||
|
info->params.parity = tmp_params.parity;
|
||||||
|
}
|
||||||
spin_unlock(&info->lock);
|
spin_unlock(&info->lock);
|
||||||
|
|
||||||
change_params(info);
|
program_hw(info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2559,10 +2564,13 @@ static int set_params(struct slgt_info *info, MGSL_PARAMS __user *new_params)
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
spin_lock_irqsave(&info->lock, flags);
|
spin_lock_irqsave(&info->lock, flags);
|
||||||
memcpy(&info->params, &tmp_params, sizeof(MGSL_PARAMS));
|
if (tmp_params.mode == MGSL_MODE_BASE_CLOCK)
|
||||||
|
info->base_clock = tmp_params.clock_speed;
|
||||||
|
else
|
||||||
|
memcpy(&info->params, &tmp_params, sizeof(MGSL_PARAMS));
|
||||||
spin_unlock_irqrestore(&info->lock, flags);
|
spin_unlock_irqrestore(&info->lock, flags);
|
||||||
|
|
||||||
change_params(info);
|
program_hw(info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3432,6 +3440,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
|
|||||||
info->magic = MGSL_MAGIC;
|
info->magic = MGSL_MAGIC;
|
||||||
INIT_WORK(&info->task, bh_handler);
|
INIT_WORK(&info->task, bh_handler);
|
||||||
info->max_frame_size = 4096;
|
info->max_frame_size = 4096;
|
||||||
|
info->base_clock = 14745600;
|
||||||
info->rbuf_fill_level = DMABUFSIZE;
|
info->rbuf_fill_level = DMABUFSIZE;
|
||||||
info->port.close_delay = 5*HZ/10;
|
info->port.close_delay = 5*HZ/10;
|
||||||
info->port.closing_wait = 30*HZ;
|
info->port.closing_wait = 30*HZ;
|
||||||
@ -3779,7 +3788,7 @@ static void enable_loopback(struct slgt_info *info)
|
|||||||
static void set_rate(struct slgt_info *info, u32 rate)
|
static void set_rate(struct slgt_info *info, u32 rate)
|
||||||
{
|
{
|
||||||
unsigned int div;
|
unsigned int div;
|
||||||
static unsigned int osc = 14745600;
|
unsigned int osc = info->base_clock;
|
||||||
|
|
||||||
/* div = osc/rate - 1
|
/* div = osc/rate - 1
|
||||||
*
|
*
|
||||||
@ -4083,18 +4092,27 @@ static void async_mode(struct slgt_info *info)
|
|||||||
* 06 CTS IRQ enable
|
* 06 CTS IRQ enable
|
||||||
* 05 DCD IRQ enable
|
* 05 DCD IRQ enable
|
||||||
* 04 RI IRQ enable
|
* 04 RI IRQ enable
|
||||||
* 03 reserved, must be zero
|
* 03 0=16x sampling, 1=8x sampling
|
||||||
* 02 1=txd->rxd internal loopback enable
|
* 02 1=txd->rxd internal loopback enable
|
||||||
* 01 reserved, must be zero
|
* 01 reserved, must be zero
|
||||||
* 00 1=master IRQ enable
|
* 00 1=master IRQ enable
|
||||||
*/
|
*/
|
||||||
val = BIT15 + BIT14 + BIT0;
|
val = BIT15 + BIT14 + BIT0;
|
||||||
|
/* JCR[8] : 1 = x8 async mode feature available */
|
||||||
|
if ((rd_reg32(info, JCR) & BIT8) && info->params.data_rate &&
|
||||||
|
((info->base_clock < (info->params.data_rate * 16)) ||
|
||||||
|
(info->base_clock % (info->params.data_rate * 16)))) {
|
||||||
|
/* use 8x sampling */
|
||||||
|
val |= BIT3;
|
||||||
|
set_rate(info, info->params.data_rate * 8);
|
||||||
|
} else {
|
||||||
|
/* use 16x sampling */
|
||||||
|
set_rate(info, info->params.data_rate * 16);
|
||||||
|
}
|
||||||
wr_reg16(info, SCR, val);
|
wr_reg16(info, SCR, val);
|
||||||
|
|
||||||
slgt_irq_on(info, IRQ_RXBREAK | IRQ_RXOVER);
|
slgt_irq_on(info, IRQ_RXBREAK | IRQ_RXOVER);
|
||||||
|
|
||||||
set_rate(info, info->params.data_rate * 16);
|
|
||||||
|
|
||||||
if (info->params.loopback)
|
if (info->params.loopback)
|
||||||
enable_loopback(info);
|
enable_loopback(info);
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/audit.h>
|
#include <linux/audit.h>
|
||||||
#include <linux/file.h>
|
|
||||||
#include <linux/fdtable.h>
|
|
||||||
#include <linux/tty.h>
|
#include <linux/tty.h>
|
||||||
|
|
||||||
struct tty_audit_buf {
|
struct tty_audit_buf {
|
||||||
|
@ -1758,7 +1758,7 @@ static int __tty_open(struct inode *inode, struct file *filp)
|
|||||||
struct tty_driver *driver;
|
struct tty_driver *driver;
|
||||||
int index;
|
int index;
|
||||||
dev_t device = inode->i_rdev;
|
dev_t device = inode->i_rdev;
|
||||||
unsigned short saved_flags = filp->f_flags;
|
unsigned saved_flags = filp->f_flags;
|
||||||
|
|
||||||
nonseekable_open(inode, filp);
|
nonseekable_open(inode, filp);
|
||||||
|
|
||||||
@ -2681,7 +2681,7 @@ void __do_SAK(struct tty_struct *tty)
|
|||||||
/* Kill the entire session */
|
/* Kill the entire session */
|
||||||
do_each_pid_task(session, PIDTYPE_SID, p) {
|
do_each_pid_task(session, PIDTYPE_SID, p) {
|
||||||
printk(KERN_NOTICE "SAK: killed process %d"
|
printk(KERN_NOTICE "SAK: killed process %d"
|
||||||
" (%s): task_session_nr(p)==tty->session\n",
|
" (%s): task_session(p)==tty->session\n",
|
||||||
task_pid_nr(p), p->comm);
|
task_pid_nr(p), p->comm);
|
||||||
send_sig(SIGKILL, p, 1);
|
send_sig(SIGKILL, p, 1);
|
||||||
} while_each_pid_task(session, PIDTYPE_SID, p);
|
} while_each_pid_task(session, PIDTYPE_SID, p);
|
||||||
@ -2691,7 +2691,7 @@ void __do_SAK(struct tty_struct *tty)
|
|||||||
do_each_thread(g, p) {
|
do_each_thread(g, p) {
|
||||||
if (p->signal->tty == tty) {
|
if (p->signal->tty == tty) {
|
||||||
printk(KERN_NOTICE "SAK: killed process %d"
|
printk(KERN_NOTICE "SAK: killed process %d"
|
||||||
" (%s): task_session_nr(p)==tty->session\n",
|
" (%s): task_session(p)==tty->session\n",
|
||||||
task_pid_nr(p), p->comm);
|
task_pid_nr(p), p->comm);
|
||||||
send_sig(SIGKILL, p, 1);
|
send_sig(SIGKILL, p, 1);
|
||||||
continue;
|
continue;
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include <linux/tty_flip.h>
|
#include <linux/tty_flip.h>
|
||||||
#include <linux/devpts_fs.h>
|
#include <linux/devpts_fs.h>
|
||||||
#include <linux/file.h>
|
#include <linux/file.h>
|
||||||
#include <linux/fdtable.h>
|
|
||||||
#include <linux/console.h>
|
#include <linux/console.h>
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
|
@ -1882,7 +1882,7 @@ static void hifn_clear_rings(struct hifn_device *dev, int error)
|
|||||||
|
|
||||||
static void hifn_work(struct work_struct *work)
|
static void hifn_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct delayed_work *dw = container_of(work, struct delayed_work, work);
|
struct delayed_work *dw = to_delayed_work(work);
|
||||||
struct hifn_device *dev = container_of(dw, struct hifn_device, work);
|
struct hifn_device *dev = container_of(dw, struct hifn_device, work);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int reset = 0;
|
int reset = 0;
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#
|
#
|
||||||
# EDAC Kconfig
|
# EDAC Kconfig
|
||||||
# Copyright (c) 2003 Linux Networx
|
# Copyright (c) 2008 Doug Thompson www.softwarebitmaker.com
|
||||||
# Licensed and distributed under the GPL
|
# Licensed and distributed under the GPL
|
||||||
#
|
#
|
||||||
|
|
||||||
menuconfig EDAC
|
menuconfig EDAC
|
||||||
bool "EDAC - error detection and reporting (EXPERIMENTAL)"
|
bool "EDAC - error detection and reporting"
|
||||||
depends on HAS_IOMEM
|
depends on HAS_IOMEM
|
||||||
depends on EXPERIMENTAL
|
|
||||||
depends on X86 || PPC
|
depends on X86 || PPC
|
||||||
help
|
help
|
||||||
EDAC is designed to report errors in the core system.
|
EDAC is designed to report errors in the core system.
|
||||||
@ -40,6 +39,14 @@ config EDAC_DEBUG
|
|||||||
there're four debug levels (x=0,1,2,3 from low to high).
|
there're four debug levels (x=0,1,2,3 from low to high).
|
||||||
Usually you should select 'N'.
|
Usually you should select 'N'.
|
||||||
|
|
||||||
|
config EDAC_DEBUG_VERBOSE
|
||||||
|
bool "More verbose debugging"
|
||||||
|
depends on EDAC_DEBUG
|
||||||
|
help
|
||||||
|
This option makes debugging information more verbose.
|
||||||
|
Source file name and line number where debugging message
|
||||||
|
printed will be added to debugging message.
|
||||||
|
|
||||||
config EDAC_MM_EDAC
|
config EDAC_MM_EDAC
|
||||||
tristate "Main Memory EDAC (Error Detection And Correction) reporting"
|
tristate "Main Memory EDAC (Error Detection And Correction) reporting"
|
||||||
default y
|
default y
|
||||||
@ -174,4 +181,27 @@ config EDAC_CELL
|
|||||||
Cell Broadband Engine internal memory controller
|
Cell Broadband Engine internal memory controller
|
||||||
on platform without a hypervisor
|
on platform without a hypervisor
|
||||||
|
|
||||||
|
config EDAC_PPC4XX
|
||||||
|
tristate "PPC4xx IBM DDR2 Memory Controller"
|
||||||
|
depends on EDAC_MM_EDAC && 4xx
|
||||||
|
help
|
||||||
|
This enables support for EDAC on the ECC memory used
|
||||||
|
with the IBM DDR2 memory controller found in various
|
||||||
|
PowerPC 4xx embedded processors such as the 405EX[r],
|
||||||
|
440SP, 440SPe, 460EX, 460GT and 460SX.
|
||||||
|
|
||||||
|
config EDAC_AMD8131
|
||||||
|
tristate "AMD8131 HyperTransport PCI-X Tunnel"
|
||||||
|
depends on EDAC_MM_EDAC && PCI
|
||||||
|
help
|
||||||
|
Support for error detection and correction on the
|
||||||
|
AMD8131 HyperTransport PCI-X Tunnel chip.
|
||||||
|
|
||||||
|
config EDAC_AMD8111
|
||||||
|
tristate "AMD8111 HyperTransport I/O Hub"
|
||||||
|
depends on EDAC_MM_EDAC && PCI
|
||||||
|
help
|
||||||
|
Support for error detection and correction on the
|
||||||
|
AMD8111 HyperTransport I/O Hub chip.
|
||||||
|
|
||||||
endif # EDAC
|
endif # EDAC
|
||||||
|
@ -34,4 +34,4 @@ obj-$(CONFIG_EDAC_PASEMI) += pasemi_edac.o
|
|||||||
obj-$(CONFIG_EDAC_MPC85XX) += mpc85xx_edac.o
|
obj-$(CONFIG_EDAC_MPC85XX) += mpc85xx_edac.o
|
||||||
obj-$(CONFIG_EDAC_MV64X60) += mv64x60_edac.o
|
obj-$(CONFIG_EDAC_MV64X60) += mv64x60_edac.o
|
||||||
obj-$(CONFIG_EDAC_CELL) += cell_edac.o
|
obj-$(CONFIG_EDAC_CELL) += cell_edac.o
|
||||||
|
obj-$(CONFIG_EDAC_PPC4XX) += ppc4xx_edac.o
|
||||||
|
595
drivers/edac/amd8111_edac.c
Normal file
595
drivers/edac/amd8111_edac.c
Normal file
@ -0,0 +1,595 @@
|
|||||||
|
/*
|
||||||
|
* amd8111_edac.c, AMD8111 Hyper Transport chip EDAC kernel module
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Wind River Systems, Inc.
|
||||||
|
*
|
||||||
|
* Authors: Cao Qingtao <qingtao.cao@windriver.com>
|
||||||
|
* Benjamin Walsh <benjamin.walsh@windriver.com>
|
||||||
|
* Hu Yongqi <yongqi.hu@windriver.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
#include <linux/edac.h>
|
||||||
|
#include <linux/pci_ids.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
#include "edac_core.h"
|
||||||
|
#include "edac_module.h"
|
||||||
|
#include "amd8111_edac.h"
|
||||||
|
|
||||||
|
#define AMD8111_EDAC_REVISION " Ver: 1.0.0 " __DATE__
|
||||||
|
#define AMD8111_EDAC_MOD_STR "amd8111_edac"
|
||||||
|
|
||||||
|
#define PCI_DEVICE_ID_AMD_8111_PCI 0x7460
|
||||||
|
static int edac_dev_idx;
|
||||||
|
|
||||||
|
enum amd8111_edac_devs {
|
||||||
|
LPC_BRIDGE = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum amd8111_edac_pcis {
|
||||||
|
PCI_BRIDGE = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Wrapper functions for accessing PCI configuration space */
|
||||||
|
static int edac_pci_read_dword(struct pci_dev *dev, int reg, u32 *val32)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = pci_read_config_dword(dev, reg, val32);
|
||||||
|
if (ret != 0)
|
||||||
|
printk(KERN_ERR AMD8111_EDAC_MOD_STR
|
||||||
|
" PCI Access Read Error at 0x%x\n", reg);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void edac_pci_read_byte(struct pci_dev *dev, int reg, u8 *val8)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = pci_read_config_byte(dev, reg, val8);
|
||||||
|
if (ret != 0)
|
||||||
|
printk(KERN_ERR AMD8111_EDAC_MOD_STR
|
||||||
|
" PCI Access Read Error at 0x%x\n", reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void edac_pci_write_dword(struct pci_dev *dev, int reg, u32 val32)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = pci_write_config_dword(dev, reg, val32);
|
||||||
|
if (ret != 0)
|
||||||
|
printk(KERN_ERR AMD8111_EDAC_MOD_STR
|
||||||
|
" PCI Access Write Error at 0x%x\n", reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void edac_pci_write_byte(struct pci_dev *dev, int reg, u8 val8)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = pci_write_config_byte(dev, reg, val8);
|
||||||
|
if (ret != 0)
|
||||||
|
printk(KERN_ERR AMD8111_EDAC_MOD_STR
|
||||||
|
" PCI Access Write Error at 0x%x\n", reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* device-specific methods for amd8111 PCI Bridge Controller
|
||||||
|
*
|
||||||
|
* Error Reporting and Handling for amd8111 chipset could be found
|
||||||
|
* in its datasheet 3.1.2 section, P37
|
||||||
|
*/
|
||||||
|
static void amd8111_pci_bridge_init(struct amd8111_pci_info *pci_info)
|
||||||
|
{
|
||||||
|
u32 val32;
|
||||||
|
struct pci_dev *dev = pci_info->dev;
|
||||||
|
|
||||||
|
/* First clear error detection flags on the host interface */
|
||||||
|
|
||||||
|
/* Clear SSE/SMA/STA flags in the global status register*/
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_STSCMD, &val32);
|
||||||
|
if (val32 & PCI_STSCMD_CLEAR_MASK)
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_STSCMD, val32);
|
||||||
|
|
||||||
|
/* Clear CRC and Link Fail flags in HT Link Control reg */
|
||||||
|
edac_pci_read_dword(dev, REG_HT_LINK, &val32);
|
||||||
|
if (val32 & HT_LINK_CLEAR_MASK)
|
||||||
|
edac_pci_write_dword(dev, REG_HT_LINK, val32);
|
||||||
|
|
||||||
|
/* Second clear all fault on the secondary interface */
|
||||||
|
|
||||||
|
/* Clear error flags in the memory-base limit reg. */
|
||||||
|
edac_pci_read_dword(dev, REG_MEM_LIM, &val32);
|
||||||
|
if (val32 & MEM_LIMIT_CLEAR_MASK)
|
||||||
|
edac_pci_write_dword(dev, REG_MEM_LIM, val32);
|
||||||
|
|
||||||
|
/* Clear Discard Timer Expired flag in Interrupt/Bridge Control reg */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_INTBRG_CTRL, &val32);
|
||||||
|
if (val32 & PCI_INTBRG_CTRL_CLEAR_MASK)
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_INTBRG_CTRL, val32);
|
||||||
|
|
||||||
|
/* Last enable error detections */
|
||||||
|
if (edac_op_state == EDAC_OPSTATE_POLL) {
|
||||||
|
/* Enable System Error reporting in global status register */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_STSCMD, &val32);
|
||||||
|
val32 |= PCI_STSCMD_SERREN;
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_STSCMD, val32);
|
||||||
|
|
||||||
|
/* Enable CRC Sync flood packets to HyperTransport Link */
|
||||||
|
edac_pci_read_dword(dev, REG_HT_LINK, &val32);
|
||||||
|
val32 |= HT_LINK_CRCFEN;
|
||||||
|
edac_pci_write_dword(dev, REG_HT_LINK, val32);
|
||||||
|
|
||||||
|
/* Enable SSE reporting etc in Interrupt control reg */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_INTBRG_CTRL, &val32);
|
||||||
|
val32 |= PCI_INTBRG_CTRL_POLL_MASK;
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_INTBRG_CTRL, val32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8111_pci_bridge_exit(struct amd8111_pci_info *pci_info)
|
||||||
|
{
|
||||||
|
u32 val32;
|
||||||
|
struct pci_dev *dev = pci_info->dev;
|
||||||
|
|
||||||
|
if (edac_op_state == EDAC_OPSTATE_POLL) {
|
||||||
|
/* Disable System Error reporting */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_STSCMD, &val32);
|
||||||
|
val32 &= ~PCI_STSCMD_SERREN;
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_STSCMD, val32);
|
||||||
|
|
||||||
|
/* Disable CRC flood packets */
|
||||||
|
edac_pci_read_dword(dev, REG_HT_LINK, &val32);
|
||||||
|
val32 &= ~HT_LINK_CRCFEN;
|
||||||
|
edac_pci_write_dword(dev, REG_HT_LINK, val32);
|
||||||
|
|
||||||
|
/* Disable DTSERREN/MARSP/SERREN in Interrupt Control reg */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_INTBRG_CTRL, &val32);
|
||||||
|
val32 &= ~PCI_INTBRG_CTRL_POLL_MASK;
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_INTBRG_CTRL, val32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8111_pci_bridge_check(struct edac_pci_ctl_info *edac_dev)
|
||||||
|
{
|
||||||
|
struct amd8111_pci_info *pci_info = edac_dev->pvt_info;
|
||||||
|
struct pci_dev *dev = pci_info->dev;
|
||||||
|
u32 val32;
|
||||||
|
|
||||||
|
/* Check out PCI Bridge Status and Command Register */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_STSCMD, &val32);
|
||||||
|
if (val32 & PCI_STSCMD_CLEAR_MASK) {
|
||||||
|
printk(KERN_INFO "Error(s) in PCI bridge status and command"
|
||||||
|
"register on device %s\n", pci_info->ctl_name);
|
||||||
|
printk(KERN_INFO "SSE: %d, RMA: %d, RTA: %d\n",
|
||||||
|
(val32 & PCI_STSCMD_SSE) != 0,
|
||||||
|
(val32 & PCI_STSCMD_RMA) != 0,
|
||||||
|
(val32 & PCI_STSCMD_RTA) != 0);
|
||||||
|
|
||||||
|
val32 |= PCI_STSCMD_CLEAR_MASK;
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_STSCMD, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check out HyperTransport Link Control Register */
|
||||||
|
edac_pci_read_dword(dev, REG_HT_LINK, &val32);
|
||||||
|
if (val32 & HT_LINK_LKFAIL) {
|
||||||
|
printk(KERN_INFO "Error(s) in hypertransport link control"
|
||||||
|
"register on device %s\n", pci_info->ctl_name);
|
||||||
|
printk(KERN_INFO "LKFAIL: %d\n",
|
||||||
|
(val32 & HT_LINK_LKFAIL) != 0);
|
||||||
|
|
||||||
|
val32 |= HT_LINK_LKFAIL;
|
||||||
|
edac_pci_write_dword(dev, REG_HT_LINK, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check out PCI Interrupt and Bridge Control Register */
|
||||||
|
edac_pci_read_dword(dev, REG_PCI_INTBRG_CTRL, &val32);
|
||||||
|
if (val32 & PCI_INTBRG_CTRL_DTSTAT) {
|
||||||
|
printk(KERN_INFO "Error(s) in PCI interrupt and bridge control"
|
||||||
|
"register on device %s\n", pci_info->ctl_name);
|
||||||
|
printk(KERN_INFO "DTSTAT: %d\n",
|
||||||
|
(val32 & PCI_INTBRG_CTRL_DTSTAT) != 0);
|
||||||
|
|
||||||
|
val32 |= PCI_INTBRG_CTRL_DTSTAT;
|
||||||
|
edac_pci_write_dword(dev, REG_PCI_INTBRG_CTRL, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check out PCI Bridge Memory Base-Limit Register */
|
||||||
|
edac_pci_read_dword(dev, REG_MEM_LIM, &val32);
|
||||||
|
if (val32 & MEM_LIMIT_CLEAR_MASK) {
|
||||||
|
printk(KERN_INFO
|
||||||
|
"Error(s) in mem limit register on %s device\n",
|
||||||
|
pci_info->ctl_name);
|
||||||
|
printk(KERN_INFO "DPE: %d, RSE: %d, RMA: %d\n"
|
||||||
|
"RTA: %d, STA: %d, MDPE: %d\n",
|
||||||
|
(val32 & MEM_LIMIT_DPE) != 0,
|
||||||
|
(val32 & MEM_LIMIT_RSE) != 0,
|
||||||
|
(val32 & MEM_LIMIT_RMA) != 0,
|
||||||
|
(val32 & MEM_LIMIT_RTA) != 0,
|
||||||
|
(val32 & MEM_LIMIT_STA) != 0,
|
||||||
|
(val32 & MEM_LIMIT_MDPE) != 0);
|
||||||
|
|
||||||
|
val32 |= MEM_LIMIT_CLEAR_MASK;
|
||||||
|
edac_pci_write_dword(dev, REG_MEM_LIM, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct resource *legacy_io_res;
|
||||||
|
static int at_compat_reg_broken;
|
||||||
|
#define LEGACY_NR_PORTS 1
|
||||||
|
|
||||||
|
/* device-specific methods for amd8111 LPC Bridge device */
|
||||||
|
static void amd8111_lpc_bridge_init(struct amd8111_dev_info *dev_info)
|
||||||
|
{
|
||||||
|
u8 val8;
|
||||||
|
struct pci_dev *dev = dev_info->dev;
|
||||||
|
|
||||||
|
/* First clear REG_AT_COMPAT[SERR, IOCHK] if necessary */
|
||||||
|
legacy_io_res = request_region(REG_AT_COMPAT, LEGACY_NR_PORTS,
|
||||||
|
AMD8111_EDAC_MOD_STR);
|
||||||
|
if (!legacy_io_res)
|
||||||
|
printk(KERN_INFO "%s: failed to request legacy I/O region "
|
||||||
|
"start %d, len %d\n", __func__,
|
||||||
|
REG_AT_COMPAT, LEGACY_NR_PORTS);
|
||||||
|
else {
|
||||||
|
val8 = __do_inb(REG_AT_COMPAT);
|
||||||
|
if (val8 == 0xff) { /* buggy port */
|
||||||
|
printk(KERN_INFO "%s: port %d is buggy, not supported"
|
||||||
|
" by hardware?\n", __func__, REG_AT_COMPAT);
|
||||||
|
at_compat_reg_broken = 1;
|
||||||
|
release_region(REG_AT_COMPAT, LEGACY_NR_PORTS);
|
||||||
|
legacy_io_res = NULL;
|
||||||
|
} else {
|
||||||
|
u8 out8 = 0;
|
||||||
|
if (val8 & AT_COMPAT_SERR)
|
||||||
|
out8 = AT_COMPAT_CLRSERR;
|
||||||
|
if (val8 & AT_COMPAT_IOCHK)
|
||||||
|
out8 |= AT_COMPAT_CLRIOCHK;
|
||||||
|
if (out8 > 0)
|
||||||
|
__do_outb(out8, REG_AT_COMPAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Second clear error flags on LPC bridge */
|
||||||
|
edac_pci_read_byte(dev, REG_IO_CTRL_1, &val8);
|
||||||
|
if (val8 & IO_CTRL_1_CLEAR_MASK)
|
||||||
|
edac_pci_write_byte(dev, REG_IO_CTRL_1, val8);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8111_lpc_bridge_exit(struct amd8111_dev_info *dev_info)
|
||||||
|
{
|
||||||
|
if (legacy_io_res)
|
||||||
|
release_region(REG_AT_COMPAT, LEGACY_NR_PORTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8111_lpc_bridge_check(struct edac_device_ctl_info *edac_dev)
|
||||||
|
{
|
||||||
|
struct amd8111_dev_info *dev_info = edac_dev->pvt_info;
|
||||||
|
struct pci_dev *dev = dev_info->dev;
|
||||||
|
u8 val8;
|
||||||
|
|
||||||
|
edac_pci_read_byte(dev, REG_IO_CTRL_1, &val8);
|
||||||
|
if (val8 & IO_CTRL_1_CLEAR_MASK) {
|
||||||
|
printk(KERN_INFO
|
||||||
|
"Error(s) in IO control register on %s device\n",
|
||||||
|
dev_info->ctl_name);
|
||||||
|
printk(KERN_INFO "LPC ERR: %d, PW2LPC: %d\n",
|
||||||
|
(val8 & IO_CTRL_1_LPC_ERR) != 0,
|
||||||
|
(val8 & IO_CTRL_1_PW2LPC) != 0);
|
||||||
|
|
||||||
|
val8 |= IO_CTRL_1_CLEAR_MASK;
|
||||||
|
edac_pci_write_byte(dev, REG_IO_CTRL_1, val8);
|
||||||
|
|
||||||
|
edac_device_handle_ue(edac_dev, 0, 0, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (at_compat_reg_broken == 0) {
|
||||||
|
u8 out8 = 0;
|
||||||
|
val8 = __do_inb(REG_AT_COMPAT);
|
||||||
|
if (val8 & AT_COMPAT_SERR)
|
||||||
|
out8 = AT_COMPAT_CLRSERR;
|
||||||
|
if (val8 & AT_COMPAT_IOCHK)
|
||||||
|
out8 |= AT_COMPAT_CLRIOCHK;
|
||||||
|
if (out8 > 0) {
|
||||||
|
__do_outb(out8, REG_AT_COMPAT);
|
||||||
|
edac_device_handle_ue(edac_dev, 0, 0,
|
||||||
|
edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* General devices represented by edac_device_ctl_info */
|
||||||
|
static struct amd8111_dev_info amd8111_devices[] = {
|
||||||
|
[LPC_BRIDGE] = {
|
||||||
|
.err_dev = PCI_DEVICE_ID_AMD_8111_LPC,
|
||||||
|
.ctl_name = "lpc",
|
||||||
|
.init = amd8111_lpc_bridge_init,
|
||||||
|
.exit = amd8111_lpc_bridge_exit,
|
||||||
|
.check = amd8111_lpc_bridge_check,
|
||||||
|
},
|
||||||
|
{0},
|
||||||
|
};
|
||||||
|
|
||||||
|
/* PCI controllers represented by edac_pci_ctl_info */
|
||||||
|
static struct amd8111_pci_info amd8111_pcis[] = {
|
||||||
|
[PCI_BRIDGE] = {
|
||||||
|
.err_dev = PCI_DEVICE_ID_AMD_8111_PCI,
|
||||||
|
.ctl_name = "AMD8111_PCI_Controller",
|
||||||
|
.init = amd8111_pci_bridge_init,
|
||||||
|
.exit = amd8111_pci_bridge_exit,
|
||||||
|
.check = amd8111_pci_bridge_check,
|
||||||
|
},
|
||||||
|
{0},
|
||||||
|
};
|
||||||
|
|
||||||
|
static int amd8111_dev_probe(struct pci_dev *dev,
|
||||||
|
const struct pci_device_id *id)
|
||||||
|
{
|
||||||
|
struct amd8111_dev_info *dev_info = &amd8111_devices[id->driver_data];
|
||||||
|
|
||||||
|
dev_info->dev = pci_get_device(PCI_VENDOR_ID_AMD,
|
||||||
|
dev_info->err_dev, NULL);
|
||||||
|
|
||||||
|
if (!dev_info->dev) {
|
||||||
|
printk(KERN_ERR "EDAC device not found:"
|
||||||
|
"vendor %x, device %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, dev_info->err_dev,
|
||||||
|
dev_info->ctl_name);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pci_enable_device(dev_info->dev)) {
|
||||||
|
pci_dev_put(dev_info->dev);
|
||||||
|
printk(KERN_ERR "failed to enable:"
|
||||||
|
"vendor %x, device %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, dev_info->err_dev,
|
||||||
|
dev_info->ctl_name);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we do not allocate extra private structure for
|
||||||
|
* edac_device_ctl_info, but make use of existing
|
||||||
|
* one instead.
|
||||||
|
*/
|
||||||
|
dev_info->edac_idx = edac_dev_idx++;
|
||||||
|
dev_info->edac_dev =
|
||||||
|
edac_device_alloc_ctl_info(0, dev_info->ctl_name, 1,
|
||||||
|
NULL, 0, 0,
|
||||||
|
NULL, 0, dev_info->edac_idx);
|
||||||
|
if (!dev_info->edac_dev)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
dev_info->edac_dev->pvt_info = dev_info;
|
||||||
|
dev_info->edac_dev->dev = &dev_info->dev->dev;
|
||||||
|
dev_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
|
||||||
|
dev_info->edac_dev->ctl_name = dev_info->ctl_name;
|
||||||
|
dev_info->edac_dev->dev_name = dev_info->dev->dev.bus_id;
|
||||||
|
|
||||||
|
if (edac_op_state == EDAC_OPSTATE_POLL)
|
||||||
|
dev_info->edac_dev->edac_check = dev_info->check;
|
||||||
|
|
||||||
|
if (dev_info->init)
|
||||||
|
dev_info->init(dev_info);
|
||||||
|
|
||||||
|
if (edac_device_add_device(dev_info->edac_dev) > 0) {
|
||||||
|
printk(KERN_ERR "failed to add edac_dev for %s\n",
|
||||||
|
dev_info->ctl_name);
|
||||||
|
edac_device_free_ctl_info(dev_info->edac_dev);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
printk(KERN_INFO "added one edac_dev on AMD8111 "
|
||||||
|
"vendor %x, device %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, dev_info->err_dev,
|
||||||
|
dev_info->ctl_name);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8111_dev_remove(struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
struct amd8111_dev_info *dev_info;
|
||||||
|
|
||||||
|
for (dev_info = amd8111_devices; dev_info->err_dev; dev_info++)
|
||||||
|
if (dev_info->dev->device == dev->device)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (!dev_info->err_dev) /* should never happen */
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (dev_info->edac_dev) {
|
||||||
|
edac_device_del_device(dev_info->edac_dev->dev);
|
||||||
|
edac_device_free_ctl_info(dev_info->edac_dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev_info->exit)
|
||||||
|
dev_info->exit(dev_info);
|
||||||
|
|
||||||
|
pci_dev_put(dev_info->dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int amd8111_pci_probe(struct pci_dev *dev,
|
||||||
|
const struct pci_device_id *id)
|
||||||
|
{
|
||||||
|
struct amd8111_pci_info *pci_info = &amd8111_pcis[id->driver_data];
|
||||||
|
|
||||||
|
pci_info->dev = pci_get_device(PCI_VENDOR_ID_AMD,
|
||||||
|
pci_info->err_dev, NULL);
|
||||||
|
|
||||||
|
if (!pci_info->dev) {
|
||||||
|
printk(KERN_ERR "EDAC device not found:"
|
||||||
|
"vendor %x, device %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, pci_info->err_dev,
|
||||||
|
pci_info->ctl_name);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pci_enable_device(pci_info->dev)) {
|
||||||
|
pci_dev_put(pci_info->dev);
|
||||||
|
printk(KERN_ERR "failed to enable:"
|
||||||
|
"vendor %x, device %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, pci_info->err_dev,
|
||||||
|
pci_info->ctl_name);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we do not allocate extra private structure for
|
||||||
|
* edac_pci_ctl_info, but make use of existing
|
||||||
|
* one instead.
|
||||||
|
*/
|
||||||
|
pci_info->edac_idx = edac_pci_alloc_index();
|
||||||
|
pci_info->edac_dev = edac_pci_alloc_ctl_info(0, pci_info->ctl_name);
|
||||||
|
if (!pci_info->edac_dev)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
pci_info->edac_dev->pvt_info = pci_info;
|
||||||
|
pci_info->edac_dev->dev = &pci_info->dev->dev;
|
||||||
|
pci_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
|
||||||
|
pci_info->edac_dev->ctl_name = pci_info->ctl_name;
|
||||||
|
pci_info->edac_dev->dev_name = pci_info->dev->dev.bus_id;
|
||||||
|
|
||||||
|
if (edac_op_state == EDAC_OPSTATE_POLL)
|
||||||
|
pci_info->edac_dev->edac_check = pci_info->check;
|
||||||
|
|
||||||
|
if (pci_info->init)
|
||||||
|
pci_info->init(pci_info);
|
||||||
|
|
||||||
|
if (edac_pci_add_device(pci_info->edac_dev, pci_info->edac_idx) > 0) {
|
||||||
|
printk(KERN_ERR "failed to add edac_pci for %s\n",
|
||||||
|
pci_info->ctl_name);
|
||||||
|
edac_pci_free_ctl_info(pci_info->edac_dev);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
printk(KERN_INFO "added one edac_pci on AMD8111 "
|
||||||
|
"vendor %x, device %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, pci_info->err_dev,
|
||||||
|
pci_info->ctl_name);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8111_pci_remove(struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
struct amd8111_pci_info *pci_info;
|
||||||
|
|
||||||
|
for (pci_info = amd8111_pcis; pci_info->err_dev; pci_info++)
|
||||||
|
if (pci_info->dev->device == dev->device)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (!pci_info->err_dev) /* should never happen */
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pci_info->edac_dev) {
|
||||||
|
edac_pci_del_device(pci_info->edac_dev->dev);
|
||||||
|
edac_pci_free_ctl_info(pci_info->edac_dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pci_info->exit)
|
||||||
|
pci_info->exit(pci_info);
|
||||||
|
|
||||||
|
pci_dev_put(pci_info->dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PCI Device ID talbe for general EDAC device */
|
||||||
|
static const struct pci_device_id amd8111_edac_dev_tbl[] = {
|
||||||
|
{
|
||||||
|
PCI_VEND_DEV(AMD, 8111_LPC),
|
||||||
|
.subvendor = PCI_ANY_ID,
|
||||||
|
.subdevice = PCI_ANY_ID,
|
||||||
|
.class = 0,
|
||||||
|
.class_mask = 0,
|
||||||
|
.driver_data = LPC_BRIDGE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
} /* table is NULL-terminated */
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(pci, amd8111_edac_dev_tbl);
|
||||||
|
|
||||||
|
static struct pci_driver amd8111_edac_dev_driver = {
|
||||||
|
.name = "AMD8111_EDAC_DEV",
|
||||||
|
.probe = amd8111_dev_probe,
|
||||||
|
.remove = amd8111_dev_remove,
|
||||||
|
.id_table = amd8111_edac_dev_tbl,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* PCI Device ID table for EDAC PCI controller */
|
||||||
|
static const struct pci_device_id amd8111_edac_pci_tbl[] = {
|
||||||
|
{
|
||||||
|
PCI_VEND_DEV(AMD, 8111_PCI),
|
||||||
|
.subvendor = PCI_ANY_ID,
|
||||||
|
.subdevice = PCI_ANY_ID,
|
||||||
|
.class = 0,
|
||||||
|
.class_mask = 0,
|
||||||
|
.driver_data = PCI_BRIDGE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
} /* table is NULL-terminated */
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(pci, amd8111_edac_pci_tbl);
|
||||||
|
|
||||||
|
static struct pci_driver amd8111_edac_pci_driver = {
|
||||||
|
.name = "AMD8111_EDAC_PCI",
|
||||||
|
.probe = amd8111_pci_probe,
|
||||||
|
.remove = amd8111_pci_remove,
|
||||||
|
.id_table = amd8111_edac_pci_tbl,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init amd8111_edac_init(void)
|
||||||
|
{
|
||||||
|
int val;
|
||||||
|
|
||||||
|
printk(KERN_INFO "AMD8111 EDAC driver " AMD8111_EDAC_REVISION "\n");
|
||||||
|
printk(KERN_INFO "\t(c) 2008 Wind River Systems, Inc.\n");
|
||||||
|
|
||||||
|
/* Only POLL mode supported so far */
|
||||||
|
edac_op_state = EDAC_OPSTATE_POLL;
|
||||||
|
|
||||||
|
val = pci_register_driver(&amd8111_edac_dev_driver);
|
||||||
|
val |= pci_register_driver(&amd8111_edac_pci_driver);
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __exit amd8111_edac_exit(void)
|
||||||
|
{
|
||||||
|
pci_unregister_driver(&amd8111_edac_pci_driver);
|
||||||
|
pci_unregister_driver(&amd8111_edac_dev_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module_init(amd8111_edac_init);
|
||||||
|
module_exit(amd8111_edac_exit);
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_AUTHOR("Cao Qingtao <qingtao.cao@windriver.com>\n");
|
||||||
|
MODULE_DESCRIPTION("AMD8111 HyperTransport I/O Hub EDAC kernel module");
|
130
drivers/edac/amd8111_edac.h
Normal file
130
drivers/edac/amd8111_edac.h
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
/*
|
||||||
|
* amd8111_edac.h, EDAC defs for AMD8111 hypertransport chip
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Wind River Systems, Inc.
|
||||||
|
*
|
||||||
|
* Authors: Cao Qingtao <qingtao.cao@windriver.com>
|
||||||
|
* Benjamin Walsh <benjamin.walsh@windriver.com>
|
||||||
|
* Hu Yongqi <yongqi.hu@windriver.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _AMD8111_EDAC_H_
|
||||||
|
#define _AMD8111_EDAC_H_
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* PCI Bridge Status and Command Register, DevA:0x04
|
||||||
|
************************************************************/
|
||||||
|
#define REG_PCI_STSCMD 0x04
|
||||||
|
enum pci_stscmd_bits {
|
||||||
|
PCI_STSCMD_SSE = BIT(30),
|
||||||
|
PCI_STSCMD_RMA = BIT(29),
|
||||||
|
PCI_STSCMD_RTA = BIT(28),
|
||||||
|
PCI_STSCMD_SERREN = BIT(8),
|
||||||
|
PCI_STSCMD_CLEAR_MASK = (PCI_STSCMD_SSE |
|
||||||
|
PCI_STSCMD_RMA |
|
||||||
|
PCI_STSCMD_RTA)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* PCI Bridge Memory Base-Limit Register, DevA:0x1c
|
||||||
|
************************************************************/
|
||||||
|
#define REG_MEM_LIM 0x1c
|
||||||
|
enum mem_limit_bits {
|
||||||
|
MEM_LIMIT_DPE = BIT(31),
|
||||||
|
MEM_LIMIT_RSE = BIT(30),
|
||||||
|
MEM_LIMIT_RMA = BIT(29),
|
||||||
|
MEM_LIMIT_RTA = BIT(28),
|
||||||
|
MEM_LIMIT_STA = BIT(27),
|
||||||
|
MEM_LIMIT_MDPE = BIT(24),
|
||||||
|
MEM_LIMIT_CLEAR_MASK = (MEM_LIMIT_DPE |
|
||||||
|
MEM_LIMIT_RSE |
|
||||||
|
MEM_LIMIT_RMA |
|
||||||
|
MEM_LIMIT_RTA |
|
||||||
|
MEM_LIMIT_STA |
|
||||||
|
MEM_LIMIT_MDPE)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* HyperTransport Link Control Register, DevA:0xc4
|
||||||
|
************************************************************/
|
||||||
|
#define REG_HT_LINK 0xc4
|
||||||
|
enum ht_link_bits {
|
||||||
|
HT_LINK_LKFAIL = BIT(4),
|
||||||
|
HT_LINK_CRCFEN = BIT(1),
|
||||||
|
HT_LINK_CLEAR_MASK = (HT_LINK_LKFAIL)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* PCI Bridge Interrupt and Bridge Control, DevA:0x3c
|
||||||
|
************************************************************/
|
||||||
|
#define REG_PCI_INTBRG_CTRL 0x3c
|
||||||
|
enum pci_intbrg_ctrl_bits {
|
||||||
|
PCI_INTBRG_CTRL_DTSERREN = BIT(27),
|
||||||
|
PCI_INTBRG_CTRL_DTSTAT = BIT(26),
|
||||||
|
PCI_INTBRG_CTRL_MARSP = BIT(21),
|
||||||
|
PCI_INTBRG_CTRL_SERREN = BIT(17),
|
||||||
|
PCI_INTBRG_CTRL_PEREN = BIT(16),
|
||||||
|
PCI_INTBRG_CTRL_CLEAR_MASK = (PCI_INTBRG_CTRL_DTSTAT),
|
||||||
|
PCI_INTBRG_CTRL_POLL_MASK = (PCI_INTBRG_CTRL_DTSERREN |
|
||||||
|
PCI_INTBRG_CTRL_MARSP |
|
||||||
|
PCI_INTBRG_CTRL_SERREN)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* I/O Control 1 Register, DevB:0x40
|
||||||
|
************************************************************/
|
||||||
|
#define REG_IO_CTRL_1 0x40
|
||||||
|
enum io_ctrl_1_bits {
|
||||||
|
IO_CTRL_1_NMIONERR = BIT(7),
|
||||||
|
IO_CTRL_1_LPC_ERR = BIT(6),
|
||||||
|
IO_CTRL_1_PW2LPC = BIT(1),
|
||||||
|
IO_CTRL_1_CLEAR_MASK = (IO_CTRL_1_LPC_ERR | IO_CTRL_1_PW2LPC)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* Legacy I/O Space Registers
|
||||||
|
************************************************************/
|
||||||
|
#define REG_AT_COMPAT 0x61
|
||||||
|
enum at_compat_bits {
|
||||||
|
AT_COMPAT_SERR = BIT(7),
|
||||||
|
AT_COMPAT_IOCHK = BIT(6),
|
||||||
|
AT_COMPAT_CLRIOCHK = BIT(3),
|
||||||
|
AT_COMPAT_CLRSERR = BIT(2),
|
||||||
|
};
|
||||||
|
|
||||||
|
struct amd8111_dev_info {
|
||||||
|
u16 err_dev; /* PCI Device ID */
|
||||||
|
struct pci_dev *dev;
|
||||||
|
int edac_idx; /* device index */
|
||||||
|
char *ctl_name;
|
||||||
|
struct edac_device_ctl_info *edac_dev;
|
||||||
|
void (*init)(struct amd8111_dev_info *dev_info);
|
||||||
|
void (*exit)(struct amd8111_dev_info *dev_info);
|
||||||
|
void (*check)(struct edac_device_ctl_info *edac_dev);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct amd8111_pci_info {
|
||||||
|
u16 err_dev; /* PCI Device ID */
|
||||||
|
struct pci_dev *dev;
|
||||||
|
int edac_idx; /* pci index */
|
||||||
|
const char *ctl_name;
|
||||||
|
struct edac_pci_ctl_info *edac_dev;
|
||||||
|
void (*init)(struct amd8111_pci_info *dev_info);
|
||||||
|
void (*exit)(struct amd8111_pci_info *dev_info);
|
||||||
|
void (*check)(struct edac_pci_ctl_info *edac_dev);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _AMD8111_EDAC_H_ */
|
379
drivers/edac/amd8131_edac.c
Normal file
379
drivers/edac/amd8131_edac.c
Normal file
@ -0,0 +1,379 @@
|
|||||||
|
/*
|
||||||
|
* amd8131_edac.c, AMD8131 hypertransport chip EDAC kernel module
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Wind River Systems, Inc.
|
||||||
|
*
|
||||||
|
* Authors: Cao Qingtao <qingtao.cao@windriver.com>
|
||||||
|
* Benjamin Walsh <benjamin.walsh@windriver.com>
|
||||||
|
* Hu Yongqi <yongqi.hu@windriver.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
#include <linux/edac.h>
|
||||||
|
#include <linux/pci_ids.h>
|
||||||
|
|
||||||
|
#include "edac_core.h"
|
||||||
|
#include "edac_module.h"
|
||||||
|
#include "amd8131_edac.h"
|
||||||
|
|
||||||
|
#define AMD8131_EDAC_REVISION " Ver: 1.0.0 " __DATE__
|
||||||
|
#define AMD8131_EDAC_MOD_STR "amd8131_edac"
|
||||||
|
|
||||||
|
/* Wrapper functions for accessing PCI configuration space */
|
||||||
|
static void edac_pci_read_dword(struct pci_dev *dev, int reg, u32 *val32)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = pci_read_config_dword(dev, reg, val32);
|
||||||
|
if (ret != 0)
|
||||||
|
printk(KERN_ERR AMD8131_EDAC_MOD_STR
|
||||||
|
" PCI Access Read Error at 0x%x\n", reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void edac_pci_write_dword(struct pci_dev *dev, int reg, u32 val32)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = pci_write_config_dword(dev, reg, val32);
|
||||||
|
if (ret != 0)
|
||||||
|
printk(KERN_ERR AMD8131_EDAC_MOD_STR
|
||||||
|
" PCI Access Write Error at 0x%x\n", reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char * const bridge_str[] = {
|
||||||
|
[NORTH_A] = "NORTH A",
|
||||||
|
[NORTH_B] = "NORTH B",
|
||||||
|
[SOUTH_A] = "SOUTH A",
|
||||||
|
[SOUTH_B] = "SOUTH B",
|
||||||
|
[NO_BRIDGE] = "NO BRIDGE",
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Support up to two AMD8131 chipsets on a platform */
|
||||||
|
static struct amd8131_dev_info amd8131_devices[] = {
|
||||||
|
{
|
||||||
|
.inst = NORTH_A,
|
||||||
|
.devfn = DEVFN_PCIX_BRIDGE_NORTH_A,
|
||||||
|
.ctl_name = "AMD8131_PCIX_NORTH_A",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.inst = NORTH_B,
|
||||||
|
.devfn = DEVFN_PCIX_BRIDGE_NORTH_B,
|
||||||
|
.ctl_name = "AMD8131_PCIX_NORTH_B",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.inst = SOUTH_A,
|
||||||
|
.devfn = DEVFN_PCIX_BRIDGE_SOUTH_A,
|
||||||
|
.ctl_name = "AMD8131_PCIX_SOUTH_A",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.inst = SOUTH_B,
|
||||||
|
.devfn = DEVFN_PCIX_BRIDGE_SOUTH_B,
|
||||||
|
.ctl_name = "AMD8131_PCIX_SOUTH_B",
|
||||||
|
},
|
||||||
|
{.inst = NO_BRIDGE,},
|
||||||
|
};
|
||||||
|
|
||||||
|
static void amd8131_pcix_init(struct amd8131_dev_info *dev_info)
|
||||||
|
{
|
||||||
|
u32 val32;
|
||||||
|
struct pci_dev *dev = dev_info->dev;
|
||||||
|
|
||||||
|
/* First clear error detection flags */
|
||||||
|
edac_pci_read_dword(dev, REG_MEM_LIM, &val32);
|
||||||
|
if (val32 & MEM_LIMIT_MASK)
|
||||||
|
edac_pci_write_dword(dev, REG_MEM_LIM, val32);
|
||||||
|
|
||||||
|
/* Clear Discard Timer Timedout flag */
|
||||||
|
edac_pci_read_dword(dev, REG_INT_CTLR, &val32);
|
||||||
|
if (val32 & INT_CTLR_DTS)
|
||||||
|
edac_pci_write_dword(dev, REG_INT_CTLR, val32);
|
||||||
|
|
||||||
|
/* Clear CRC Error flag on link side A */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_A, &val32);
|
||||||
|
if (val32 & LNK_CTRL_CRCERR_A)
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_A, val32);
|
||||||
|
|
||||||
|
/* Clear CRC Error flag on link side B */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_B, &val32);
|
||||||
|
if (val32 & LNK_CTRL_CRCERR_B)
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_B, val32);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Then enable all error detections.
|
||||||
|
*
|
||||||
|
* Setup Discard Timer Sync Flood Enable,
|
||||||
|
* System Error Enable and Parity Error Enable.
|
||||||
|
*/
|
||||||
|
edac_pci_read_dword(dev, REG_INT_CTLR, &val32);
|
||||||
|
val32 |= INT_CTLR_PERR | INT_CTLR_SERR | INT_CTLR_DTSE;
|
||||||
|
edac_pci_write_dword(dev, REG_INT_CTLR, val32);
|
||||||
|
|
||||||
|
/* Enable overall SERR Error detection */
|
||||||
|
edac_pci_read_dword(dev, REG_STS_CMD, &val32);
|
||||||
|
val32 |= STS_CMD_SERREN;
|
||||||
|
edac_pci_write_dword(dev, REG_STS_CMD, val32);
|
||||||
|
|
||||||
|
/* Setup CRC Flood Enable for link side A */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_A, &val32);
|
||||||
|
val32 |= LNK_CTRL_CRCFEN;
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_A, val32);
|
||||||
|
|
||||||
|
/* Setup CRC Flood Enable for link side B */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_B, &val32);
|
||||||
|
val32 |= LNK_CTRL_CRCFEN;
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_B, val32);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8131_pcix_exit(struct amd8131_dev_info *dev_info)
|
||||||
|
{
|
||||||
|
u32 val32;
|
||||||
|
struct pci_dev *dev = dev_info->dev;
|
||||||
|
|
||||||
|
/* Disable SERR, PERR and DTSE Error detection */
|
||||||
|
edac_pci_read_dword(dev, REG_INT_CTLR, &val32);
|
||||||
|
val32 &= ~(INT_CTLR_PERR | INT_CTLR_SERR | INT_CTLR_DTSE);
|
||||||
|
edac_pci_write_dword(dev, REG_INT_CTLR, val32);
|
||||||
|
|
||||||
|
/* Disable overall System Error detection */
|
||||||
|
edac_pci_read_dword(dev, REG_STS_CMD, &val32);
|
||||||
|
val32 &= ~STS_CMD_SERREN;
|
||||||
|
edac_pci_write_dword(dev, REG_STS_CMD, val32);
|
||||||
|
|
||||||
|
/* Disable CRC Sync Flood on link side A */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_A, &val32);
|
||||||
|
val32 &= ~LNK_CTRL_CRCFEN;
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_A, val32);
|
||||||
|
|
||||||
|
/* Disable CRC Sync Flood on link side B */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_B, &val32);
|
||||||
|
val32 &= ~LNK_CTRL_CRCFEN;
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_B, val32);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8131_pcix_check(struct edac_pci_ctl_info *edac_dev)
|
||||||
|
{
|
||||||
|
struct amd8131_dev_info *dev_info = edac_dev->pvt_info;
|
||||||
|
struct pci_dev *dev = dev_info->dev;
|
||||||
|
u32 val32;
|
||||||
|
|
||||||
|
/* Check PCI-X Bridge Memory Base-Limit Register for errors */
|
||||||
|
edac_pci_read_dword(dev, REG_MEM_LIM, &val32);
|
||||||
|
if (val32 & MEM_LIMIT_MASK) {
|
||||||
|
printk(KERN_INFO "Error(s) in mem limit register "
|
||||||
|
"on %s bridge\n", dev_info->ctl_name);
|
||||||
|
printk(KERN_INFO "DPE: %d, RSE: %d, RMA: %d\n"
|
||||||
|
"RTA: %d, STA: %d, MDPE: %d\n",
|
||||||
|
val32 & MEM_LIMIT_DPE,
|
||||||
|
val32 & MEM_LIMIT_RSE,
|
||||||
|
val32 & MEM_LIMIT_RMA,
|
||||||
|
val32 & MEM_LIMIT_RTA,
|
||||||
|
val32 & MEM_LIMIT_STA,
|
||||||
|
val32 & MEM_LIMIT_MDPE);
|
||||||
|
|
||||||
|
val32 |= MEM_LIMIT_MASK;
|
||||||
|
edac_pci_write_dword(dev, REG_MEM_LIM, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if Discard Timer timed out */
|
||||||
|
edac_pci_read_dword(dev, REG_INT_CTLR, &val32);
|
||||||
|
if (val32 & INT_CTLR_DTS) {
|
||||||
|
printk(KERN_INFO "Error(s) in interrupt and control register "
|
||||||
|
"on %s bridge\n", dev_info->ctl_name);
|
||||||
|
printk(KERN_INFO "DTS: %d\n", val32 & INT_CTLR_DTS);
|
||||||
|
|
||||||
|
val32 |= INT_CTLR_DTS;
|
||||||
|
edac_pci_write_dword(dev, REG_INT_CTLR, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if CRC error happens on link side A */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_A, &val32);
|
||||||
|
if (val32 & LNK_CTRL_CRCERR_A) {
|
||||||
|
printk(KERN_INFO "Error(s) in link conf and control register "
|
||||||
|
"on %s bridge\n", dev_info->ctl_name);
|
||||||
|
printk(KERN_INFO "CRCERR: %d\n", val32 & LNK_CTRL_CRCERR_A);
|
||||||
|
|
||||||
|
val32 |= LNK_CTRL_CRCERR_A;
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_A, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if CRC error happens on link side B */
|
||||||
|
edac_pci_read_dword(dev, REG_LNK_CTRL_B, &val32);
|
||||||
|
if (val32 & LNK_CTRL_CRCERR_B) {
|
||||||
|
printk(KERN_INFO "Error(s) in link conf and control register "
|
||||||
|
"on %s bridge\n", dev_info->ctl_name);
|
||||||
|
printk(KERN_INFO "CRCERR: %d\n", val32 & LNK_CTRL_CRCERR_B);
|
||||||
|
|
||||||
|
val32 |= LNK_CTRL_CRCERR_B;
|
||||||
|
edac_pci_write_dword(dev, REG_LNK_CTRL_B, val32);
|
||||||
|
|
||||||
|
edac_pci_handle_npe(edac_dev, edac_dev->ctl_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct amd8131_info amd8131_chipset = {
|
||||||
|
.err_dev = PCI_DEVICE_ID_AMD_8131_APIC,
|
||||||
|
.devices = amd8131_devices,
|
||||||
|
.init = amd8131_pcix_init,
|
||||||
|
.exit = amd8131_pcix_exit,
|
||||||
|
.check = amd8131_pcix_check,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There are 4 PCIX Bridges on ATCA-6101 that share the same PCI Device ID,
|
||||||
|
* so amd8131_probe() would be called by kernel 4 times, with different
|
||||||
|
* address of pci_dev for each of them each time.
|
||||||
|
*/
|
||||||
|
static int amd8131_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
|
{
|
||||||
|
struct amd8131_dev_info *dev_info;
|
||||||
|
|
||||||
|
for (dev_info = amd8131_chipset.devices; dev_info->inst != NO_BRIDGE;
|
||||||
|
dev_info++)
|
||||||
|
if (dev_info->devfn == dev->devfn)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (dev_info->inst == NO_BRIDGE) /* should never happen */
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We can't call pci_get_device() as we are used to do because
|
||||||
|
* there are 4 of them but pci_dev_get() instead.
|
||||||
|
*/
|
||||||
|
dev_info->dev = pci_dev_get(dev);
|
||||||
|
|
||||||
|
if (pci_enable_device(dev_info->dev)) {
|
||||||
|
pci_dev_put(dev_info->dev);
|
||||||
|
printk(KERN_ERR "failed to enable:"
|
||||||
|
"vendor %x, device %x, devfn %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, amd8131_chipset.err_dev,
|
||||||
|
dev_info->devfn, dev_info->ctl_name);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we do not allocate extra private structure for
|
||||||
|
* edac_pci_ctl_info, but make use of existing
|
||||||
|
* one instead.
|
||||||
|
*/
|
||||||
|
dev_info->edac_idx = edac_pci_alloc_index();
|
||||||
|
dev_info->edac_dev = edac_pci_alloc_ctl_info(0, dev_info->ctl_name);
|
||||||
|
if (!dev_info->edac_dev)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
dev_info->edac_dev->pvt_info = dev_info;
|
||||||
|
dev_info->edac_dev->dev = &dev_info->dev->dev;
|
||||||
|
dev_info->edac_dev->mod_name = AMD8131_EDAC_MOD_STR;
|
||||||
|
dev_info->edac_dev->ctl_name = dev_info->ctl_name;
|
||||||
|
dev_info->edac_dev->dev_name = dev_info->dev->dev.bus_id;
|
||||||
|
|
||||||
|
if (edac_op_state == EDAC_OPSTATE_POLL)
|
||||||
|
dev_info->edac_dev->edac_check = amd8131_chipset.check;
|
||||||
|
|
||||||
|
if (amd8131_chipset.init)
|
||||||
|
amd8131_chipset.init(dev_info);
|
||||||
|
|
||||||
|
if (edac_pci_add_device(dev_info->edac_dev, dev_info->edac_idx) > 0) {
|
||||||
|
printk(KERN_ERR "failed edac_pci_add_device() for %s\n",
|
||||||
|
dev_info->ctl_name);
|
||||||
|
edac_pci_free_ctl_info(dev_info->edac_dev);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
printk(KERN_INFO "added one device on AMD8131 "
|
||||||
|
"vendor %x, device %x, devfn %x, name %s\n",
|
||||||
|
PCI_VENDOR_ID_AMD, amd8131_chipset.err_dev,
|
||||||
|
dev_info->devfn, dev_info->ctl_name);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void amd8131_remove(struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
struct amd8131_dev_info *dev_info;
|
||||||
|
|
||||||
|
for (dev_info = amd8131_chipset.devices; dev_info->inst != NO_BRIDGE;
|
||||||
|
dev_info++)
|
||||||
|
if (dev_info->devfn == dev->devfn)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (dev_info->inst == NO_BRIDGE) /* should never happen */
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (dev_info->edac_dev) {
|
||||||
|
edac_pci_del_device(dev_info->edac_dev->dev);
|
||||||
|
edac_pci_free_ctl_info(dev_info->edac_dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (amd8131_chipset.exit)
|
||||||
|
amd8131_chipset.exit(dev_info);
|
||||||
|
|
||||||
|
pci_dev_put(dev_info->dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct pci_device_id amd8131_edac_pci_tbl[] = {
|
||||||
|
{
|
||||||
|
PCI_VEND_DEV(AMD, 8131_BRIDGE),
|
||||||
|
.subvendor = PCI_ANY_ID,
|
||||||
|
.subdevice = PCI_ANY_ID,
|
||||||
|
.class = 0,
|
||||||
|
.class_mask = 0,
|
||||||
|
.driver_data = 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
} /* table is NULL-terminated */
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(pci, amd8131_edac_pci_tbl);
|
||||||
|
|
||||||
|
static struct pci_driver amd8131_edac_driver = {
|
||||||
|
.name = AMD8131_EDAC_MOD_STR,
|
||||||
|
.probe = amd8131_probe,
|
||||||
|
.remove = amd8131_remove,
|
||||||
|
.id_table = amd8131_edac_pci_tbl,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init amd8131_edac_init(void)
|
||||||
|
{
|
||||||
|
printk(KERN_INFO "AMD8131 EDAC driver " AMD8131_EDAC_REVISION "\n");
|
||||||
|
printk(KERN_INFO "\t(c) 2008 Wind River Systems, Inc.\n");
|
||||||
|
|
||||||
|
/* Only POLL mode supported so far */
|
||||||
|
edac_op_state = EDAC_OPSTATE_POLL;
|
||||||
|
|
||||||
|
return pci_register_driver(&amd8131_edac_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __exit amd8131_edac_exit(void)
|
||||||
|
{
|
||||||
|
pci_unregister_driver(&amd8131_edac_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(amd8131_edac_init);
|
||||||
|
module_exit(amd8131_edac_exit);
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_AUTHOR("Cao Qingtao <qingtao.cao@windriver.com>\n");
|
||||||
|
MODULE_DESCRIPTION("AMD8131 HyperTransport PCI-X Tunnel EDAC kernel module");
|
119
drivers/edac/amd8131_edac.h
Normal file
119
drivers/edac/amd8131_edac.h
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
/*
|
||||||
|
* amd8131_edac.h, EDAC defs for AMD8131 hypertransport chip
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008 Wind River Systems, Inc.
|
||||||
|
*
|
||||||
|
* Authors: Cao Qingtao <qingtao.cao@windriver.com>
|
||||||
|
* Benjamin Walsh <benjamin.walsh@windriver.com>
|
||||||
|
* Hu Yongqi <yongqi.hu@windriver.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _AMD8131_EDAC_H_
|
||||||
|
#define _AMD8131_EDAC_H_
|
||||||
|
|
||||||
|
#define DEVFN_PCIX_BRIDGE_NORTH_A 8
|
||||||
|
#define DEVFN_PCIX_BRIDGE_NORTH_B 16
|
||||||
|
#define DEVFN_PCIX_BRIDGE_SOUTH_A 24
|
||||||
|
#define DEVFN_PCIX_BRIDGE_SOUTH_B 32
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* PCI-X Bridge Status and Command Register, DevA:0x04
|
||||||
|
************************************************************/
|
||||||
|
#define REG_STS_CMD 0x04
|
||||||
|
enum sts_cmd_bits {
|
||||||
|
STS_CMD_SSE = BIT(30),
|
||||||
|
STS_CMD_SERREN = BIT(8)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* PCI-X Bridge Interrupt and Bridge Control Register,
|
||||||
|
************************************************************/
|
||||||
|
#define REG_INT_CTLR 0x3c
|
||||||
|
enum int_ctlr_bits {
|
||||||
|
INT_CTLR_DTSE = BIT(27),
|
||||||
|
INT_CTLR_DTS = BIT(26),
|
||||||
|
INT_CTLR_SERR = BIT(17),
|
||||||
|
INT_CTLR_PERR = BIT(16)
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* PCI-X Bridge Memory Base-Limit Register, DevA:0x1C
|
||||||
|
************************************************************/
|
||||||
|
#define REG_MEM_LIM 0x1c
|
||||||
|
enum mem_limit_bits {
|
||||||
|
MEM_LIMIT_DPE = BIT(31),
|
||||||
|
MEM_LIMIT_RSE = BIT(30),
|
||||||
|
MEM_LIMIT_RMA = BIT(29),
|
||||||
|
MEM_LIMIT_RTA = BIT(28),
|
||||||
|
MEM_LIMIT_STA = BIT(27),
|
||||||
|
MEM_LIMIT_MDPE = BIT(24),
|
||||||
|
MEM_LIMIT_MASK = MEM_LIMIT_DPE|MEM_LIMIT_RSE|MEM_LIMIT_RMA|
|
||||||
|
MEM_LIMIT_RTA|MEM_LIMIT_STA|MEM_LIMIT_MDPE
|
||||||
|
};
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* Link Configuration And Control Register, side A
|
||||||
|
************************************************************/
|
||||||
|
#define REG_LNK_CTRL_A 0xc4
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
* Link Configuration And Control Register, side B
|
||||||
|
************************************************************/
|
||||||
|
#define REG_LNK_CTRL_B 0xc8
|
||||||
|
|
||||||
|
enum lnk_ctrl_bits {
|
||||||
|
LNK_CTRL_CRCERR_A = BIT(9),
|
||||||
|
LNK_CTRL_CRCERR_B = BIT(8),
|
||||||
|
LNK_CTRL_CRCFEN = BIT(1)
|
||||||
|
};
|
||||||
|
|
||||||
|
enum pcix_bridge_inst {
|
||||||
|
NORTH_A = 0,
|
||||||
|
NORTH_B = 1,
|
||||||
|
SOUTH_A = 2,
|
||||||
|
SOUTH_B = 3,
|
||||||
|
NO_BRIDGE = 4
|
||||||
|
};
|
||||||
|
|
||||||
|
struct amd8131_dev_info {
|
||||||
|
int devfn;
|
||||||
|
enum pcix_bridge_inst inst;
|
||||||
|
struct pci_dev *dev;
|
||||||
|
int edac_idx; /* pci device index */
|
||||||
|
char *ctl_name;
|
||||||
|
struct edac_pci_ctl_info *edac_dev;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* AMD8131 chipset has two pairs of PCIX Bridge and related IOAPIC
|
||||||
|
* Controler, and ATCA-6101 has two AMD8131 chipsets, so there are
|
||||||
|
* four PCIX Bridges on ATCA-6101 altogether.
|
||||||
|
*
|
||||||
|
* These PCIX Bridges share the same PCI Device ID and are all of
|
||||||
|
* Function Zero, they could be discrimated by their pci_dev->devfn.
|
||||||
|
* They share the same set of init/check/exit methods, and their
|
||||||
|
* private structures are collected in the devices[] array.
|
||||||
|
*/
|
||||||
|
struct amd8131_info {
|
||||||
|
u16 err_dev; /* PCI Device ID for AMD8131 APIC*/
|
||||||
|
struct amd8131_dev_info *devices;
|
||||||
|
void (*init)(struct amd8131_dev_info *dev_info);
|
||||||
|
void (*exit)(struct amd8131_dev_info *dev_info);
|
||||||
|
void (*check)(struct edac_pci_ctl_info *edac_dev);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _AMD8131_EDAC_H_ */
|
||||||
|
|
@ -49,6 +49,10 @@
|
|||||||
#define edac_printk(level, prefix, fmt, arg...) \
|
#define edac_printk(level, prefix, fmt, arg...) \
|
||||||
printk(level "EDAC " prefix ": " fmt, ##arg)
|
printk(level "EDAC " prefix ": " fmt, ##arg)
|
||||||
|
|
||||||
|
#define edac_printk_verbose(level, prefix, fmt, arg...) \
|
||||||
|
printk(level "EDAC " prefix ": " "in %s, line at %d: " fmt, \
|
||||||
|
__FILE__, __LINE__, ##arg)
|
||||||
|
|
||||||
#define edac_mc_printk(mci, level, fmt, arg...) \
|
#define edac_mc_printk(mci, level, fmt, arg...) \
|
||||||
printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg)
|
printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg)
|
||||||
|
|
||||||
@ -71,11 +75,20 @@
|
|||||||
#ifdef CONFIG_EDAC_DEBUG
|
#ifdef CONFIG_EDAC_DEBUG
|
||||||
extern int edac_debug_level;
|
extern int edac_debug_level;
|
||||||
|
|
||||||
|
#ifndef CONFIG_EDAC_DEBUG_VERBOSE
|
||||||
#define edac_debug_printk(level, fmt, arg...) \
|
#define edac_debug_printk(level, fmt, arg...) \
|
||||||
do { \
|
do { \
|
||||||
if (level <= edac_debug_level) \
|
if (level <= edac_debug_level) \
|
||||||
edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
|
edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
|
||||||
} while(0)
|
} while (0)
|
||||||
|
#else /* CONFIG_EDAC_DEBUG_VERBOSE */
|
||||||
|
#define edac_debug_printk(level, fmt, arg...) \
|
||||||
|
do { \
|
||||||
|
if (level <= edac_debug_level) \
|
||||||
|
edac_printk_verbose(KERN_DEBUG, EDAC_DEBUG, fmt, \
|
||||||
|
##arg); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
|
#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
|
||||||
#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ )
|
#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ )
|
||||||
@ -831,6 +844,7 @@ extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci);
|
|||||||
extern void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
|
extern void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
|
||||||
unsigned long value);
|
unsigned long value);
|
||||||
|
|
||||||
|
extern int edac_pci_alloc_index(void);
|
||||||
extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
|
extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
|
||||||
extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
|
extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
static DEFINE_MUTEX(edac_pci_ctls_mutex);
|
static DEFINE_MUTEX(edac_pci_ctls_mutex);
|
||||||
static LIST_HEAD(edac_pci_list);
|
static LIST_HEAD(edac_pci_list);
|
||||||
|
static atomic_t pci_indexes = ATOMIC_INIT(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edac_pci_alloc_ctl_info
|
* edac_pci_alloc_ctl_info
|
||||||
@ -317,6 +318,19 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
|
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* edac_pci_alloc_index: Allocate a unique PCI index number
|
||||||
|
*
|
||||||
|
* Return:
|
||||||
|
* allocated index number
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int edac_pci_alloc_index(void)
|
||||||
|
{
|
||||||
|
return atomic_inc_return(&pci_indexes) - 1;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edac_pci_add_device: Insert the 'edac_dev' structure into the
|
* edac_pci_add_device: Insert the 'edac_dev' structure into the
|
||||||
* edac_pci global list and create sysfs entries associated with
|
* edac_pci global list and create sysfs entries associated with
|
||||||
|
1448
drivers/edac/ppc4xx_edac.c
Normal file
1448
drivers/edac/ppc4xx_edac.c
Normal file
File diff suppressed because it is too large
Load Diff
172
drivers/edac/ppc4xx_edac.h
Normal file
172
drivers/edac/ppc4xx_edac.h
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008 Nuovation System Designs, LLC
|
||||||
|
* Grant Erickson <gerickson@nuovations.com>
|
||||||
|
*
|
||||||
|
* This file defines processor mnemonics for accessing and managing
|
||||||
|
* the IBM DDR1/DDR2 ECC controller found in the 405EX[r], 440SP,
|
||||||
|
* 440SPe, 460EX, 460GT and 460SX.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; version 2 of the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __PPC4XX_EDAC_H
|
||||||
|
#define __PPC4XX_EDAC_H
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Macro for generating register field mnemonics
|
||||||
|
*/
|
||||||
|
#define PPC_REG_BITS 32
|
||||||
|
#define PPC_REG_VAL(bit, val) ((val) << ((PPC_REG_BITS - 1) - (bit)))
|
||||||
|
#define PPC_REG_DECODE(bit, val) ((val) >> ((PPC_REG_BITS - 1) - (bit)))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IBM 4xx DDR1/DDR2 SDRAM memory controller registers (at least those
|
||||||
|
* relevant to ECC)
|
||||||
|
*/
|
||||||
|
#define SDRAM_BESR 0x00 /* Error status (read/clear) */
|
||||||
|
#define SDRAM_BESRT 0x01 /* Error statuss (test/set) */
|
||||||
|
#define SDRAM_BEARL 0x02 /* Error address low */
|
||||||
|
#define SDRAM_BEARH 0x03 /* Error address high */
|
||||||
|
#define SDRAM_WMIRQ 0x06 /* Write master (read/clear) */
|
||||||
|
#define SDRAM_WMIRQT 0x07 /* Write master (test/set) */
|
||||||
|
#define SDRAM_MCOPT1 0x20 /* Controller options 1 */
|
||||||
|
#define SDRAM_MBXCF_BASE 0x40 /* Bank n configuration base */
|
||||||
|
#define SDRAM_MBXCF(n) (SDRAM_MBXCF_BASE + (4 * (n)))
|
||||||
|
#define SDRAM_MB0CF SDRAM_MBXCF(0)
|
||||||
|
#define SDRAM_MB1CF SDRAM_MBXCF(1)
|
||||||
|
#define SDRAM_MB2CF SDRAM_MBXCF(2)
|
||||||
|
#define SDRAM_MB3CF SDRAM_MBXCF(3)
|
||||||
|
#define SDRAM_ECCCR 0x98 /* ECC error status */
|
||||||
|
#define SDRAM_ECCES SDRAM_ECCCR
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PLB Master IDs
|
||||||
|
*/
|
||||||
|
#define SDRAM_PLB_M0ID_FIRST 0
|
||||||
|
#define SDRAM_PLB_M0ID_ICU SDRAM_PLB_M0ID_FIRST
|
||||||
|
#define SDRAM_PLB_M0ID_PCIE0 1
|
||||||
|
#define SDRAM_PLB_M0ID_PCIE1 2
|
||||||
|
#define SDRAM_PLB_M0ID_DMA 3
|
||||||
|
#define SDRAM_PLB_M0ID_DCU 4
|
||||||
|
#define SDRAM_PLB_M0ID_OPB 5
|
||||||
|
#define SDRAM_PLB_M0ID_MAL 6
|
||||||
|
#define SDRAM_PLB_M0ID_SEC 7
|
||||||
|
#define SDRAM_PLB_M0ID_AHB 8
|
||||||
|
#define SDRAM_PLB_M0ID_LAST SDRAM_PLB_M0ID_AHB
|
||||||
|
#define SDRAM_PLB_M0ID_COUNT (SDRAM_PLB_M0ID_LAST - \
|
||||||
|
SDRAM_PLB_M0ID_FIRST + 1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Memory Controller Bus Error Status Register
|
||||||
|
*/
|
||||||
|
#define SDRAM_BESR_MASK PPC_REG_VAL(7, 0xFF)
|
||||||
|
#define SDRAM_BESR_M0ID_MASK PPC_REG_VAL(3, 0xF)
|
||||||
|
#define SDRAM_BESR_M0ID_DECODE(n) PPC_REG_DECODE(3, n)
|
||||||
|
#define SDRAM_BESR_M0ID_ICU PPC_REG_VAL(3, SDRAM_PLB_M0ID_ICU)
|
||||||
|
#define SDRAM_BESR_M0ID_PCIE0 PPC_REG_VAL(3, SDRAM_PLB_M0ID_PCIE0)
|
||||||
|
#define SDRAM_BESR_M0ID_PCIE1 PPC_REG_VAL(3, SDRAM_PLB_M0ID_PCIE1)
|
||||||
|
#define SDRAM_BESR_M0ID_DMA PPC_REG_VAL(3, SDRAM_PLB_M0ID_DMA)
|
||||||
|
#define SDRAM_BESR_M0ID_DCU PPC_REG_VAL(3, SDRAM_PLB_M0ID_DCU)
|
||||||
|
#define SDRAM_BESR_M0ID_OPB PPC_REG_VAL(3, SDRAM_PLB_M0ID_OPB)
|
||||||
|
#define SDRAM_BESR_M0ID_MAL PPC_REG_VAL(3, SDRAM_PLB_M0ID_MAL)
|
||||||
|
#define SDRAM_BESR_M0ID_SEC PPC_REG_VAL(3, SDRAM_PLB_M0ID_SEC)
|
||||||
|
#define SDRAM_BESR_M0ID_AHB PPC_REG_VAL(3, SDRAM_PLB_M0ID_AHB)
|
||||||
|
#define SDRAM_BESR_M0ET_MASK PPC_REG_VAL(6, 0x7)
|
||||||
|
#define SDRAM_BESR_M0ET_NONE PPC_REG_VAL(6, 0)
|
||||||
|
#define SDRAM_BESR_M0ET_ECC PPC_REG_VAL(6, 1)
|
||||||
|
#define SDRAM_BESR_M0RW_MASK PPC_REG_VAL(7, 1)
|
||||||
|
#define SDRAM_BESR_M0RW_WRITE PPC_REG_VAL(7, 0)
|
||||||
|
#define SDRAM_BESR_M0RW_READ PPC_REG_VAL(7, 1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Memory Controller PLB Write Master Interrupt Register
|
||||||
|
*/
|
||||||
|
#define SDRAM_WMIRQ_MASK PPC_REG_VAL(8, 0x1FF)
|
||||||
|
#define SDRAM_WMIRQ_ENCODE(id) PPC_REG_VAL((id % \
|
||||||
|
SDRAM_PLB_M0ID_COUNT), 1)
|
||||||
|
#define SDRAM_WMIRQ_ICU PPC_REG_VAL(SDRAM_PLB_M0ID_ICU, 1)
|
||||||
|
#define SDRAM_WMIRQ_PCIE0 PPC_REG_VAL(SDRAM_PLB_M0ID_PCIE0, 1)
|
||||||
|
#define SDRAM_WMIRQ_PCIE1 PPC_REG_VAL(SDRAM_PLB_M0ID_PCIE1, 1)
|
||||||
|
#define SDRAM_WMIRQ_DMA PPC_REG_VAL(SDRAM_PLB_M0ID_DMA, 1)
|
||||||
|
#define SDRAM_WMIRQ_DCU PPC_REG_VAL(SDRAM_PLB_M0ID_DCU, 1)
|
||||||
|
#define SDRAM_WMIRQ_OPB PPC_REG_VAL(SDRAM_PLB_M0ID_OPB, 1)
|
||||||
|
#define SDRAM_WMIRQ_MAL PPC_REG_VAL(SDRAM_PLB_M0ID_MAL, 1)
|
||||||
|
#define SDRAM_WMIRQ_SEC PPC_REG_VAL(SDRAM_PLB_M0ID_SEC, 1)
|
||||||
|
#define SDRAM_WMIRQ_AHB PPC_REG_VAL(SDRAM_PLB_M0ID_AHB, 1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Memory Controller Options 1 Register
|
||||||
|
*/
|
||||||
|
#define SDRAM_MCOPT1_MCHK_MASK PPC_REG_VAL(3, 0x3) /* ECC mask */
|
||||||
|
#define SDRAM_MCOPT1_MCHK_NON PPC_REG_VAL(3, 0x0) /* No ECC gen */
|
||||||
|
#define SDRAM_MCOPT1_MCHK_GEN PPC_REG_VAL(3, 0x2) /* ECC gen */
|
||||||
|
#define SDRAM_MCOPT1_MCHK_CHK PPC_REG_VAL(3, 0x1) /* ECC gen and chk */
|
||||||
|
#define SDRAM_MCOPT1_MCHK_CHK_REP PPC_REG_VAL(3, 0x3) /* ECC gen/chk/rpt */
|
||||||
|
#define SDRAM_MCOPT1_MCHK_DECODE(n) ((((u32)(n)) >> 28) & 0x3)
|
||||||
|
#define SDRAM_MCOPT1_RDEN_MASK PPC_REG_VAL(4, 0x1) /* Rgstrd DIMM mask */
|
||||||
|
#define SDRAM_MCOPT1_RDEN PPC_REG_VAL(4, 0x1) /* Rgstrd DIMM enbl */
|
||||||
|
#define SDRAM_MCOPT1_WDTH_MASK PPC_REG_VAL(7, 0x1) /* Width mask */
|
||||||
|
#define SDRAM_MCOPT1_WDTH_32 PPC_REG_VAL(7, 0x0) /* 32 bits */
|
||||||
|
#define SDRAM_MCOPT1_WDTH_16 PPC_REG_VAL(7, 0x1) /* 16 bits */
|
||||||
|
#define SDRAM_MCOPT1_DDR_TYPE_MASK PPC_REG_VAL(11, 0x1) /* DDR type mask */
|
||||||
|
#define SDRAM_MCOPT1_DDR1_TYPE PPC_REG_VAL(11, 0x0) /* DDR1 type */
|
||||||
|
#define SDRAM_MCOPT1_DDR2_TYPE PPC_REG_VAL(11, 0x1) /* DDR2 type */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Memory Bank 0 - n Configuration Register
|
||||||
|
*/
|
||||||
|
#define SDRAM_MBCF_BA_MASK PPC_REG_VAL(12, 0x1FFF)
|
||||||
|
#define SDRAM_MBCF_SZ_MASK PPC_REG_VAL(19, 0xF)
|
||||||
|
#define SDRAM_MBCF_SZ_DECODE(mbxcf) PPC_REG_DECODE(19, mbxcf)
|
||||||
|
#define SDRAM_MBCF_SZ_4MB PPC_REG_VAL(19, 0x0)
|
||||||
|
#define SDRAM_MBCF_SZ_8MB PPC_REG_VAL(19, 0x1)
|
||||||
|
#define SDRAM_MBCF_SZ_16MB PPC_REG_VAL(19, 0x2)
|
||||||
|
#define SDRAM_MBCF_SZ_32MB PPC_REG_VAL(19, 0x3)
|
||||||
|
#define SDRAM_MBCF_SZ_64MB PPC_REG_VAL(19, 0x4)
|
||||||
|
#define SDRAM_MBCF_SZ_128MB PPC_REG_VAL(19, 0x5)
|
||||||
|
#define SDRAM_MBCF_SZ_256MB PPC_REG_VAL(19, 0x6)
|
||||||
|
#define SDRAM_MBCF_SZ_512MB PPC_REG_VAL(19, 0x7)
|
||||||
|
#define SDRAM_MBCF_SZ_1GB PPC_REG_VAL(19, 0x8)
|
||||||
|
#define SDRAM_MBCF_SZ_2GB PPC_REG_VAL(19, 0x9)
|
||||||
|
#define SDRAM_MBCF_SZ_4GB PPC_REG_VAL(19, 0xA)
|
||||||
|
#define SDRAM_MBCF_SZ_8GB PPC_REG_VAL(19, 0xB)
|
||||||
|
#define SDRAM_MBCF_AM_MASK PPC_REG_VAL(23, 0xF)
|
||||||
|
#define SDRAM_MBCF_AM_MODE0 PPC_REG_VAL(23, 0x0)
|
||||||
|
#define SDRAM_MBCF_AM_MODE1 PPC_REG_VAL(23, 0x1)
|
||||||
|
#define SDRAM_MBCF_AM_MODE2 PPC_REG_VAL(23, 0x2)
|
||||||
|
#define SDRAM_MBCF_AM_MODE3 PPC_REG_VAL(23, 0x3)
|
||||||
|
#define SDRAM_MBCF_AM_MODE4 PPC_REG_VAL(23, 0x4)
|
||||||
|
#define SDRAM_MBCF_AM_MODE5 PPC_REG_VAL(23, 0x5)
|
||||||
|
#define SDRAM_MBCF_AM_MODE6 PPC_REG_VAL(23, 0x6)
|
||||||
|
#define SDRAM_MBCF_AM_MODE7 PPC_REG_VAL(23, 0x7)
|
||||||
|
#define SDRAM_MBCF_AM_MODE8 PPC_REG_VAL(23, 0x8)
|
||||||
|
#define SDRAM_MBCF_AM_MODE9 PPC_REG_VAL(23, 0x9)
|
||||||
|
#define SDRAM_MBCF_BE_MASK PPC_REG_VAL(31, 0x1)
|
||||||
|
#define SDRAM_MBCF_BE_DISABLE PPC_REG_VAL(31, 0x0)
|
||||||
|
#define SDRAM_MBCF_BE_ENABLE PPC_REG_VAL(31, 0x1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ECC Error Status
|
||||||
|
*/
|
||||||
|
#define SDRAM_ECCES_MASK PPC_REG_VAL(21, 0x3FFFFF)
|
||||||
|
#define SDRAM_ECCES_BNCE_MASK PPC_REG_VAL(15, 0xFFFF)
|
||||||
|
#define SDRAM_ECCES_BNCE_ENCODE(lane) PPC_REG_VAL(((lane) & 0xF), 1)
|
||||||
|
#define SDRAM_ECCES_CKBER_MASK PPC_REG_VAL(17, 0x3)
|
||||||
|
#define SDRAM_ECCES_CKBER_NONE PPC_REG_VAL(17, 0)
|
||||||
|
#define SDRAM_ECCES_CKBER_16_ECC_0_3 PPC_REG_VAL(17, 2)
|
||||||
|
#define SDRAM_ECCES_CKBER_32_ECC_0_3 PPC_REG_VAL(17, 1)
|
||||||
|
#define SDRAM_ECCES_CKBER_32_ECC_4_8 PPC_REG_VAL(17, 2)
|
||||||
|
#define SDRAM_ECCES_CKBER_32_ECC_0_8 PPC_REG_VAL(17, 3)
|
||||||
|
#define SDRAM_ECCES_CE PPC_REG_VAL(18, 1)
|
||||||
|
#define SDRAM_ECCES_UE PPC_REG_VAL(19, 1)
|
||||||
|
#define SDRAM_ECCES_BKNER_MASK PPC_REG_VAL(21, 0x3)
|
||||||
|
#define SDRAM_ECCES_BK0ER PPC_REG_VAL(20, 1)
|
||||||
|
#define SDRAM_ECCES_BK1ER PPC_REG_VAL(21, 1)
|
||||||
|
|
||||||
|
#endif /* __PPC4XX_EDAC_H */
|
@ -69,20 +69,24 @@ static inline void desc_set_label(struct gpio_desc *d, const char *label)
|
|||||||
* those calls have no teeth) we can't avoid autorequesting. This nag
|
* those calls have no teeth) we can't avoid autorequesting. This nag
|
||||||
* message should motivate switching to explicit requests... so should
|
* message should motivate switching to explicit requests... so should
|
||||||
* the weaker cleanup after faults, compared to gpio_request().
|
* the weaker cleanup after faults, compared to gpio_request().
|
||||||
|
*
|
||||||
|
* NOTE: the autorequest mechanism is going away; at this point it's
|
||||||
|
* only "legal" in the sense that (old) code using it won't break yet,
|
||||||
|
* but instead only triggers a WARN() stack dump.
|
||||||
*/
|
*/
|
||||||
static int gpio_ensure_requested(struct gpio_desc *desc, unsigned offset)
|
static int gpio_ensure_requested(struct gpio_desc *desc, unsigned offset)
|
||||||
{
|
{
|
||||||
if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) {
|
const struct gpio_chip *chip = desc->chip;
|
||||||
struct gpio_chip *chip = desc->chip;
|
const int gpio = chip->base + offset;
|
||||||
int gpio = chip->base + offset;
|
|
||||||
|
|
||||||
|
if (WARN(test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0,
|
||||||
|
"autorequest GPIO-%d\n", gpio)) {
|
||||||
if (!try_module_get(chip->owner)) {
|
if (!try_module_get(chip->owner)) {
|
||||||
pr_err("GPIO-%d: module can't be gotten \n", gpio);
|
pr_err("GPIO-%d: module can't be gotten \n", gpio);
|
||||||
clear_bit(FLAG_REQUESTED, &desc->flags);
|
clear_bit(FLAG_REQUESTED, &desc->flags);
|
||||||
/* lose */
|
/* lose */
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
pr_warning("GPIO-%d autorequested\n", gpio);
|
|
||||||
desc_set_label(desc, "[auto]");
|
desc_set_label(desc, "[auto]");
|
||||||
/* caller must chip->request() w/o spinlock */
|
/* caller must chip->request() w/o spinlock */
|
||||||
if (chip->request)
|
if (chip->request)
|
||||||
@ -438,6 +442,7 @@ int gpio_export(unsigned gpio, bool direction_may_change)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct gpio_desc *desc;
|
struct gpio_desc *desc;
|
||||||
int status = -EINVAL;
|
int status = -EINVAL;
|
||||||
|
char *ioname = NULL;
|
||||||
|
|
||||||
/* can't export until sysfs is available ... */
|
/* can't export until sysfs is available ... */
|
||||||
if (!gpio_class.p) {
|
if (!gpio_class.p) {
|
||||||
@ -461,11 +466,14 @@ int gpio_export(unsigned gpio, bool direction_may_change)
|
|||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&gpio_lock, flags);
|
spin_unlock_irqrestore(&gpio_lock, flags);
|
||||||
|
|
||||||
|
if (desc->chip->names && desc->chip->names[gpio - desc->chip->base])
|
||||||
|
ioname = desc->chip->names[gpio - desc->chip->base];
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
|
||||||
dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0),
|
dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0),
|
||||||
desc, "gpio%d", gpio);
|
desc, ioname ? ioname : "gpio%d", gpio);
|
||||||
if (dev) {
|
if (dev) {
|
||||||
if (direction_may_change)
|
if (direction_may_change)
|
||||||
status = sysfs_create_group(&dev->kobj,
|
status = sysfs_create_group(&dev->kobj,
|
||||||
@ -513,6 +521,7 @@ void gpio_unexport(unsigned gpio)
|
|||||||
mutex_lock(&sysfs_lock);
|
mutex_lock(&sysfs_lock);
|
||||||
|
|
||||||
desc = &gpio_desc[gpio];
|
desc = &gpio_desc[gpio];
|
||||||
|
|
||||||
if (test_bit(FLAG_EXPORT, &desc->flags)) {
|
if (test_bit(FLAG_EXPORT, &desc->flags)) {
|
||||||
struct device *dev = NULL;
|
struct device *dev = NULL;
|
||||||
|
|
||||||
|
@ -42,6 +42,26 @@ static struct drm_display_mode std_modes[] = {
|
|||||||
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
|
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void drm_mode_validate_flag(struct drm_connector *connector,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
struct drm_display_mode *mode, *t;
|
||||||
|
|
||||||
|
if (flags == (DRM_MODE_FLAG_DBLSCAN | DRM_MODE_FLAG_INTERLACE))
|
||||||
|
return;
|
||||||
|
|
||||||
|
list_for_each_entry_safe(mode, t, &connector->modes, head) {
|
||||||
|
if ((mode->flags & DRM_MODE_FLAG_INTERLACE) &&
|
||||||
|
!(flags & DRM_MODE_FLAG_INTERLACE))
|
||||||
|
mode->status = MODE_NO_INTERLACE;
|
||||||
|
if ((mode->flags & DRM_MODE_FLAG_DBLSCAN) &&
|
||||||
|
!(flags & DRM_MODE_FLAG_DBLSCAN))
|
||||||
|
mode->status = MODE_NO_DBLESCAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_helper_probe_connector_modes - get complete set of display modes
|
* drm_helper_probe_connector_modes - get complete set of display modes
|
||||||
* @dev: DRM device
|
* @dev: DRM device
|
||||||
@ -72,6 +92,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
|
|||||||
struct drm_connector_helper_funcs *connector_funcs =
|
struct drm_connector_helper_funcs *connector_funcs =
|
||||||
connector->helper_private;
|
connector->helper_private;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
int mode_flags = 0;
|
||||||
|
|
||||||
DRM_DEBUG("%s\n", drm_get_connector_name(connector));
|
DRM_DEBUG("%s\n", drm_get_connector_name(connector));
|
||||||
/* set all modes to the unverified state */
|
/* set all modes to the unverified state */
|
||||||
@ -96,6 +117,13 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
|
|||||||
if (maxX && maxY)
|
if (maxX && maxY)
|
||||||
drm_mode_validate_size(dev, &connector->modes, maxX,
|
drm_mode_validate_size(dev, &connector->modes, maxX,
|
||||||
maxY, 0);
|
maxY, 0);
|
||||||
|
|
||||||
|
if (connector->interlace_allowed)
|
||||||
|
mode_flags |= DRM_MODE_FLAG_INTERLACE;
|
||||||
|
if (connector->doublescan_allowed)
|
||||||
|
mode_flags |= DRM_MODE_FLAG_DBLSCAN;
|
||||||
|
drm_mode_validate_flag(connector, mode_flags);
|
||||||
|
|
||||||
list_for_each_entry_safe(mode, t, &connector->modes, head) {
|
list_for_each_entry_safe(mode, t, &connector->modes, head) {
|
||||||
if (mode->status == MODE_OK)
|
if (mode->status == MODE_OK)
|
||||||
mode->status = connector_funcs->mode_valid(connector,
|
mode->status = connector_funcs->mode_valid(connector,
|
||||||
@ -885,7 +913,6 @@ bool drm_helper_plugged_event(struct drm_device *dev)
|
|||||||
/**
|
/**
|
||||||
* drm_initial_config - setup a sane initial connector configuration
|
* drm_initial_config - setup a sane initial connector configuration
|
||||||
* @dev: DRM device
|
* @dev: DRM device
|
||||||
* @can_grow: this configuration is growable
|
|
||||||
*
|
*
|
||||||
* LOCKING:
|
* LOCKING:
|
||||||
* Called at init time, must take mode config lock.
|
* Called at init time, must take mode config lock.
|
||||||
@ -897,7 +924,7 @@ bool drm_helper_plugged_event(struct drm_device *dev)
|
|||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero if everything went ok, nonzero otherwise.
|
* Zero if everything went ok, nonzero otherwise.
|
||||||
*/
|
*/
|
||||||
bool drm_helper_initial_config(struct drm_device *dev, bool can_grow)
|
bool drm_helper_initial_config(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_connector *connector;
|
struct drm_connector *connector;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -125,10 +125,8 @@ static bool edid_is_valid(struct edid *edid)
|
|||||||
DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
|
DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
if (edid->revision > 3) {
|
if (edid->revision > 4)
|
||||||
DRM_ERROR("EDID has minor version %d, which is not between 0-3\n", edid->revision);
|
DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
|
||||||
goto bad;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < EDID_LENGTH; i++)
|
for (i = 0; i < EDID_LENGTH; i++)
|
||||||
csum += raw_edid[i];
|
csum += raw_edid[i];
|
||||||
@ -162,7 +160,7 @@ static bool edid_vendor(struct edid *edid, char *vendor)
|
|||||||
edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
|
edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
|
||||||
edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
|
edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
|
||||||
((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
|
((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
|
||||||
edid_vendor[2] = (edid->mfg_id[2] & 0x1f) + '@';
|
edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@';
|
||||||
|
|
||||||
return !strncmp(edid_vendor, vendor, 3);
|
return !strncmp(edid_vendor, vendor, 3);
|
||||||
}
|
}
|
||||||
|
@ -505,7 +505,6 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
|
|||||||
struct drm_local_map *map = NULL;
|
struct drm_local_map *map = NULL;
|
||||||
struct drm_gem_object *obj;
|
struct drm_gem_object *obj;
|
||||||
struct drm_hash_item *hash;
|
struct drm_hash_item *hash;
|
||||||
unsigned long prot;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
mutex_lock(&dev->struct_mutex);
|
mutex_lock(&dev->struct_mutex);
|
||||||
@ -538,11 +537,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
|
|||||||
vma->vm_ops = obj->dev->driver->gem_vm_ops;
|
vma->vm_ops = obj->dev->driver->gem_vm_ops;
|
||||||
vma->vm_private_data = map->handle;
|
vma->vm_private_data = map->handle;
|
||||||
/* FIXME: use pgprot_writecombine when available */
|
/* FIXME: use pgprot_writecombine when available */
|
||||||
prot = pgprot_val(vma->vm_page_prot);
|
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||||
#ifdef CONFIG_X86
|
|
||||||
prot |= _PAGE_CACHE_WC;
|
|
||||||
#endif
|
|
||||||
vma->vm_page_prot = __pgprot(prot);
|
|
||||||
|
|
||||||
/* Take a ref for this mapping of the object, so that the fault
|
/* Take a ref for this mapping of the object, so that the fault
|
||||||
* handler can dereference the mmap offset's pointer to the object.
|
* handler can dereference the mmap offset's pointer to the object.
|
||||||
|
@ -451,6 +451,7 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
|
|||||||
|
|
||||||
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
|
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(drm_sysfs_hotplug_event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_sysfs_device_add - adds a class device to sysfs for a character driver
|
* drm_sysfs_device_add - adds a class device to sysfs for a character driver
|
||||||
|
@ -922,7 +922,7 @@ static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size,
|
|||||||
* Some of the preallocated space is taken by the GTT
|
* Some of the preallocated space is taken by the GTT
|
||||||
* and popup. GTT is 1K per MB of aperture size, and popup is 4K.
|
* and popup. GTT is 1K per MB of aperture size, and popup is 4K.
|
||||||
*/
|
*/
|
||||||
if (IS_G4X(dev))
|
if (IS_G4X(dev) || IS_IGD(dev))
|
||||||
overhead = 4096;
|
overhead = 4096;
|
||||||
else
|
else
|
||||||
overhead = (*aperture_size / 1024) + 4096;
|
overhead = (*aperture_size / 1024) + 4096;
|
||||||
@ -1030,13 +1030,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto destroy_ringbuffer;
|
goto destroy_ringbuffer;
|
||||||
|
|
||||||
/* FIXME: re-add hotplug support */
|
|
||||||
#if 0
|
|
||||||
ret = drm_hotplug_init(dev);
|
|
||||||
if (ret)
|
|
||||||
goto destroy_ringbuffer;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Always safe in the mode setting case. */
|
/* Always safe in the mode setting case. */
|
||||||
/* FIXME: do pre/post-mode set stuff in core KMS code */
|
/* FIXME: do pre/post-mode set stuff in core KMS code */
|
||||||
dev->vblank_disable_allowed = 1;
|
dev->vblank_disable_allowed = 1;
|
||||||
@ -1049,7 +1042,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
|
|||||||
|
|
||||||
intel_modeset_init(dev);
|
intel_modeset_init(dev);
|
||||||
|
|
||||||
drm_helper_initial_config(dev, false);
|
drm_helper_initial_config(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user