aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/vio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 21:54:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 21:54:23 -0400
commit83c7f72259ea4bd0561e2f2762d97ee2888126ce (patch)
treec8b181e9f9a0bb061f5ab63fabb98197d7aee19a /arch/powerpc/kernel/vio.c
parente05644e17e744315bce12b0948cdc36910b9a76e (diff)
parent574ce79cea9d3fda109ffcc82f81733de4740e5c (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc updates from Benjamin Herrenschmidt: "Notable highlights: - iommu improvements from Anton removing the per-iommu global lock in favor of dividing the DMA space into pools, each with its own lock, and hashed on the CPU number. Along with making the locking more fine grained, this gives significant improvements in multiqueue networking scalability. - Still from Anton, we know provide a vdso based variant of getcpu which makes sched_getcpu with the appropriate glibc patch something like 18 times faster. - More anton goodness (he's been busy !) in other areas such as a faster __clear_user and copy_page on P7, various perf fixes to improve sampling quality, etc... - One more step toward removing legacy i2c interfaces by using new device-tree based probing of platform devices for the AOA audio drivers - A nice series of patches from Michael Neuling that helps avoiding confusion between register numbers and litterals in assembly code, trying to enforce the use of "%rN" register names in gas rather than plain numbers. - A pile of FSL updates - The usual bunch of small fixes, cleanups etc... You may spot a change to drivers/char/mem. The patch got no comment or ack from outside, it's a trivial patch to allow the architecture to skip creating /dev/port, which we use to disable it on ppc64 that don't have a legacy brige. On those, IO ports 0...64K are not mapped in kernel space at all, so accesses to /dev/port cause oopses (and yes, distros -still- ship userspace that bangs hard coded ports such as kbdrate)." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (106 commits) powerpc/mpic: Create a revmap with enough entries for IPIs and timers Remove stale .rej file powerpc/iommu: Fix iommu pool initialization powerpc/eeh: Check handle_eeh_events() return value powerpc/85xx: Add phy nodes in SGMII mode for MPC8536/44/72DS & P2020DS powerpc/e500: add paravirt QEMU platform powerpc/mpc85xx_ds: convert to unified PCI init powerpc/fsl-pci: get PCI init out of board files powerpc/85xx: Update corenet64_smp_defconfig powerpc/85xx: Update corenet32_smp_defconfig powerpc/85xx: Rename P1021RDB-PC device trees to be consistent powerpc/watchdog: move booke watchdog param related code to setup-common.c sound/aoa: Adapt to new i2c probing scheme i2c/powermac: Improve detection of devices from device-tree powerpc: Disable /dev/port interface on systems without an ISA bridge of: Improve prom_update_property() function powerpc: Add "memory" attribute for mfmsr() powerpc/ftrace: Fix assembly trampoline register usage powerpc/hw_breakpoints: Fix incorrect pointer access powerpc: Put the gpr save/restore functions in their own section ...
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r--arch/powerpc/kernel/vio.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index cb87301ccd55..7a421e8fe7ca 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -37,8 +37,6 @@
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/hvcall.h> 38#include <asm/hvcall.h>
39 39
40static struct bus_type vio_bus_type;
41
42static struct vio_dev vio_bus_device = { /* fake "parent" device */ 40static struct vio_dev vio_bus_device = { /* fake "parent" device */
43 .name = "vio", 41 .name = "vio",
44 .type = "", 42 .type = "",
@@ -625,7 +623,7 @@ struct dma_map_ops vio_dma_mapping_ops = {
625 * vio_cmo_set_dev_desired - Set desired entitlement for a device 623 * vio_cmo_set_dev_desired - Set desired entitlement for a device
626 * 624 *
627 * @viodev: struct vio_dev for device to alter 625 * @viodev: struct vio_dev for device to alter
628 * @new_desired: new desired entitlement level in bytes 626 * @desired: new desired entitlement level in bytes
629 * 627 *
630 * For use by devices to request a change to their entitlement at runtime or 628 * For use by devices to request a change to their entitlement at runtime or
631 * through sysfs. The desired entitlement level is changed and a balancing 629 * through sysfs. The desired entitlement level is changed and a balancing
@@ -1262,7 +1260,7 @@ static int vio_bus_remove(struct device *dev)
1262 1260
1263/** 1261/**
1264 * vio_register_driver: - Register a new vio driver 1262 * vio_register_driver: - Register a new vio driver
1265 * @drv: The vio_driver structure to be registered. 1263 * @viodrv: The vio_driver structure to be registered.
1266 */ 1264 */
1267int __vio_register_driver(struct vio_driver *viodrv, struct module *owner, 1265int __vio_register_driver(struct vio_driver *viodrv, struct module *owner,
1268 const char *mod_name) 1266 const char *mod_name)
@@ -1282,7 +1280,7 @@ EXPORT_SYMBOL(__vio_register_driver);
1282 1280
1283/** 1281/**
1284 * vio_unregister_driver - Remove registration of vio driver. 1282 * vio_unregister_driver - Remove registration of vio driver.
1285 * @driver: The vio_driver struct to be removed form registration 1283 * @viodrv: The vio_driver struct to be removed form registration
1286 */ 1284 */
1287void vio_unregister_driver(struct vio_driver *viodrv) 1285void vio_unregister_driver(struct vio_driver *viodrv)
1288{ 1286{
@@ -1397,21 +1395,27 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
1397 viodev->name = of_node->name; 1395 viodev->name = of_node->name;
1398 viodev->dev.of_node = of_node_get(of_node); 1396 viodev->dev.of_node = of_node_get(of_node);
1399 1397
1400 if (firmware_has_feature(FW_FEATURE_CMO))
1401 vio_cmo_set_dma_ops(viodev);
1402 else
1403 set_dma_ops(&viodev->dev, &dma_iommu_ops);
1404 set_iommu_table_base(&viodev->dev, vio_build_iommu_table(viodev));
1405 set_dev_node(&viodev->dev, of_node_to_nid(of_node)); 1398 set_dev_node(&viodev->dev, of_node_to_nid(of_node));
1406 1399
1407 /* init generic 'struct device' fields: */ 1400 /* init generic 'struct device' fields: */
1408 viodev->dev.parent = &vio_bus_device.dev; 1401 viodev->dev.parent = &vio_bus_device.dev;
1409 viodev->dev.bus = &vio_bus_type; 1402 viodev->dev.bus = &vio_bus_type;
1410 viodev->dev.release = vio_dev_release; 1403 viodev->dev.release = vio_dev_release;
1411 /* needed to ensure proper operation of coherent allocations 1404
1412 * later, in case driver doesn't set it explicitly */ 1405 if (of_get_property(viodev->dev.of_node, "ibm,my-dma-window", NULL)) {
1413 dma_set_mask(&viodev->dev, DMA_BIT_MASK(64)); 1406 if (firmware_has_feature(FW_FEATURE_CMO))
1414 dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64)); 1407 vio_cmo_set_dma_ops(viodev);
1408 else
1409 set_dma_ops(&viodev->dev, &dma_iommu_ops);
1410
1411 set_iommu_table_base(&viodev->dev,
1412 vio_build_iommu_table(viodev));
1413
1414 /* needed to ensure proper operation of coherent allocations
1415 * later, in case driver doesn't set it explicitly */
1416 dma_set_mask(&viodev->dev, DMA_BIT_MASK(64));
1417 dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64));
1418 }
1415 1419
1416 /* register with generic device framework */ 1420 /* register with generic device framework */
1417 if (device_register(&viodev->dev)) { 1421 if (device_register(&viodev->dev)) {
@@ -1491,12 +1495,18 @@ static int __init vio_bus_init(void)
1491 if (firmware_has_feature(FW_FEATURE_CMO)) 1495 if (firmware_has_feature(FW_FEATURE_CMO))
1492 vio_cmo_bus_init(); 1496 vio_cmo_bus_init();
1493 1497
1498 return 0;
1499}
1500postcore_initcall(vio_bus_init);
1501
1502static int __init vio_device_init(void)
1503{
1494 vio_bus_scan_register_devices("vdevice"); 1504 vio_bus_scan_register_devices("vdevice");
1495 vio_bus_scan_register_devices("ibm,platform-facilities"); 1505 vio_bus_scan_register_devices("ibm,platform-facilities");
1496 1506
1497 return 0; 1507 return 0;
1498} 1508}
1499__initcall(vio_bus_init); 1509device_initcall(vio_device_init);
1500 1510
1501static ssize_t name_show(struct device *dev, 1511static ssize_t name_show(struct device *dev,
1502 struct device_attribute *attr, char *buf) 1512 struct device_attribute *attr, char *buf)
@@ -1568,7 +1578,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
1568 return 0; 1578 return 0;
1569} 1579}
1570 1580
1571static struct bus_type vio_bus_type = { 1581struct bus_type vio_bus_type = {
1572 .name = "vio", 1582 .name = "vio",
1573 .dev_attrs = vio_dev_attrs, 1583 .dev_attrs = vio_dev_attrs,
1574 .uevent = vio_hotplug, 1584 .uevent = vio_hotplug,