diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/mei/interrupt.c | 2 | ||||
-rw-r--r-- | drivers/misc/mei/main.c | 27 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_uv.c | 84 | ||||
-rw-r--r-- | drivers/misc/ti-st/st_ll.c | 2 |
4 files changed, 94 insertions, 21 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index c6ffbbe5a6c0..d78c05e693f7 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -1253,7 +1253,7 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list, | |||
1253 | if (dev->wd_timeout) | 1253 | if (dev->wd_timeout) |
1254 | *slots -= mei_data2slots(MEI_START_WD_DATA_SIZE); | 1254 | *slots -= mei_data2slots(MEI_START_WD_DATA_SIZE); |
1255 | else | 1255 | else |
1256 | *slots -= mei_data2slots(MEI_START_WD_DATA_SIZE); | 1256 | *slots -= mei_data2slots(MEI_WD_PARAMS_SIZE); |
1257 | } | 1257 | } |
1258 | } | 1258 | } |
1259 | if (dev->stop) | 1259 | if (dev->stop) |
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 092330208869..7422c7652845 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -925,6 +925,27 @@ static struct miscdevice mei_misc_device = { | |||
925 | }; | 925 | }; |
926 | 926 | ||
927 | /** | 927 | /** |
928 | * mei_quirk_probe - probe for devices that doesn't valid ME interface | ||
929 | * @pdev: PCI device structure | ||
930 | * @ent: entry into pci_device_table | ||
931 | * | ||
932 | * returns true if ME Interface is valid, false otherwise | ||
933 | */ | ||
934 | static bool __devinit mei_quirk_probe(struct pci_dev *pdev, | ||
935 | const struct pci_device_id *ent) | ||
936 | { | ||
937 | u32 reg; | ||
938 | if (ent->device == MEI_DEV_ID_PBG_1) { | ||
939 | pci_read_config_dword(pdev, 0x48, ®); | ||
940 | /* make sure that bit 9 is up and bit 10 is down */ | ||
941 | if ((reg & 0x600) == 0x200) { | ||
942 | dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); | ||
943 | return false; | ||
944 | } | ||
945 | } | ||
946 | return true; | ||
947 | } | ||
948 | /** | ||
928 | * mei_probe - Device Initialization Routine | 949 | * mei_probe - Device Initialization Routine |
929 | * | 950 | * |
930 | * @pdev: PCI device structure | 951 | * @pdev: PCI device structure |
@@ -939,6 +960,12 @@ static int __devinit mei_probe(struct pci_dev *pdev, | |||
939 | int err; | 960 | int err; |
940 | 961 | ||
941 | mutex_lock(&mei_mutex); | 962 | mutex_lock(&mei_mutex); |
963 | |||
964 | if (!mei_quirk_probe(pdev, ent)) { | ||
965 | err = -ENODEV; | ||
966 | goto end; | ||
967 | } | ||
968 | |||
942 | if (mei_device) { | 969 | if (mei_device) { |
943 | err = -EEXIST; | 970 | err = -EEXIST; |
944 | goto end; | 971 | goto end; |
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 87b251ab6ec5..b9e2000969f0 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/cpu.h> | ||
22 | #include <linux/module.h> | ||
21 | #include <linux/err.h> | 23 | #include <linux/err.h> |
22 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
23 | #include <asm/uv/uv_hub.h> | 25 | #include <asm/uv/uv_hub.h> |
@@ -59,6 +61,8 @@ static struct xpc_heartbeat_uv *xpc_heartbeat_uv; | |||
59 | XPC_NOTIFY_MSG_SIZE_UV) | 61 | XPC_NOTIFY_MSG_SIZE_UV) |
60 | #define XPC_NOTIFY_IRQ_NAME "xpc_notify" | 62 | #define XPC_NOTIFY_IRQ_NAME "xpc_notify" |
61 | 63 | ||
64 | static int xpc_mq_node = -1; | ||
65 | |||
62 | static struct xpc_gru_mq_uv *xpc_activate_mq_uv; | 66 | static struct xpc_gru_mq_uv *xpc_activate_mq_uv; |
63 | static struct xpc_gru_mq_uv *xpc_notify_mq_uv; | 67 | static struct xpc_gru_mq_uv *xpc_notify_mq_uv; |
64 | 68 | ||
@@ -109,11 +113,8 @@ xpc_get_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq, int cpu, char *irq_name) | |||
109 | #if defined CONFIG_X86_64 | 113 | #if defined CONFIG_X86_64 |
110 | mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset, | 114 | mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset, |
111 | UV_AFFINITY_CPU); | 115 | UV_AFFINITY_CPU); |
112 | if (mq->irq < 0) { | 116 | if (mq->irq < 0) |
113 | dev_err(xpc_part, "uv_setup_irq() returned error=%d\n", | ||
114 | -mq->irq); | ||
115 | return mq->irq; | 117 | return mq->irq; |
116 | } | ||
117 | 118 | ||
118 | mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset); | 119 | mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset); |
119 | 120 | ||
@@ -238,8 +239,9 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, | |||
238 | mq->mmr_blade = uv_cpu_to_blade_id(cpu); | 239 | mq->mmr_blade = uv_cpu_to_blade_id(cpu); |
239 | 240 | ||
240 | nid = cpu_to_node(cpu); | 241 | nid = cpu_to_node(cpu); |
241 | page = alloc_pages_exact_node(nid, GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, | 242 | page = alloc_pages_exact_node(nid, |
242 | pg_order); | 243 | GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, |
244 | pg_order); | ||
243 | if (page == NULL) { | 245 | if (page == NULL) { |
244 | dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d " | 246 | dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d " |
245 | "bytes of memory on nid=%d for GRU mq\n", mq_size, nid); | 247 | "bytes of memory on nid=%d for GRU mq\n", mq_size, nid); |
@@ -1731,9 +1733,50 @@ static struct xpc_arch_operations xpc_arch_ops_uv = { | |||
1731 | .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv, | 1733 | .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv, |
1732 | }; | 1734 | }; |
1733 | 1735 | ||
1736 | static int | ||
1737 | xpc_init_mq_node(int nid) | ||
1738 | { | ||
1739 | int cpu; | ||
1740 | |||
1741 | get_online_cpus(); | ||
1742 | |||
1743 | for_each_cpu(cpu, cpumask_of_node(nid)) { | ||
1744 | xpc_activate_mq_uv = | ||
1745 | xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, nid, | ||
1746 | XPC_ACTIVATE_IRQ_NAME, | ||
1747 | xpc_handle_activate_IRQ_uv); | ||
1748 | if (!IS_ERR(xpc_activate_mq_uv)) | ||
1749 | break; | ||
1750 | } | ||
1751 | if (IS_ERR(xpc_activate_mq_uv)) { | ||
1752 | put_online_cpus(); | ||
1753 | return PTR_ERR(xpc_activate_mq_uv); | ||
1754 | } | ||
1755 | |||
1756 | for_each_cpu(cpu, cpumask_of_node(nid)) { | ||
1757 | xpc_notify_mq_uv = | ||
1758 | xpc_create_gru_mq_uv(XPC_NOTIFY_MQ_SIZE_UV, nid, | ||
1759 | XPC_NOTIFY_IRQ_NAME, | ||
1760 | xpc_handle_notify_IRQ_uv); | ||
1761 | if (!IS_ERR(xpc_notify_mq_uv)) | ||
1762 | break; | ||
1763 | } | ||
1764 | if (IS_ERR(xpc_notify_mq_uv)) { | ||
1765 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); | ||
1766 | put_online_cpus(); | ||
1767 | return PTR_ERR(xpc_notify_mq_uv); | ||
1768 | } | ||
1769 | |||
1770 | put_online_cpus(); | ||
1771 | return 0; | ||
1772 | } | ||
1773 | |||
1734 | int | 1774 | int |
1735 | xpc_init_uv(void) | 1775 | xpc_init_uv(void) |
1736 | { | 1776 | { |
1777 | int nid; | ||
1778 | int ret = 0; | ||
1779 | |||
1737 | xpc_arch_ops = xpc_arch_ops_uv; | 1780 | xpc_arch_ops = xpc_arch_ops_uv; |
1738 | 1781 | ||
1739 | if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) { | 1782 | if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) { |
@@ -1742,21 +1785,21 @@ xpc_init_uv(void) | |||
1742 | return -E2BIG; | 1785 | return -E2BIG; |
1743 | } | 1786 | } |
1744 | 1787 | ||
1745 | xpc_activate_mq_uv = xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, 0, | 1788 | if (xpc_mq_node < 0) |
1746 | XPC_ACTIVATE_IRQ_NAME, | 1789 | for_each_online_node(nid) { |
1747 | xpc_handle_activate_IRQ_uv); | 1790 | ret = xpc_init_mq_node(nid); |
1748 | if (IS_ERR(xpc_activate_mq_uv)) | ||
1749 | return PTR_ERR(xpc_activate_mq_uv); | ||
1750 | 1791 | ||
1751 | xpc_notify_mq_uv = xpc_create_gru_mq_uv(XPC_NOTIFY_MQ_SIZE_UV, 0, | 1792 | if (!ret) |
1752 | XPC_NOTIFY_IRQ_NAME, | 1793 | break; |
1753 | xpc_handle_notify_IRQ_uv); | 1794 | } |
1754 | if (IS_ERR(xpc_notify_mq_uv)) { | 1795 | else |
1755 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); | 1796 | ret = xpc_init_mq_node(xpc_mq_node); |
1756 | return PTR_ERR(xpc_notify_mq_uv); | ||
1757 | } | ||
1758 | 1797 | ||
1759 | return 0; | 1798 | if (ret < 0) |
1799 | dev_err(xpc_part, "xpc_init_mq_node() returned error=%d\n", | ||
1800 | -ret); | ||
1801 | |||
1802 | return ret; | ||
1760 | } | 1803 | } |
1761 | 1804 | ||
1762 | void | 1805 | void |
@@ -1765,3 +1808,6 @@ xpc_exit_uv(void) | |||
1765 | xpc_destroy_gru_mq_uv(xpc_notify_mq_uv); | 1808 | xpc_destroy_gru_mq_uv(xpc_notify_mq_uv); |
1766 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); | 1809 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); |
1767 | } | 1810 | } |
1811 | |||
1812 | module_param(xpc_mq_node, int, 0); | ||
1813 | MODULE_PARM_DESC(xpc_mq_node, "Node number on which to allocate message queues."); | ||
diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c index 1ff460a8e9c7..93b4d67cc4a3 100644 --- a/drivers/misc/ti-st/st_ll.c +++ b/drivers/misc/ti-st/st_ll.c | |||
@@ -87,7 +87,7 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data) | |||
87 | /* communicate to platform about chip wakeup */ | 87 | /* communicate to platform about chip wakeup */ |
88 | kim_data = st_data->kim_data; | 88 | kim_data = st_data->kim_data; |
89 | pdata = kim_data->kim_pdev->dev.platform_data; | 89 | pdata = kim_data->kim_pdev->dev.platform_data; |
90 | if (pdata->chip_asleep) | 90 | if (pdata->chip_awake) |
91 | pdata->chip_awake(NULL); | 91 | pdata->chip_awake(NULL); |
92 | } | 92 | } |
93 | 93 | ||