Char / Misc patches for 3.20-rc1
Here's the big char/misc driver update for 3.20-rc1. Lots of little things in here, all described in the changelog. Nothing major or unusual, except maybe the binder selinux stuff, which was all acked by the proper selinux people and they thought it best to come through this tree. All of this has been in linux-next with no reported issues for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlTgs80ACgkQMUfUDdst+yn86gCeMLbxANGExVLd+PR46GNsAUQb SJ4AmgIqrkIz+5LCwZWM02ldbYhPeBVf =lfmM -----END PGP SIGNATURE----- Merge tag 'char-misc-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc patches from Greg KH: "Here's the big char/misc driver update for 3.20-rc1. Lots of little things in here, all described in the changelog. Nothing major or unusual, except maybe the binder selinux stuff, which was all acked by the proper selinux people and they thought it best to come through this tree. All of this has been in linux-next with no reported issues for a while" * tag 'char-misc-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (90 commits) coresight: fix function etm_writel_cp14() parameter order coresight-etm: remove check for unknown Kconfig macro coresight: fixing CPU hwid lookup in device tree coresight: remove the unnecessary function coresight_is_bit_set() coresight: fix the debug AMBA bus name coresight: remove the extra spaces coresight: fix the link between orphan connection and newly added device coresight: remove the unnecessary replicator property coresight: fix the replicator subtype value pdfdocs: Fix 'make pdfdocs' failure for 'uio-howto.tmpl' mcb: Fix error path of mcb_pci_probe virtio/console: verify device has config space ti-st: clean up data types (fix harmless memory corruption) mei: me: release hw from reset only during the reset flow mei: mask interrupt set bit on clean reset bit extcon: max77693: Constify struct regmap_config extcon: adc-jack: Release IIO channel on driver remove extcon: Remove duplicated include from extcon-class.c Drivers: hv: vmbus: hv_process_timer_expiration() can be static Drivers: hv: vmbus: serialize Offer and Rescind offer ...
This commit is contained in:
commit
4ba63072b9
80 changed files with 2127 additions and 527 deletions
|
|
@ -719,7 +719,7 @@ framework to set up sysfs files for this region. Simply leave it alone.
|
|||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="using uio_dmem_genirq">
|
||||
<sect1 id="using-uio_dmem_genirq">
|
||||
<title>Using uio_dmem_genirq for platform devices</title>
|
||||
<para>
|
||||
In addition to statically allocated memory ranges, they may also be
|
||||
|
|
@ -746,16 +746,16 @@ framework to set up sysfs files for this region. Simply leave it alone.
|
|||
following elements:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><varname>struct uio_info uioinfo</varname>: The same
|
||||
<listitem><para><varname>struct uio_info uioinfo</varname>: The same
|
||||
structure used as the <varname>uio_pdrv_genirq</varname> platform
|
||||
data</listitem>
|
||||
<listitem><varname>unsigned int *dynamic_region_sizes</varname>:
|
||||
data</para></listitem>
|
||||
<listitem><para><varname>unsigned int *dynamic_region_sizes</varname>:
|
||||
Pointer to list of sizes of dynamic memory regions to be mapped into
|
||||
user space.
|
||||
</listitem>
|
||||
<listitem><varname>unsigned int num_dynamic_regions</varname>:
|
||||
</para></listitem>
|
||||
<listitem><para><varname>unsigned int num_dynamic_regions</varname>:
|
||||
Number of elements in <varname>dynamic_region_sizes</varname> array.
|
||||
</listitem>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
The dynamic regions defined in the platform data will be appended to
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ its hardware characteristcs.
|
|||
AMBA markee):
|
||||
- "arm,coresight-replicator"
|
||||
|
||||
* id: a unique number that will identify this replicator.
|
||||
|
||||
* port or ports: same as above.
|
||||
|
||||
* Optional properties for ETM/PTMs:
|
||||
|
|
@ -94,8 +92,6 @@ Example:
|
|||
* AMBA bus. As such no need to add "arm,primecell".
|
||||
*/
|
||||
compatible = "arm,coresight-replicator";
|
||||
/* this will show up in debugfs as "0.replicator" */
|
||||
id = <0>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
|
|
|
|||
|
|
@ -16,20 +16,28 @@ Example:
|
|||
"fsl,pq2-localbus";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
reg = <f0010100 40>;
|
||||
reg = <0xf0010100 0x40>;
|
||||
|
||||
ranges = <0 0 fe000000 02000000
|
||||
1 0 f4500000 00008000>;
|
||||
ranges = <0x0 0x0 0xfe000000 0x02000000
|
||||
0x1 0x0 0xf4500000 0x00008000
|
||||
0x2 0x0 0xfd810000 0x00010000>;
|
||||
|
||||
flash@0,0 {
|
||||
compatible = "jedec-flash";
|
||||
reg = <0 0 2000000>;
|
||||
reg = <0x0 0x0 0x2000000>;
|
||||
bank-width = <4>;
|
||||
device-width = <1>;
|
||||
};
|
||||
|
||||
board-control@1,0 {
|
||||
reg = <1 0 20>;
|
||||
reg = <0x1 0x0 0x20>;
|
||||
compatible = "fsl,mpc8272ads-bcsr";
|
||||
};
|
||||
|
||||
simple-periph@2,0 {
|
||||
compatible = "fsl,elbc-gpcm-uio";
|
||||
reg = <0x2 0x0 0x10000>;
|
||||
elbc-gpcm-br = <0xfd810800>;
|
||||
elbc-gpcm-or = <0xffff09f7>;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,18 +32,42 @@ Procedure for submitting patches to the -stable tree:
|
|||
- If the patch covers files in net/ or drivers/net please follow netdev stable
|
||||
submission guidelines as described in
|
||||
Documentation/networking/netdev-FAQ.txt
|
||||
- Send the patch, after verifying that it follows the above rules, to
|
||||
stable@vger.kernel.org. You must note the upstream commit ID in the
|
||||
changelog of your submission, as well as the kernel version you wish
|
||||
it to be applied to.
|
||||
- To have the patch automatically included in the stable tree, add the tag
|
||||
- Security patches should not be handled (solely) by the -stable review
|
||||
process but should follow the procedures in Documentation/SecurityBugs.
|
||||
|
||||
For all other submissions, choose one of the following procedures:
|
||||
|
||||
--- Option 1 ---
|
||||
|
||||
To have the patch automatically included in the stable tree, add the tag
|
||||
Cc: stable@vger.kernel.org
|
||||
in the sign-off area. Once the patch is merged it will be applied to
|
||||
the stable tree without anything else needing to be done by the author
|
||||
or subsystem maintainer.
|
||||
- If the patch requires other patches as prerequisites which can be
|
||||
cherry-picked, then this can be specified in the following format in
|
||||
the sign-off area:
|
||||
|
||||
--- Option 2 ---
|
||||
|
||||
After the patch has been merged to Linus' tree, send an email to
|
||||
stable@vger.kernel.org containing the subject of the patch, the commit ID,
|
||||
why you think it should be applied, and what kernel version you wish it to
|
||||
be applied to.
|
||||
|
||||
--- Option 3 ---
|
||||
|
||||
Send the patch, after verifying that it follows the above rules, to
|
||||
stable@vger.kernel.org. You must note the upstream commit ID in the
|
||||
changelog of your submission, as well as the kernel version you wish
|
||||
it to be applied to.
|
||||
|
||||
Option 1 is probably the easiest and most common. Options 2 and 3 are more
|
||||
useful if the patch isn't deemed worthy at the time it is applied to a public
|
||||
git tree (for instance, because it deserves more regression testing first).
|
||||
Option 3 is especially useful if the patch needs some special handling to apply
|
||||
to an older kernel (e.g., if API's have changed in the meantime).
|
||||
|
||||
Additionally, some patches submitted via Option 1 may have additional patch
|
||||
prerequisites which can be cherry-picked. This can be specified in the following
|
||||
format in the sign-off area:
|
||||
|
||||
Cc: <stable@vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle
|
||||
Cc: <stable@vger.kernel.org> # 3.3.x: 1b9508f: sched: Rate-limit newidle
|
||||
|
|
@ -57,13 +81,13 @@ Procedure for submitting patches to the -stable tree:
|
|||
git cherry-pick fd21073
|
||||
git cherry-pick <this commit>
|
||||
|
||||
Following the submission:
|
||||
|
||||
- The sender will receive an ACK when the patch has been accepted into the
|
||||
queue, or a NAK if the patch is rejected. This response might take a few
|
||||
days, according to the developer's schedules.
|
||||
- If accepted, the patch will be added to the -stable queue, for review by
|
||||
other developers and by the relevant subsystem maintainer.
|
||||
- Security patches should not be sent to this alias, but instead to the
|
||||
documented security@kernel.org address.
|
||||
|
||||
|
||||
Review cycle:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ At typical coresight system would look like this:
|
|||
| | . | ! | | . | ! | ! . | | SWD/
|
||||
| | . | ! | | . | ! | ! . | | JTAG
|
||||
*****************************************************************<-|
|
||||
*************************** AMBA Debug ABP ************************
|
||||
*************************** AMBA Debug APB ************************
|
||||
*****************************************************************
|
||||
| . ! . ! ! . |
|
||||
| . * . * * . |
|
||||
|
|
@ -79,7 +79,7 @@ At typical coresight system would look like this:
|
|||
To trace port TPIU= Trace Port Interface Unit
|
||||
SWD = Serial Wire Debug
|
||||
|
||||
While on target configuration of the components is done via the ABP bus,
|
||||
While on target configuration of the components is done via the APB bus,
|
||||
all trace data are carried out-of-band on the ATB bus. The CTM provides
|
||||
a way to aggregate and distribute signals between CoreSight components.
|
||||
|
||||
|
|
|
|||
|
|
@ -3033,6 +3033,7 @@ F: drivers/platform/x86/dell-laptop.c
|
|||
|
||||
DELL LAPTOP SMM DRIVER
|
||||
M: Guenter Roeck <linux@roeck-us.net>
|
||||
S: Maintained
|
||||
F: drivers/char/i8k.c
|
||||
F: include/uapi/linux/i8k.h
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@ struct fsl_lbc_bank {
|
|||
#define OR_FCM_TRLX_SHIFT 2
|
||||
#define OR_FCM_EHTR 0x00000002
|
||||
#define OR_FCM_EHTR_SHIFT 1
|
||||
|
||||
#define OR_GPCM_AM 0xFFFF8000
|
||||
#define OR_GPCM_AM_SHIFT 15
|
||||
};
|
||||
|
||||
struct fsl_lbc_regs {
|
||||
|
|
|
|||
|
|
@ -187,6 +187,17 @@
|
|||
#define HV_X64_MSR_SINT14 0x4000009E
|
||||
#define HV_X64_MSR_SINT15 0x4000009F
|
||||
|
||||
/*
|
||||
* Synthetic Timer MSRs. Four timers per vcpu.
|
||||
*/
|
||||
#define HV_X64_MSR_STIMER0_CONFIG 0x400000B0
|
||||
#define HV_X64_MSR_STIMER0_COUNT 0x400000B1
|
||||
#define HV_X64_MSR_STIMER1_CONFIG 0x400000B2
|
||||
#define HV_X64_MSR_STIMER1_COUNT 0x400000B3
|
||||
#define HV_X64_MSR_STIMER2_CONFIG 0x400000B4
|
||||
#define HV_X64_MSR_STIMER2_COUNT 0x400000B5
|
||||
#define HV_X64_MSR_STIMER3_CONFIG 0x400000B6
|
||||
#define HV_X64_MSR_STIMER3_COUNT 0x400000B7
|
||||
|
||||
#define HV_X64_MSR_HYPERCALL_ENABLE 0x00000001
|
||||
#define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT 12
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include <linux/vmalloc.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/pid_namespace.h>
|
||||
#include <linux/security.h>
|
||||
|
||||
#ifdef CONFIG_ANDROID_BINDER_IPC_32BIT
|
||||
#define BINDER_IPC_32BIT 1
|
||||
|
|
@ -1400,6 +1401,11 @@ static void binder_transaction(struct binder_proc *proc,
|
|||
return_error = BR_DEAD_REPLY;
|
||||
goto err_dead_binder;
|
||||
}
|
||||
if (security_binder_transaction(proc->tsk,
|
||||
target_proc->tsk) < 0) {
|
||||
return_error = BR_FAILED_REPLY;
|
||||
goto err_invalid_target_handle;
|
||||
}
|
||||
if (!(tr->flags & TF_ONE_WAY) && thread->transaction_stack) {
|
||||
struct binder_transaction *tmp;
|
||||
|
||||
|
|
@ -1551,6 +1557,11 @@ static void binder_transaction(struct binder_proc *proc,
|
|||
return_error = BR_FAILED_REPLY;
|
||||
goto err_binder_get_ref_for_node_failed;
|
||||
}
|
||||
if (security_binder_transfer_binder(proc->tsk,
|
||||
target_proc->tsk)) {
|
||||
return_error = BR_FAILED_REPLY;
|
||||
goto err_binder_get_ref_for_node_failed;
|
||||
}
|
||||
ref = binder_get_ref_for_node(target_proc, node);
|
||||
if (ref == NULL) {
|
||||
return_error = BR_FAILED_REPLY;
|
||||
|
|
@ -1581,6 +1592,11 @@ static void binder_transaction(struct binder_proc *proc,
|
|||
return_error = BR_FAILED_REPLY;
|
||||
goto err_binder_get_ref_failed;
|
||||
}
|
||||
if (security_binder_transfer_binder(proc->tsk,
|
||||
target_proc->tsk)) {
|
||||
return_error = BR_FAILED_REPLY;
|
||||
goto err_binder_get_ref_failed;
|
||||
}
|
||||
if (ref->node->proc == target_proc) {
|
||||
if (fp->type == BINDER_TYPE_HANDLE)
|
||||
fp->type = BINDER_TYPE_BINDER;
|
||||
|
|
@ -1638,6 +1654,13 @@ static void binder_transaction(struct binder_proc *proc,
|
|||
return_error = BR_FAILED_REPLY;
|
||||
goto err_fget_failed;
|
||||
}
|
||||
if (security_binder_transfer_file(proc->tsk,
|
||||
target_proc->tsk,
|
||||
file) < 0) {
|
||||
fput(file);
|
||||
return_error = BR_FAILED_REPLY;
|
||||
goto err_get_unused_fd_failed;
|
||||
}
|
||||
target_fd = task_get_unused_fd_flags(target_proc, O_CLOEXEC);
|
||||
if (target_fd < 0) {
|
||||
fput(file);
|
||||
|
|
@ -2675,6 +2698,9 @@ static int binder_ioctl_set_ctx_mgr(struct file *filp)
|
|||
ret = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
ret = security_binder_set_context_mgr(proc->tsk);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (uid_valid(binder_context_mgr_uid)) {
|
||||
if (!uid_eq(binder_context_mgr_uid, curr_euid)) {
|
||||
pr_err("BINDER_SET_CONTEXT_MGR bad uid %d != %d\n",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ menu "Character devices"
|
|||
|
||||
source "drivers/tty/Kconfig"
|
||||
|
||||
config DEVMEM
|
||||
bool "/dev/mem virtual device support"
|
||||
default y
|
||||
help
|
||||
Say Y here if you want to support the /dev/mem device.
|
||||
The /dev/mem device is used to access areas of physical
|
||||
memory.
|
||||
When in doubt, say "Y".
|
||||
|
||||
config DEVKMEM
|
||||
bool "/dev/kmem virtual device support"
|
||||
default y
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
*
|
||||
* Hwmon integration:
|
||||
* Copyright (C) 2011 Jean Delvare <jdelvare@suse.de>
|
||||
* Copyright (C) 2013 Guenter Roeck <linux@roeck-us.net>
|
||||
* Copyright (C) 2013, 2014 Guenter Roeck <linux@roeck-us.net>
|
||||
* Copyright (C) 2014 Pali Rohár <pali.rohar@gmail.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -20,6 +21,7 @@
|
|||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -41,11 +43,15 @@
|
|||
#define I8K_SMM_SET_FAN 0x01a3
|
||||
#define I8K_SMM_GET_FAN 0x00a3
|
||||
#define I8K_SMM_GET_SPEED 0x02a3
|
||||
#define I8K_SMM_GET_FAN_TYPE 0x03a3
|
||||
#define I8K_SMM_GET_NOM_SPEED 0x04a3
|
||||
#define I8K_SMM_GET_TEMP 0x10a3
|
||||
#define I8K_SMM_GET_TEMP_TYPE 0x11a3
|
||||
#define I8K_SMM_GET_DELL_SIG1 0xfea3
|
||||
#define I8K_SMM_GET_DELL_SIG2 0xffa3
|
||||
|
||||
#define I8K_FAN_MULT 30
|
||||
#define I8K_FAN_MAX_RPM 30000
|
||||
#define I8K_MAX_TEMP 127
|
||||
|
||||
#define I8K_FN_NONE 0x00
|
||||
|
|
@ -58,15 +64,13 @@
|
|||
#define I8K_POWER_AC 0x05
|
||||
#define I8K_POWER_BATTERY 0x01
|
||||
|
||||
#define I8K_TEMPERATURE_BUG 1
|
||||
|
||||
static DEFINE_MUTEX(i8k_mutex);
|
||||
static char bios_version[4];
|
||||
static struct device *i8k_hwmon_dev;
|
||||
static u32 i8k_hwmon_flags;
|
||||
static int i8k_fan_mult;
|
||||
static int i8k_pwm_mult;
|
||||
static int i8k_fan_max = I8K_FAN_HIGH;
|
||||
static uint i8k_fan_mult = I8K_FAN_MULT;
|
||||
static uint i8k_pwm_mult;
|
||||
static uint i8k_fan_max = I8K_FAN_HIGH;
|
||||
|
||||
#define I8K_HWMON_HAVE_TEMP1 (1 << 0)
|
||||
#define I8K_HWMON_HAVE_TEMP2 (1 << 1)
|
||||
|
|
@ -95,13 +99,13 @@ static bool power_status;
|
|||
module_param(power_status, bool, 0600);
|
||||
MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
|
||||
|
||||
static int fan_mult = I8K_FAN_MULT;
|
||||
module_param(fan_mult, int, 0);
|
||||
MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with");
|
||||
static uint fan_mult;
|
||||
module_param(fan_mult, uint, 0);
|
||||
MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with (default: autodetect)");
|
||||
|
||||
static int fan_max = I8K_FAN_HIGH;
|
||||
module_param(fan_max, int, 0);
|
||||
MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed");
|
||||
static uint fan_max;
|
||||
module_param(fan_max, uint, 0);
|
||||
MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed (default: autodetect)");
|
||||
|
||||
static int i8k_open_fs(struct inode *inode, struct file *file);
|
||||
static long i8k_ioctl(struct file *, unsigned int, unsigned long);
|
||||
|
|
@ -275,6 +279,28 @@ static int i8k_get_fan_speed(int fan)
|
|||
return i8k_smm(®s) ? : (regs.eax & 0xffff) * i8k_fan_mult;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the fan type.
|
||||
*/
|
||||
static int i8k_get_fan_type(int fan)
|
||||
{
|
||||
struct smm_regs regs = { .eax = I8K_SMM_GET_FAN_TYPE, };
|
||||
|
||||
regs.ebx = fan & 0xff;
|
||||
return i8k_smm(®s) ? : regs.eax & 0xff;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the fan nominal rpm for specific fan speed.
|
||||
*/
|
||||
static int i8k_get_fan_nominal_speed(int fan, int speed)
|
||||
{
|
||||
struct smm_regs regs = { .eax = I8K_SMM_GET_NOM_SPEED, };
|
||||
|
||||
regs.ebx = (fan & 0xff) | (speed << 8);
|
||||
return i8k_smm(®s) ? : (regs.eax & 0xffff) * i8k_fan_mult;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the fan speed (off, low, high). Returns the new fan status.
|
||||
*/
|
||||
|
|
@ -288,42 +314,52 @@ static int i8k_set_fan(int fan, int speed)
|
|||
return i8k_smm(®s) ? : i8k_get_fan_status(fan);
|
||||
}
|
||||
|
||||
static int i8k_get_temp_type(int sensor)
|
||||
{
|
||||
struct smm_regs regs = { .eax = I8K_SMM_GET_TEMP_TYPE, };
|
||||
|
||||
regs.ebx = sensor & 0xff;
|
||||
return i8k_smm(®s) ? : regs.eax & 0xff;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the cpu temperature.
|
||||
*/
|
||||
static int _i8k_get_temp(int sensor)
|
||||
{
|
||||
struct smm_regs regs = {
|
||||
.eax = I8K_SMM_GET_TEMP,
|
||||
.ebx = sensor & 0xff,
|
||||
};
|
||||
|
||||
return i8k_smm(®s) ? : regs.eax & 0xff;
|
||||
}
|
||||
|
||||
static int i8k_get_temp(int sensor)
|
||||
{
|
||||
struct smm_regs regs = { .eax = I8K_SMM_GET_TEMP, };
|
||||
int rc;
|
||||
int temp;
|
||||
int temp = _i8k_get_temp(sensor);
|
||||
|
||||
#ifdef I8K_TEMPERATURE_BUG
|
||||
static int prev[4] = { I8K_MAX_TEMP+1, I8K_MAX_TEMP+1, I8K_MAX_TEMP+1, I8K_MAX_TEMP+1 };
|
||||
#endif
|
||||
regs.ebx = sensor & 0xff;
|
||||
rc = i8k_smm(®s);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
temp = regs.eax & 0xff;
|
||||
|
||||
#ifdef I8K_TEMPERATURE_BUG
|
||||
/*
|
||||
* Sometimes the temperature sensor returns 0x99, which is out of range.
|
||||
* In this case we return (once) the previous cached value. For example:
|
||||
* In this case we retry (once) before returning an error.
|
||||
# 1003655137 00000058 00005a4b
|
||||
# 1003655138 00000099 00003a80 <--- 0x99 = 153 degrees
|
||||
# 1003655139 00000054 00005c52
|
||||
*/
|
||||
if (temp > I8K_MAX_TEMP) {
|
||||
temp = prev[sensor];
|
||||
prev[sensor] = I8K_MAX_TEMP+1;
|
||||
} else {
|
||||
prev[sensor] = temp;
|
||||
if (temp == 0x99) {
|
||||
msleep(100);
|
||||
temp = _i8k_get_temp(sensor);
|
||||
}
|
||||
/*
|
||||
* Return -ENODATA for all invalid temperatures.
|
||||
*
|
||||
* Known instances are the 0x99 value as seen above as well as
|
||||
* 0xc1 (193), which may be returned when trying to read the GPU
|
||||
* temperature if the system supports a GPU and it is currently
|
||||
* turned off.
|
||||
*/
|
||||
if (temp > I8K_MAX_TEMP)
|
||||
return -ERANGE;
|
||||
#endif
|
||||
return -ENODATA;
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
|
@ -493,6 +529,29 @@ static int i8k_open_fs(struct inode *inode, struct file *file)
|
|||
* Hwmon interface
|
||||
*/
|
||||
|
||||
static ssize_t i8k_hwmon_show_temp_label(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
static const char * const labels[] = {
|
||||
"CPU",
|
||||
"GPU",
|
||||
"SODIMM",
|
||||
"Other",
|
||||
"Ambient",
|
||||
"Other",
|
||||
};
|
||||
int index = to_sensor_dev_attr(devattr)->index;
|
||||
int type;
|
||||
|
||||
type = i8k_get_temp_type(index);
|
||||
if (type < 0)
|
||||
return type;
|
||||
if (type >= ARRAY_SIZE(labels))
|
||||
type = ARRAY_SIZE(labels) - 1;
|
||||
return sprintf(buf, "%s\n", labels[type]);
|
||||
}
|
||||
|
||||
static ssize_t i8k_hwmon_show_temp(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
|
|
@ -501,13 +560,42 @@ static ssize_t i8k_hwmon_show_temp(struct device *dev,
|
|||
int temp;
|
||||
|
||||
temp = i8k_get_temp(index);
|
||||
if (temp == -ERANGE)
|
||||
return -EINVAL;
|
||||
if (temp < 0)
|
||||
return temp;
|
||||
return sprintf(buf, "%d\n", temp * 1000);
|
||||
}
|
||||
|
||||
static ssize_t i8k_hwmon_show_fan_label(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
static const char * const labels[] = {
|
||||
"Processor Fan",
|
||||
"Motherboard Fan",
|
||||
"Video Fan",
|
||||
"Power Supply Fan",
|
||||
"Chipset Fan",
|
||||
"Other Fan",
|
||||
};
|
||||
int index = to_sensor_dev_attr(devattr)->index;
|
||||
bool dock = false;
|
||||
int type;
|
||||
|
||||
type = i8k_get_fan_type(index);
|
||||
if (type < 0)
|
||||
return type;
|
||||
|
||||
if (type & 0x10) {
|
||||
dock = true;
|
||||
type &= 0x0F;
|
||||
}
|
||||
|
||||
if (type >= ARRAY_SIZE(labels))
|
||||
type = (ARRAY_SIZE(labels) - 1);
|
||||
|
||||
return sprintf(buf, "%s%s\n", (dock ? "Docking " : ""), labels[type]);
|
||||
}
|
||||
|
||||
static ssize_t i8k_hwmon_show_fan(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
|
|
@ -555,45 +643,66 @@ static ssize_t i8k_hwmon_set_pwm(struct device *dev,
|
|||
}
|
||||
|
||||
static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 0);
|
||||
static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, i8k_hwmon_show_temp_label, NULL,
|
||||
0);
|
||||
static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 1);
|
||||
static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, i8k_hwmon_show_temp_label, NULL,
|
||||
1);
|
||||
static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 2);
|
||||
static SENSOR_DEVICE_ATTR(temp3_label, S_IRUGO, i8k_hwmon_show_temp_label, NULL,
|
||||
2);
|
||||
static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 3);
|
||||
static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, i8k_hwmon_show_fan, NULL,
|
||||
I8K_FAN_LEFT);
|
||||
static SENSOR_DEVICE_ATTR(temp4_label, S_IRUGO, i8k_hwmon_show_temp_label, NULL,
|
||||
3);
|
||||
static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, i8k_hwmon_show_fan, NULL, 0);
|
||||
static SENSOR_DEVICE_ATTR(fan1_label, S_IRUGO, i8k_hwmon_show_fan_label, NULL,
|
||||
0);
|
||||
static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
|
||||
i8k_hwmon_set_pwm, I8K_FAN_LEFT);
|
||||
i8k_hwmon_set_pwm, 0);
|
||||
static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, i8k_hwmon_show_fan, NULL,
|
||||
I8K_FAN_RIGHT);
|
||||
1);
|
||||
static SENSOR_DEVICE_ATTR(fan2_label, S_IRUGO, i8k_hwmon_show_fan_label, NULL,
|
||||
1);
|
||||
static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
|
||||
i8k_hwmon_set_pwm, I8K_FAN_RIGHT);
|
||||
i8k_hwmon_set_pwm, 1);
|
||||
|
||||
static struct attribute *i8k_attrs[] = {
|
||||
&sensor_dev_attr_temp1_input.dev_attr.attr, /* 0 */
|
||||
&sensor_dev_attr_temp2_input.dev_attr.attr, /* 1 */
|
||||
&sensor_dev_attr_temp3_input.dev_attr.attr, /* 2 */
|
||||
&sensor_dev_attr_temp4_input.dev_attr.attr, /* 3 */
|
||||
&sensor_dev_attr_fan1_input.dev_attr.attr, /* 4 */
|
||||
&sensor_dev_attr_pwm1.dev_attr.attr, /* 5 */
|
||||
&sensor_dev_attr_fan2_input.dev_attr.attr, /* 6 */
|
||||
&sensor_dev_attr_pwm2.dev_attr.attr, /* 7 */
|
||||
&sensor_dev_attr_temp1_label.dev_attr.attr, /* 1 */
|
||||
&sensor_dev_attr_temp2_input.dev_attr.attr, /* 2 */
|
||||
&sensor_dev_attr_temp2_label.dev_attr.attr, /* 3 */
|
||||
&sensor_dev_attr_temp3_input.dev_attr.attr, /* 4 */
|
||||
&sensor_dev_attr_temp3_label.dev_attr.attr, /* 5 */
|
||||
&sensor_dev_attr_temp4_input.dev_attr.attr, /* 6 */
|
||||
&sensor_dev_attr_temp4_label.dev_attr.attr, /* 7 */
|
||||
&sensor_dev_attr_fan1_input.dev_attr.attr, /* 8 */
|
||||
&sensor_dev_attr_fan1_label.dev_attr.attr, /* 9 */
|
||||
&sensor_dev_attr_pwm1.dev_attr.attr, /* 10 */
|
||||
&sensor_dev_attr_fan2_input.dev_attr.attr, /* 11 */
|
||||
&sensor_dev_attr_fan2_label.dev_attr.attr, /* 12 */
|
||||
&sensor_dev_attr_pwm2.dev_attr.attr, /* 13 */
|
||||
NULL
|
||||
};
|
||||
|
||||
static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
|
||||
int index)
|
||||
{
|
||||
if (index == 0 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
|
||||
if (index >= 0 && index <= 1 &&
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
|
||||
return 0;
|
||||
if (index == 1 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP2))
|
||||
return 0;
|
||||
if (index == 2 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP3))
|
||||
return 0;
|
||||
if (index == 3 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP4))
|
||||
if (index >= 2 && index <= 3 &&
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP2))
|
||||
return 0;
|
||||
if (index >= 4 && index <= 5 &&
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN1))
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP3))
|
||||
return 0;
|
||||
if (index >= 6 && index <= 7 &&
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP4))
|
||||
return 0;
|
||||
if (index >= 8 && index <= 10 &&
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN1))
|
||||
return 0;
|
||||
if (index >= 11 && index <= 13 &&
|
||||
!(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN2))
|
||||
return 0;
|
||||
|
||||
|
|
@ -612,28 +721,28 @@ static int __init i8k_init_hwmon(void)
|
|||
|
||||
i8k_hwmon_flags = 0;
|
||||
|
||||
/* CPU temperature attributes, if temperature reading is OK */
|
||||
err = i8k_get_temp(0);
|
||||
if (err >= 0 || err == -ERANGE)
|
||||
/* CPU temperature attributes, if temperature type is OK */
|
||||
err = i8k_get_temp_type(0);
|
||||
if (err >= 0)
|
||||
i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP1;
|
||||
/* check for additional temperature sensors */
|
||||
err = i8k_get_temp(1);
|
||||
if (err >= 0 || err == -ERANGE)
|
||||
err = i8k_get_temp_type(1);
|
||||
if (err >= 0)
|
||||
i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP2;
|
||||
err = i8k_get_temp(2);
|
||||
if (err >= 0 || err == -ERANGE)
|
||||
err = i8k_get_temp_type(2);
|
||||
if (err >= 0)
|
||||
i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP3;
|
||||
err = i8k_get_temp(3);
|
||||
if (err >= 0 || err == -ERANGE)
|
||||
err = i8k_get_temp_type(3);
|
||||
if (err >= 0)
|
||||
i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP4;
|
||||
|
||||
/* Left fan attributes, if left fan is present */
|
||||
err = i8k_get_fan_status(I8K_FAN_LEFT);
|
||||
/* First fan attributes, if fan type is OK */
|
||||
err = i8k_get_fan_type(0);
|
||||
if (err >= 0)
|
||||
i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN1;
|
||||
|
||||
/* Right fan attributes, if right fan is present */
|
||||
err = i8k_get_fan_status(I8K_FAN_RIGHT);
|
||||
/* Second fan attributes, if fan type is OK */
|
||||
err = i8k_get_fan_type(1);
|
||||
if (err >= 0)
|
||||
i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN2;
|
||||
|
||||
|
|
@ -649,16 +758,15 @@ static int __init i8k_init_hwmon(void)
|
|||
}
|
||||
|
||||
struct i8k_config_data {
|
||||
int fan_mult;
|
||||
int fan_max;
|
||||
uint fan_mult;
|
||||
uint fan_max;
|
||||
};
|
||||
|
||||
enum i8k_configs {
|
||||
DELL_LATITUDE_D520,
|
||||
DELL_LATITUDE_E6540,
|
||||
DELL_PRECISION_490,
|
||||
DELL_STUDIO,
|
||||
DELL_XPS_M140,
|
||||
DELL_XPS,
|
||||
};
|
||||
|
||||
static const struct i8k_config_data i8k_config_data[] = {
|
||||
|
|
@ -666,10 +774,6 @@ static const struct i8k_config_data i8k_config_data[] = {
|
|||
.fan_mult = 1,
|
||||
.fan_max = I8K_FAN_TURBO,
|
||||
},
|
||||
[DELL_LATITUDE_E6540] = {
|
||||
.fan_mult = 1,
|
||||
.fan_max = I8K_FAN_HIGH,
|
||||
},
|
||||
[DELL_PRECISION_490] = {
|
||||
.fan_mult = 1,
|
||||
.fan_max = I8K_FAN_TURBO,
|
||||
|
|
@ -678,7 +782,7 @@ static const struct i8k_config_data i8k_config_data[] = {
|
|||
.fan_mult = 1,
|
||||
.fan_max = I8K_FAN_HIGH,
|
||||
},
|
||||
[DELL_XPS_M140] = {
|
||||
[DELL_XPS] = {
|
||||
.fan_mult = 1,
|
||||
.fan_max = I8K_FAN_HIGH,
|
||||
},
|
||||
|
|
@ -714,22 +818,6 @@ static struct dmi_system_id i8k_dmi_table[] __initdata = {
|
|||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_LATITUDE_D520],
|
||||
},
|
||||
{
|
||||
.ident = "Dell Latitude E6440",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6440"),
|
||||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_LATITUDE_E6540],
|
||||
},
|
||||
{
|
||||
.ident = "Dell Latitude E6540",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6540"),
|
||||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_LATITUDE_E6540],
|
||||
},
|
||||
{
|
||||
.ident = "Dell Latitude 2",
|
||||
.matches = {
|
||||
|
|
@ -789,13 +877,21 @@ static struct dmi_system_id i8k_dmi_table[] __initdata = {
|
|||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_STUDIO],
|
||||
},
|
||||
{
|
||||
.ident = "Dell XPS 13",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "XPS13"),
|
||||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_XPS],
|
||||
},
|
||||
{
|
||||
.ident = "Dell XPS M140",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "MXC051"),
|
||||
},
|
||||
.driver_data = (void *)&i8k_config_data[DELL_XPS_M140],
|
||||
.driver_data = (void *)&i8k_config_data[DELL_XPS],
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
|
@ -808,6 +904,7 @@ MODULE_DEVICE_TABLE(dmi, i8k_dmi_table);
|
|||
static int __init i8k_probe(void)
|
||||
{
|
||||
const struct dmi_system_id *id;
|
||||
int fan, ret;
|
||||
|
||||
/*
|
||||
* Get DMI information
|
||||
|
|
@ -836,19 +933,40 @@ static int __init i8k_probe(void)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
i8k_fan_mult = fan_mult;
|
||||
i8k_fan_max = fan_max ? : I8K_FAN_HIGH; /* Must not be 0 */
|
||||
/*
|
||||
* Set fan multiplier and maximal fan speed from dmi config
|
||||
* Values specified in module parameters override values from dmi
|
||||
*/
|
||||
id = dmi_first_match(i8k_dmi_table);
|
||||
if (id && id->driver_data) {
|
||||
const struct i8k_config_data *conf = id->driver_data;
|
||||
|
||||
if (fan_mult == I8K_FAN_MULT && conf->fan_mult)
|
||||
i8k_fan_mult = conf->fan_mult;
|
||||
if (fan_max == I8K_FAN_HIGH && conf->fan_max)
|
||||
i8k_fan_max = conf->fan_max;
|
||||
if (!fan_mult && conf->fan_mult)
|
||||
fan_mult = conf->fan_mult;
|
||||
if (!fan_max && conf->fan_max)
|
||||
fan_max = conf->fan_max;
|
||||
}
|
||||
|
||||
i8k_fan_max = fan_max ? : I8K_FAN_HIGH; /* Must not be 0 */
|
||||
i8k_pwm_mult = DIV_ROUND_UP(255, i8k_fan_max);
|
||||
|
||||
if (!fan_mult) {
|
||||
/*
|
||||
* Autodetect fan multiplier based on nominal rpm
|
||||
* If fan reports rpm value too high then set multiplier to 1
|
||||
*/
|
||||
for (fan = 0; fan < 2; ++fan) {
|
||||
ret = i8k_get_fan_nominal_speed(fan, i8k_fan_max);
|
||||
if (ret < 0)
|
||||
continue;
|
||||
if (ret > I8K_FAN_MAX_RPM)
|
||||
i8k_fan_mult = 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* Fan multiplier was specified in module param or in dmi */
|
||||
i8k_fan_mult = fan_mult;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/aio.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#ifdef CONFIG_IA64
|
||||
# include <linux/efi.h>
|
||||
|
|
@ -352,7 +352,6 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEVKMEM
|
||||
static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
|
||||
{
|
||||
unsigned long pfn;
|
||||
|
|
@ -373,9 +372,7 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
|
|||
vma->vm_pgoff = pfn;
|
||||
return mmap_mem(file, vma);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEVKMEM
|
||||
/*
|
||||
* This function reads the *virtual* memory as seen by the kernel.
|
||||
*/
|
||||
|
|
@ -555,9 +552,7 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
|
|||
*ppos = p;
|
||||
return virtr + wrote ? : err;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEVPORT
|
||||
static ssize_t read_port(struct file *file, char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
|
|
@ -586,6 +581,7 @@ static ssize_t write_port(struct file *file, const char __user *buf,
|
|||
return -EFAULT;
|
||||
while (count-- > 0 && i < 65536) {
|
||||
char c;
|
||||
|
||||
if (__get_user(c, tmp)) {
|
||||
if (tmp > buf)
|
||||
break;
|
||||
|
|
@ -598,7 +594,6 @@ static ssize_t write_port(struct file *file, const char __user *buf,
|
|||
*ppos = i;
|
||||
return tmp-buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
static ssize_t read_null(struct file *file, char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
|
|
@ -642,6 +637,7 @@ static ssize_t read_iter_zero(struct kiocb *iocb, struct iov_iter *iter)
|
|||
|
||||
while (iov_iter_count(iter)) {
|
||||
size_t chunk = iov_iter_count(iter), n;
|
||||
|
||||
if (chunk > PAGE_SIZE)
|
||||
chunk = PAGE_SIZE; /* Just for latency reasons */
|
||||
n = iov_iter_zero(chunk, iter);
|
||||
|
|
@ -726,7 +722,7 @@ static int open_port(struct inode *inode, struct file *filp)
|
|||
#define open_mem open_port
|
||||
#define open_kmem open_mem
|
||||
|
||||
static const struct file_operations mem_fops = {
|
||||
static const struct file_operations __maybe_unused mem_fops = {
|
||||
.llseek = memory_lseek,
|
||||
.read = read_mem,
|
||||
.write = write_mem,
|
||||
|
|
@ -738,8 +734,7 @@ static const struct file_operations mem_fops = {
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEVKMEM
|
||||
static const struct file_operations kmem_fops = {
|
||||
static const struct file_operations __maybe_unused kmem_fops = {
|
||||
.llseek = memory_lseek,
|
||||
.read = read_kmem,
|
||||
.write = write_kmem,
|
||||
|
|
@ -750,7 +745,6 @@ static const struct file_operations kmem_fops = {
|
|||
.mmap_capabilities = memory_mmap_capabilities,
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
static const struct file_operations null_fops = {
|
||||
.llseek = null_lseek,
|
||||
|
|
@ -761,14 +755,12 @@ static const struct file_operations null_fops = {
|
|||
.splice_write = splice_write_null,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEVPORT
|
||||
static const struct file_operations port_fops = {
|
||||
static const struct file_operations __maybe_unused port_fops = {
|
||||
.llseek = memory_lseek,
|
||||
.read = read_port,
|
||||
.write = write_port,
|
||||
.open = open_port,
|
||||
};
|
||||
#endif
|
||||
|
||||
static const struct file_operations zero_fops = {
|
||||
.llseek = zero_lseek,
|
||||
|
|
@ -795,7 +787,9 @@ static const struct memdev {
|
|||
const struct file_operations *fops;
|
||||
fmode_t fmode;
|
||||
} devlist[] = {
|
||||
#ifdef CONFIG_DEVMEM
|
||||
[1] = { "mem", 0, &mem_fops, FMODE_UNSIGNED_OFFSET },
|
||||
#endif
|
||||
#ifdef CONFIG_DEVKMEM
|
||||
[2] = { "kmem", 0, &kmem_fops, FMODE_UNSIGNED_OFFSET },
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1986,6 +1986,12 @@ static int virtcons_probe(struct virtio_device *vdev)
|
|||
bool multiport;
|
||||
bool early = early_put_chars != NULL;
|
||||
|
||||
if (!vdev->config->get) {
|
||||
dev_err(&vdev->dev, "%s failure: config access disabled\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Ensure to read early_put_chars now */
|
||||
barrier();
|
||||
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
drvdata->buffer_depth = etb_get_buffer_depth(drvdata);
|
||||
drvdata->buffer_depth = etb_get_buffer_depth(drvdata);
|
||||
clk_disable_unprepare(drvdata->clk);
|
||||
|
||||
if (drvdata->buffer_depth < 0)
|
||||
|
|
@ -521,17 +521,7 @@ static struct amba_driver etb_driver = {
|
|||
.id_table = etb_ids,
|
||||
};
|
||||
|
||||
static int __init etb_init(void)
|
||||
{
|
||||
return amba_driver_register(&etb_driver);
|
||||
}
|
||||
module_init(etb_init);
|
||||
|
||||
static void __exit etb_exit(void)
|
||||
{
|
||||
amba_driver_unregister(&etb_driver);
|
||||
}
|
||||
module_exit(etb_exit);
|
||||
module_amba_driver(etb_driver);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("CoreSight Embedded Trace Buffer driver");
|
||||
|
|
|
|||
|
|
@ -34,14 +34,8 @@
|
|||
|
||||
#include "coresight-etm.h"
|
||||
|
||||
#ifdef CONFIG_CORESIGHT_SOURCE_ETM_DEFAULT_ENABLE
|
||||
static int boot_enable = 1;
|
||||
#else
|
||||
static int boot_enable;
|
||||
#endif
|
||||
module_param_named(
|
||||
boot_enable, boot_enable, int, S_IRUGO
|
||||
);
|
||||
module_param_named(boot_enable, boot_enable, int, S_IRUGO);
|
||||
|
||||
/* The number of ETM/PTM currently registered */
|
||||
static int etm_count;
|
||||
|
|
@ -573,7 +567,8 @@ static ssize_t mode_store(struct device *dev,
|
|||
if (drvdata->mode & ETM_MODE_STALL) {
|
||||
if (!(drvdata->etmccr & ETMCCR_FIFOFULL)) {
|
||||
dev_warn(drvdata->dev, "stall mode not supported\n");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_unlock;
|
||||
}
|
||||
drvdata->ctrl |= ETMCR_STALL_MODE;
|
||||
} else
|
||||
|
|
@ -582,7 +577,8 @@ static ssize_t mode_store(struct device *dev,
|
|||
if (drvdata->mode & ETM_MODE_TIMESTAMP) {
|
||||
if (!(drvdata->etmccer & ETMCCER_TIMESTAMP)) {
|
||||
dev_warn(drvdata->dev, "timestamp not supported\n");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_unlock;
|
||||
}
|
||||
drvdata->ctrl |= ETMCR_TIMESTAMP_EN;
|
||||
} else
|
||||
|
|
@ -595,6 +591,10 @@ static ssize_t mode_store(struct device *dev,
|
|||
spin_unlock(&drvdata->spinlock);
|
||||
|
||||
return size;
|
||||
|
||||
err_unlock:
|
||||
spin_unlock(&drvdata->spinlock);
|
||||
return ret;
|
||||
}
|
||||
static DEVICE_ATTR_RW(mode);
|
||||
|
||||
|
|
@ -1743,7 +1743,11 @@ static void etm_init_arch_data(void *info)
|
|||
|
||||
static void etm_init_default_data(struct etm_drvdata *drvdata)
|
||||
{
|
||||
static int etm3x_traceid;
|
||||
/*
|
||||
* A trace ID of value 0 is invalid, so let's start at some
|
||||
* random value that fits in 7 bits and will be just as good.
|
||||
*/
|
||||
static int etm3x_traceid = 0x10;
|
||||
|
||||
u32 flags = (1 << 0 | /* instruction execute*/
|
||||
3 << 3 | /* ARM instruction */
|
||||
|
|
|
|||
|
|
@ -252,17 +252,7 @@ static struct amba_driver funnel_driver = {
|
|||
.id_table = funnel_ids,
|
||||
};
|
||||
|
||||
static int __init funnel_init(void)
|
||||
{
|
||||
return amba_driver_register(&funnel_driver);
|
||||
}
|
||||
module_init(funnel_init);
|
||||
|
||||
static void __exit funnel_exit(void)
|
||||
{
|
||||
amba_driver_unregister(&funnel_driver);
|
||||
}
|
||||
module_exit(funnel_exit);
|
||||
module_amba_driver(funnel_driver);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("CoreSight Funnel driver");
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ extern int etm_readl_cp14(u32 off, unsigned int *val);
|
|||
extern int etm_writel_cp14(u32 off, u32 val);
|
||||
#else
|
||||
static inline int etm_readl_cp14(u32 off, unsigned int *val) { return 0; }
|
||||
static inline int etm_writel_cp14(u32 val, u32 off) { return 0; }
|
||||
static inline int etm_writel_cp14(u32 off, u32 val) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ static int replicator_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
desc->type = CORESIGHT_DEV_TYPE_LINK;
|
||||
desc->subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
|
||||
desc->subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
|
||||
desc->ops = &replicator_cs_ops;
|
||||
desc->pdata = pdev->dev.platform_data;
|
||||
desc->dev = &pdev->dev;
|
||||
|
|
|
|||
|
|
@ -760,17 +760,7 @@ static struct amba_driver tmc_driver = {
|
|||
.id_table = tmc_ids,
|
||||
};
|
||||
|
||||
static int __init tmc_init(void)
|
||||
{
|
||||
return amba_driver_register(&tmc_driver);
|
||||
}
|
||||
module_init(tmc_init);
|
||||
|
||||
static void __exit tmc_exit(void)
|
||||
{
|
||||
amba_driver_unregister(&tmc_driver);
|
||||
}
|
||||
module_exit(tmc_exit);
|
||||
module_amba_driver(tmc_driver);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("CoreSight Trace Memory Controller driver");
|
||||
|
|
|
|||
|
|
@ -201,17 +201,7 @@ static struct amba_driver tpiu_driver = {
|
|||
.id_table = tpiu_ids,
|
||||
};
|
||||
|
||||
static int __init tpiu_init(void)
|
||||
{
|
||||
return amba_driver_register(&tpiu_driver);
|
||||
}
|
||||
module_init(tpiu_init);
|
||||
|
||||
static void __exit tpiu_exit(void)
|
||||
{
|
||||
amba_driver_unregister(&tpiu_driver);
|
||||
}
|
||||
module_exit(tpiu_exit);
|
||||
module_amba_driver(tpiu_driver);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("CoreSight Trace Port Interface Unit driver");
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue