Skip to content

Commit

Permalink
Changes representative of linux-3.10.0-229.11.1.el7.tar.xz
Browse files Browse the repository at this point in the history
  • Loading branch information
da-x committed Dec 21, 2015
1 parent 41061e1 commit 08dc6f4
Show file tree
Hide file tree
Showing 46 changed files with 432 additions and 397 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXTRAVERSION =
NAME = Unicycling Gorilla
RHEL_MAJOR = 7
RHEL_MINOR = 1
RHEL_RELEASE = 229.7.2
RHEL_RELEASE = 229.11.1
RHEL_DRM_VERSION = 3
RHEL_DRM_PATCHLEVEL = 16
RHEL_DRM_SUBLEVEL = 7
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/rtas.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data);
extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data);
extern int rtas_online_cpus_mask(cpumask_var_t cpus);
extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
extern int rtas_ibm_suspend_me(u64 handle, int *vasi_return);
extern int rtas_ibm_suspend_me(u64 handle);

struct rtc_time;
extern unsigned long rtas_get_boot_time(void);
Expand Down
26 changes: 13 additions & 13 deletions arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ int rtas_offline_cpus_mask(cpumask_var_t cpus)
}
EXPORT_SYMBOL(rtas_offline_cpus_mask);

int rtas_ibm_suspend_me(u64 handle, int *vasi_return)
int rtas_ibm_suspend_me(u64 handle)
{
long state;
long rc;
Expand All @@ -919,13 +919,11 @@ int rtas_ibm_suspend_me(u64 handle, int *vasi_return)
printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc);
return rc;
} else if (state == H_VASI_ENABLED) {
*vasi_return = RTAS_NOT_SUSPENDABLE;
return 0;
return -EAGAIN;
} else if (state != H_VASI_SUSPENDING) {
printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned state %ld\n",
state);
*vasi_return = -1;
return 0;
return -EIO;
}

if (!alloc_cpumask_var(&offline_mask, GFP_TEMPORARY))
Expand Down Expand Up @@ -972,7 +970,7 @@ int rtas_ibm_suspend_me(u64 handle, int *vasi_return)
return atomic_read(&data.error);
}
#else /* CONFIG_PPC_PSERIES */
int rtas_ibm_suspend_me(u64 handle, int *vasi_return)
int rtas_ibm_suspend_me(u64 handle)
{
return -ENOSYS;
}
Expand Down Expand Up @@ -1022,7 +1020,6 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
unsigned long flags;
char *buff_copy, *errbuf = NULL;
int nargs, nret, token;
int rc;

if (!capable(CAP_SYS_ADMIN))
return -EPERM;
Expand Down Expand Up @@ -1054,15 +1051,18 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
if (token == ibm_suspend_me_token) {

/*
* rtas_ibm_suspend_me assumes args are in cpu endian, or at least the
* hcall within it requires it.
* rtas_ibm_suspend_me assumes the streamid handle is in cpu
* endian, or at least the hcall within it requires it.
*/
int vasi_rc = 0;
int rc = 0;
u64 handle = ((u64)be32_to_cpu(args.args[0]) << 32)
| be32_to_cpu(args.args[1]);
rc = rtas_ibm_suspend_me(handle, &vasi_rc);
args.rets[0] = cpu_to_be32(vasi_rc);
if (rc)
rc = rtas_ibm_suspend_me(handle);
if (rc == -EAGAIN)
args.rets[0] = cpu_to_be32(RTAS_NOT_SUSPENDABLE);
else if (rc == -EIO)
args.rets[0] = cpu_to_be32(-1);
else if (rc)
return rc;
goto copy_return;
}
Expand Down
51 changes: 28 additions & 23 deletions arch/powerpc/platforms/pseries/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,16 @@ struct direct_window {

/* Dynamic DMA Window support */
struct ddw_query_response {
__be32 windows_available;
__be32 largest_available_block;
__be32 page_size;
__be32 migration_capable;
u32 windows_available;
u32 largest_available_block;
u32 page_size;
u32 migration_capable;
};

struct ddw_create_response {
__be32 liobn;
__be32 addr_hi;
__be32 addr_lo;
u32 liobn;
u32 addr_hi;
u32 addr_lo;
};

static LIST_HEAD(direct_window_list);
Expand Down Expand Up @@ -725,16 +725,18 @@ static void remove_ddw(struct device_node *np)
{
struct dynamic_dma_window_prop *dwp;
struct property *win64;
const u32 *ddw_avail;
u32 ddw_avail[3];
u64 liobn;
int len, ret;
int ret = 0;

ret = of_property_read_u32_array(np, "ibm,ddw-applicable",
&ddw_avail[0], 3);

ddw_avail = of_get_property(np, "ibm,ddw-applicable", &len);
win64 = of_find_property(np, DIRECT64_PROPNAME, NULL);
if (!win64)
return;

if (!ddw_avail || len < 3 * sizeof(u32) || win64->length < sizeof(*dwp))
if (ret || win64->length < sizeof(*dwp))
goto delprop;

dwp = win64->value;
Expand Down Expand Up @@ -871,8 +873,9 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,

do {
/* extra outputs are LIOBN and dma-addr (hi, lo) */
ret = rtas_call(ddw_avail[1], 5, 4, (u32 *)create, cfg_addr,
BUID_HI(buid), BUID_LO(buid), page_shift, window_shift);
ret = rtas_call(ddw_avail[1], 5, 4, (u32 *)create,
cfg_addr, BUID_HI(buid), BUID_LO(buid),
page_shift, window_shift);
} while (rtas_busy_delay(ret));
dev_info(&dev->dev,
"ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d "
Expand Down Expand Up @@ -909,7 +912,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
int page_shift;
u64 dma_addr, max_addr;
struct device_node *dn;
const u32 *uninitialized_var(ddw_avail);
u32 ddw_avail[3];
struct direct_window *window;
struct property *win64;
struct dynamic_dma_window_prop *ddwprop;
Expand Down Expand Up @@ -941,8 +944,9 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
* for the given node in that order.
* the property is actually in the parent, not the PE
*/
ddw_avail = of_get_property(pdn, "ibm,ddw-applicable", &len);
if (!ddw_avail || len < 3 * sizeof(u32))
ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable",
&ddw_avail[0], 3);
if (ret)
goto out_failed;

/*
Expand All @@ -965,11 +969,11 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
dev_dbg(&dev->dev, "no free dynamic windows");
goto out_failed;
}
if (be32_to_cpu(query.page_size) & 4) {
if (query.page_size & 4) {
page_shift = 24; /* 16MB */
} else if (be32_to_cpu(query.page_size) & 2) {
} else if (query.page_size & 2) {
page_shift = 16; /* 64kB */
} else if (be32_to_cpu(query.page_size) & 1) {
} else if (query.page_size & 1) {
page_shift = 12; /* 4kB */
} else {
dev_dbg(&dev->dev, "no supported direct page size in mask %x",
Expand All @@ -979,7 +983,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
/* verify the window * number of ptes will map the partition */
/* check largest block * page size > max memory hotplug addr */
max_addr = memory_hotplug_max();
if (be32_to_cpu(query.largest_available_block) < (max_addr >> page_shift)) {
if (query.largest_available_block < (max_addr >> page_shift)) {
dev_dbg(&dev->dev, "can't map partiton max 0x%llx with %u "
"%llu-sized pages\n", max_addr, query.largest_available_block,
1ULL << page_shift);
Expand All @@ -1005,8 +1009,9 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
if (ret != 0)
goto out_free_prop;

ddwprop->liobn = create.liobn;
ddwprop->dma_base = cpu_to_be64(of_read_number(&create.addr_hi, 2));
ddwprop->liobn = cpu_to_be32(create.liobn);
ddwprop->dma_base = cpu_to_be64(((u64)create.addr_hi << 32) |
create.addr_lo);
ddwprop->tce_shift = cpu_to_be32(page_shift);
ddwprop->window_shift = cpu_to_be32(len);

Expand Down Expand Up @@ -1038,7 +1043,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
list_add(&window->list, &direct_window_list);
spin_unlock(&direct_window_list_lock);

dma_addr = of_read_number(&create.addr_hi, 2);
dma_addr = be64_to_cpu(ddwprop->dma_base);
goto out_unlock;

out_free_window:
Expand Down
70 changes: 42 additions & 28 deletions arch/powerpc/platforms/pseries/mobility.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
static struct kobject *mobility_kobj;

struct update_props_workarea {
u32 phandle;
u32 state;
u64 reserved;
u32 nprops;
__be32 phandle;
__be32 state;
__be64 reserved;
__be32 nprops;
} __packed;

#define NODE_ACTION_MASK 0xff000000
Expand All @@ -53,11 +53,11 @@ static int mobility_rtas_call(int token, char *buf, s32 scope)
return rc;
}

static int delete_dt_node(u32 phandle)
static int delete_dt_node(__be32 phandle)
{
struct device_node *dn;

dn = of_find_node_by_phandle(phandle);
dn = of_find_node_by_phandle(be32_to_cpu(phandle));
if (!dn)
return -ENOENT;

Expand Down Expand Up @@ -126,7 +126,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
return 0;
}

static int update_dt_node(u32 phandle, s32 scope)
static int update_dt_node(__be32 phandle, s32 scope)
{
struct update_props_workarea *upwa;
struct device_node *dn;
Expand All @@ -135,6 +135,7 @@ static int update_dt_node(u32 phandle, s32 scope)
char *prop_data;
char *rtas_buf;
int update_properties_token;
u32 nprops;
u32 vd;

update_properties_token = rtas_token("ibm,update-properties");
Expand All @@ -145,7 +146,7 @@ static int update_dt_node(u32 phandle, s32 scope)
if (!rtas_buf)
return -ENOMEM;

dn = of_find_node_by_phandle(phandle);
dn = of_find_node_by_phandle(be32_to_cpu(phandle));
if (!dn) {
kfree(rtas_buf);
return -ENOENT;
Expand All @@ -161,6 +162,7 @@ static int update_dt_node(u32 phandle, s32 scope)
break;

prop_data = rtas_buf + sizeof(*upwa);
nprops = be32_to_cpu(upwa->nprops);

/* On the first call to ibm,update-properties for a node the
* the first property value descriptor contains an empty
Expand All @@ -169,17 +171,17 @@ static int update_dt_node(u32 phandle, s32 scope)
*/
if (*prop_data == 0) {
prop_data++;
vd = *(u32 *)prop_data;
vd = be32_to_cpu(*(__be32 *)prop_data);
prop_data += vd + sizeof(vd);
upwa->nprops--;
nprops--;
}

for (i = 0; i < upwa->nprops; i++) {
for (i = 0; i < nprops; i++) {
char *prop_name;

prop_name = prop_data;
prop_data += strlen(prop_name) + 1;
vd = *(u32 *)prop_data;
vd = be32_to_cpu(*(__be32 *)prop_data);
prop_data += sizeof(vd);

switch (vd) {
Expand Down Expand Up @@ -211,13 +213,13 @@ static int update_dt_node(u32 phandle, s32 scope)
return 0;
}

static int add_dt_node(u32 parent_phandle, u32 drc_index)
static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
{
struct device_node *dn;
struct device_node *parent_dn;
int rc;

parent_dn = of_find_node_by_phandle(parent_phandle);
parent_dn = of_find_node_by_phandle(be32_to_cpu(parent_phandle));
if (!parent_dn)
return -ENOENT;

Expand All @@ -236,7 +238,7 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index)
int pseries_devicetree_update(s32 scope)
{
char *rtas_buf;
u32 *data;
__be32 *data;
int update_nodes_token;
int rc;

Expand All @@ -253,17 +255,17 @@ int pseries_devicetree_update(s32 scope)
if (rc && rc != 1)
break;

data = (u32 *)rtas_buf + 4;
while (*data & NODE_ACTION_MASK) {
data = (__be32 *)rtas_buf + 4;
while (be32_to_cpu(*data) & NODE_ACTION_MASK) {
int i;
u32 action = *data & NODE_ACTION_MASK;
int node_count = *data & NODE_COUNT_MASK;
u32 action = be32_to_cpu(*data) & NODE_ACTION_MASK;
u32 node_count = be32_to_cpu(*data) & NODE_COUNT_MASK;

data++;

for (i = 0; i < node_count; i++) {
u32 phandle = *data++;
u32 drc_index;
__be32 phandle = *data++;
__be32 drc_index;

switch (action) {
case DELETE_DT_NODE:
Expand Down Expand Up @@ -317,28 +319,34 @@ static ssize_t migrate_store(struct class *class, struct class_attribute *attr,
{
u64 streamid;
int rc;
int vasi_rc = 0;

rc = strict_strtoull(buf, 0, &streamid);
if (rc)
return rc;

do {
rc = rtas_ibm_suspend_me(streamid, &vasi_rc);
if (!rc && vasi_rc == RTAS_NOT_SUSPENDABLE)
rc = rtas_ibm_suspend_me(streamid);
if (rc == -EAGAIN)
ssleep(1);
} while (!rc && vasi_rc == RTAS_NOT_SUSPENDABLE);
} while (rc == -EAGAIN);

if (rc)
return rc;
if (vasi_rc)
return vasi_rc;

post_mobility_fixup();
return count;
}

/*
* Used by drmgr to determine the kernel behavior of the migration interface.
*
* Version 1: Performs all PAPR requirements for migration including
* firmware activation and device tree update.
*/
#define MIGRATION_API_VERSION 1

static CLASS_ATTR(migration, S_IWUSR, NULL, migrate_store);
static CLASS_ATTR_STRING(api_version, S_IRUGO, __stringify(MIGRATION_API_VERSION));

static int __init mobility_sysfs_init(void)
{
Expand All @@ -349,7 +357,13 @@ static int __init mobility_sysfs_init(void)
return -ENOMEM;

rc = sysfs_create_file(mobility_kobj, &class_attr_migration.attr);
if (rc)
pr_err("mobility: unable to create migration sysfs file (%d)\n", rc);

return rc;
rc = sysfs_create_file(mobility_kobj, &class_attr_api_version.attr.attr);
if (rc)
pr_err("mobility: unable to create api_version sysfs file (%d)\n", rc);

return 0;
}
device_initcall(mobility_sysfs_init);
Loading

0 comments on commit 08dc6f4

Please sign in to comment.