aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 17:34:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 17:34:58 -0400
commitb32729b1eeae7ef8f5709923b36b5a0906d213df (patch)
tree20bb9092d2c67569ea4efd95c0df5b8160b8b1a3
parent091d0d55b286c9340201b4ed4470be87fc568228 (diff)
parentabab8761d095e0805879df48a8ba6ea7f8b31c5e (diff)
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull tile update from Chris Metcalf: "The interesting bug fix is support for the upcoming "4.2" release of the Tilera hypervisor, which by default launches Linux at privilege level 2 instead of 1. The fix lets new and old hypervisors and Linuxes interoperate more smoothly, so I've tagged it for stable@kernel.org so that older Linuxes will be able to boot under the newer hypervisor." * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: usb: tilegx: fix memleak when create hcd fail arch/tile: remove inline marking of EXPORT_SYMBOL functions rtc: rtc-tile: add missing platform_device_unregister() when module exit tile: support new Tilera hypervisor
-rw-r--r--arch/tile/Kconfig14
-rw-r--r--arch/tile/include/hv/hypervisor.h27
-rw-r--r--arch/tile/kernel/head_32.S2
-rw-r--r--arch/tile/kernel/head_64.S12
-rw-r--r--arch/tile/lib/spinlock_32.c2
-rw-r--r--drivers/net/ethernet/tile/tilegx.c2
-rw-r--r--drivers/rtc/rtc-tile.c1
-rw-r--r--drivers/usb/host/ehci-tilegx.c7
-rw-r--r--drivers/usb/host/ohci-tilegx.c7
9 files changed, 57 insertions, 17 deletions
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 5b6a40dd5556..3aa37669ff8c 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -355,11 +355,17 @@ config HARDWALL
355config KERNEL_PL 355config KERNEL_PL
356 int "Processor protection level for kernel" 356 int "Processor protection level for kernel"
357 range 1 2 357 range 1 2
358 default "1" 358 default 2 if TILEGX
359 default 1 if !TILEGX
359 ---help--- 360 ---help---
360 This setting determines the processor protection level the 361 Since MDE 4.2, the Tilera hypervisor runs the kernel
361 kernel will be built to run at. Generally you should use 362 at PL2 by default. If running under an older hypervisor,
362 the default value here. 363 or as a KVM guest, you must run at PL1. (The current
364 hypervisor may also be recompiled with "make HV_PL=2" to
365 allow it to run a kernel at PL1, but clients running at PL1
366 are not expected to be supported indefinitely.)
367
368 If you're not sure, don't change the default.
363 369
364source "arch/tile/gxio/Kconfig" 370source "arch/tile/gxio/Kconfig"
365 371
diff --git a/arch/tile/include/hv/hypervisor.h b/arch/tile/include/hv/hypervisor.h
index ccd847e2347f..837dca5328c2 100644
--- a/arch/tile/include/hv/hypervisor.h
+++ b/arch/tile/include/hv/hypervisor.h
@@ -107,7 +107,22 @@
107#define HV_DISPATCH_ENTRY_SIZE 32 107#define HV_DISPATCH_ENTRY_SIZE 32
108 108
109/** Version of the hypervisor interface defined by this file */ 109/** Version of the hypervisor interface defined by this file */
110#define _HV_VERSION 11 110#define _HV_VERSION 13
111
112/** Last version of the hypervisor interface with old hv_init() ABI.
113 *
114 * The change from version 12 to version 13 corresponds to launching
115 * the client by default at PL2 instead of PL1 (corresponding to the
116 * hv itself running at PL3 instead of PL2). To make this explicit,
117 * the hv_init() API was also extended so the client can report its
118 * desired PL, resulting in a more helpful failure diagnostic. If you
119 * call hv_init() with _HV_VERSION_OLD_HV_INIT and omit the client_pl
120 * argument, the hypervisor will assume client_pl = 1.
121 *
122 * Note that this is a deprecated solution and we do not expect to
123 * support clients of the Tilera hypervisor running at PL1 indefinitely.
124 */
125#define _HV_VERSION_OLD_HV_INIT 12
111 126
112/* Index into hypervisor interface dispatch code blocks. 127/* Index into hypervisor interface dispatch code blocks.
113 * 128 *
@@ -377,7 +392,11 @@ typedef int HV_Errno;
377#ifndef __ASSEMBLER__ 392#ifndef __ASSEMBLER__
378 393
379/** Pass HV_VERSION to hv_init to request this version of the interface. */ 394/** Pass HV_VERSION to hv_init to request this version of the interface. */
380typedef enum { HV_VERSION = _HV_VERSION } HV_VersionNumber; 395typedef enum {
396 HV_VERSION = _HV_VERSION,
397 HV_VERSION_OLD_HV_INIT = _HV_VERSION_OLD_HV_INIT,
398
399} HV_VersionNumber;
381 400
382/** Initializes the hypervisor. 401/** Initializes the hypervisor.
383 * 402 *
@@ -385,9 +404,11 @@ typedef enum { HV_VERSION = _HV_VERSION } HV_VersionNumber;
385 * that this program expects, typically HV_VERSION. 404 * that this program expects, typically HV_VERSION.
386 * @param chip_num Architecture number of the chip the client was built for. 405 * @param chip_num Architecture number of the chip the client was built for.
387 * @param chip_rev_num Revision number of the chip the client was built for. 406 * @param chip_rev_num Revision number of the chip the client was built for.
407 * @param client_pl Privilege level the client is built for
408 * (not required if interface_version_number == HV_VERSION_OLD_HV_INIT).
388 */ 409 */
389void hv_init(HV_VersionNumber interface_version_number, 410void hv_init(HV_VersionNumber interface_version_number,
390 int chip_num, int chip_rev_num); 411 int chip_num, int chip_rev_num, int client_pl);
391 412
392 413
393/** Queries we can make for hv_sysconf(). 414/** Queries we can make for hv_sysconf().
diff --git a/arch/tile/kernel/head_32.S b/arch/tile/kernel/head_32.S
index f71bfeeaf1a9..ac115307e5e4 100644
--- a/arch/tile/kernel/head_32.S
+++ b/arch/tile/kernel/head_32.S
@@ -38,7 +38,7 @@ ENTRY(_start)
38 movei r2, TILE_CHIP_REV 38 movei r2, TILE_CHIP_REV
39 } 39 }
40 { 40 {
41 moveli r0, _HV_VERSION 41 moveli r0, _HV_VERSION_OLD_HV_INIT
42 jal hv_init 42 jal hv_init
43 } 43 }
44 /* Get a reasonable default ASID in r0 */ 44 /* Get a reasonable default ASID in r0 */
diff --git a/arch/tile/kernel/head_64.S b/arch/tile/kernel/head_64.S
index f9a2734f7b82..6093964fa5c7 100644
--- a/arch/tile/kernel/head_64.S
+++ b/arch/tile/kernel/head_64.S
@@ -34,13 +34,19 @@
34ENTRY(_start) 34ENTRY(_start)
35 /* Notify the hypervisor of what version of the API we want */ 35 /* Notify the hypervisor of what version of the API we want */
36 { 36 {
37#if KERNEL_PL == 1 && _HV_VERSION == 13
38 /* Support older hypervisors by asking for API version 12. */
39 movei r0, _HV_VERSION_OLD_HV_INIT
40#else
41 movei r0, _HV_VERSION
42#endif
37 movei r1, TILE_CHIP 43 movei r1, TILE_CHIP
38 movei r2, TILE_CHIP_REV
39 } 44 }
40 { 45 {
41 moveli r0, _HV_VERSION 46 movei r2, TILE_CHIP_REV
42 jal hv_init 47 movei r3, KERNEL_PL
43 } 48 }
49 jal hv_init
44 /* Get a reasonable default ASID in r0 */ 50 /* Get a reasonable default ASID in r0 */
45 { 51 {
46 move r0, zero 52 move r0, zero
diff --git a/arch/tile/lib/spinlock_32.c b/arch/tile/lib/spinlock_32.c
index b16ac49a968e..b34f79aada48 100644
--- a/arch/tile/lib/spinlock_32.c
+++ b/arch/tile/lib/spinlock_32.c
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(arch_spin_unlock_wait);
101 * preserve the semantic that the same read lock can be acquired in an 101 * preserve the semantic that the same read lock can be acquired in an
102 * interrupt context. 102 * interrupt context.
103 */ 103 */
104inline int arch_read_trylock(arch_rwlock_t *rwlock) 104int arch_read_trylock(arch_rwlock_t *rwlock)
105{ 105{
106 u32 val; 106 u32 val;
107 __insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 1); 107 __insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 1);
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 66e025ad5df1..f3c2d034b32c 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -930,7 +930,7 @@ static int tile_net_setup_interrupts(struct net_device *dev)
930 if (info->has_iqueue) { 930 if (info->has_iqueue) {
931 gxio_mpipe_request_notif_ring_interrupt( 931 gxio_mpipe_request_notif_ring_interrupt(
932 &context, cpu_x(cpu), cpu_y(cpu), 932 &context, cpu_x(cpu), cpu_y(cpu),
933 1, ingress_irq, info->iqueue.ring); 933 KERNEL_PL, ingress_irq, info->iqueue.ring);
934 } 934 }
935 } 935 }
936 936
diff --git a/drivers/rtc/rtc-tile.c b/drivers/rtc/rtc-tile.c
index 249b6531f119..fc3dee95f166 100644
--- a/drivers/rtc/rtc-tile.c
+++ b/drivers/rtc/rtc-tile.c
@@ -146,6 +146,7 @@ exit_driver_unregister:
146 */ 146 */
147static void __exit tile_rtc_driver_exit(void) 147static void __exit tile_rtc_driver_exit(void)
148{ 148{
149 platform_device_unregister(tile_rtc_platform_device);
149 platform_driver_unregister(&tile_rtc_platform_driver); 150 platform_driver_unregister(&tile_rtc_platform_driver);
150} 151}
151 152
diff --git a/drivers/usb/host/ehci-tilegx.c b/drivers/usb/host/ehci-tilegx.c
index 1d215cdb9dea..b083a350eea3 100644
--- a/drivers/usb/host/ehci-tilegx.c
+++ b/drivers/usb/host/ehci-tilegx.c
@@ -118,8 +118,10 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev)
118 118
119 hcd = usb_create_hcd(&ehci_tilegx_hc_driver, &pdev->dev, 119 hcd = usb_create_hcd(&ehci_tilegx_hc_driver, &pdev->dev,
120 dev_name(&pdev->dev)); 120 dev_name(&pdev->dev));
121 if (!hcd) 121 if (!hcd) {
122 return -ENOMEM; 122 ret = -ENOMEM;
123 goto err_hcd;
124 }
123 125
124 /* 126 /*
125 * We don't use rsrc_start to map in our registers, but seems like 127 * We don't use rsrc_start to map in our registers, but seems like
@@ -176,6 +178,7 @@ err_have_irq:
176err_no_irq: 178err_no_irq:
177 tilegx_stop_ehc(); 179 tilegx_stop_ehc();
178 usb_put_hcd(hcd); 180 usb_put_hcd(hcd);
181err_hcd:
179 gxio_usb_host_destroy(&pdata->usb_ctx); 182 gxio_usb_host_destroy(&pdata->usb_ctx);
180 return ret; 183 return ret;
181} 184}
diff --git a/drivers/usb/host/ohci-tilegx.c b/drivers/usb/host/ohci-tilegx.c
index 1ae7b28a71c2..ea73009de623 100644
--- a/drivers/usb/host/ohci-tilegx.c
+++ b/drivers/usb/host/ohci-tilegx.c
@@ -112,8 +112,10 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev)
112 112
113 hcd = usb_create_hcd(&ohci_tilegx_hc_driver, &pdev->dev, 113 hcd = usb_create_hcd(&ohci_tilegx_hc_driver, &pdev->dev,
114 dev_name(&pdev->dev)); 114 dev_name(&pdev->dev));
115 if (!hcd) 115 if (!hcd) {
116 return -ENOMEM; 116 ret = -ENOMEM;
117 goto err_hcd;
118 }
117 119
118 /* 120 /*
119 * We don't use rsrc_start to map in our registers, but seems like 121 * We don't use rsrc_start to map in our registers, but seems like
@@ -165,6 +167,7 @@ err_have_irq:
165err_no_irq: 167err_no_irq:
166 tilegx_stop_ohc(); 168 tilegx_stop_ohc();
167 usb_put_hcd(hcd); 169 usb_put_hcd(hcd);
170err_hcd:
168 gxio_usb_host_destroy(&pdata->usb_ctx); 171 gxio_usb_host_destroy(&pdata->usb_ctx);
169 return ret; 172 return ret;
170} 173}