diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-08-04 00:52:34 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-08-04 00:52:34 -0400 |
commit | baea90ea14b316e4599f000c713e446908a5aef6 (patch) | |
tree | 17eae40f15832b466121d8f962028472c4568a13 /drivers | |
parent | 36239c6704b71da7fb8e2a9429e159a84d0c5a3e (diff) | |
parent | 3a09b1be53d23df780a0cd0e4087a05e2ca4a00c (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers')
239 files changed, 4828 insertions, 2290 deletions
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c index d97b8dce1668..18b3f1468b7d 100644 --- a/drivers/acpi/acpica/evxfevnt.c +++ b/drivers/acpi/acpica/evxfevnt.c | |||
@@ -70,6 +70,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
70 | acpi_status acpi_enable(void) | 70 | acpi_status acpi_enable(void) |
71 | { | 71 | { |
72 | acpi_status status; | 72 | acpi_status status; |
73 | int retry; | ||
73 | 74 | ||
74 | ACPI_FUNCTION_TRACE(acpi_enable); | 75 | ACPI_FUNCTION_TRACE(acpi_enable); |
75 | 76 | ||
@@ -98,16 +99,18 @@ acpi_status acpi_enable(void) | |||
98 | 99 | ||
99 | /* Sanity check that transition succeeded */ | 100 | /* Sanity check that transition succeeded */ |
100 | 101 | ||
101 | if (acpi_hw_get_mode() != ACPI_SYS_MODE_ACPI) { | 102 | for (retry = 0; retry < 30000; ++retry) { |
102 | ACPI_ERROR((AE_INFO, | 103 | if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { |
103 | "Hardware did not enter ACPI mode")); | 104 | if (retry != 0) |
104 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); | 105 | ACPI_WARNING((AE_INFO, |
106 | "Platform took > %d00 usec to enter ACPI mode", retry)); | ||
107 | return_ACPI_STATUS(AE_OK); | ||
108 | } | ||
109 | acpi_os_stall(100); /* 100 usec */ | ||
105 | } | 110 | } |
106 | 111 | ||
107 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | 112 | ACPI_ERROR((AE_INFO, "Hardware did not enter ACPI mode")); |
108 | "Transition to ACPI mode successful\n")); | 113 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); |
109 | |||
110 | return_ACPI_STATUS(AE_OK); | ||
111 | } | 114 | } |
112 | 115 | ||
113 | ACPI_EXPORT_SYMBOL(acpi_enable) | 116 | ACPI_EXPORT_SYMBOL(acpi_enable) |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 3026e3fa83ef..dc58402b0a17 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -868,9 +868,15 @@ static void acpi_battery_remove_fs(struct acpi_device *device) | |||
868 | static void acpi_battery_notify(struct acpi_device *device, u32 event) | 868 | static void acpi_battery_notify(struct acpi_device *device, u32 event) |
869 | { | 869 | { |
870 | struct acpi_battery *battery = acpi_driver_data(device); | 870 | struct acpi_battery *battery = acpi_driver_data(device); |
871 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
872 | struct device *old; | ||
873 | #endif | ||
871 | 874 | ||
872 | if (!battery) | 875 | if (!battery) |
873 | return; | 876 | return; |
877 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
878 | old = battery->bat.dev; | ||
879 | #endif | ||
874 | acpi_battery_update(battery); | 880 | acpi_battery_update(battery); |
875 | acpi_bus_generate_proc_event(device, event, | 881 | acpi_bus_generate_proc_event(device, event, |
876 | acpi_battery_present(battery)); | 882 | acpi_battery_present(battery)); |
@@ -879,7 +885,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event) | |||
879 | acpi_battery_present(battery)); | 885 | acpi_battery_present(battery)); |
880 | #ifdef CONFIG_ACPI_SYSFS_POWER | 886 | #ifdef CONFIG_ACPI_SYSFS_POWER |
881 | /* acpi_battery_update could remove power_supply object */ | 887 | /* acpi_battery_update could remove power_supply object */ |
882 | if (battery->bat.dev) | 888 | if (old && battery->bat.dev) |
883 | power_supply_changed(&battery->bat); | 889 | power_supply_changed(&battery->bat); |
884 | #endif | 890 | #endif |
885 | } | 891 | } |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 01381be05e96..2bb28b9d91c4 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -214,7 +214,7 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
214 | .ident = "Sony VGN-SR290J", | 214 | .ident = "Sony VGN-SR290J", |
215 | .matches = { | 215 | .matches = { |
216 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | 216 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), |
217 | DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"), | 217 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"), |
218 | }, | 218 | }, |
219 | }, | 219 | }, |
220 | { | 220 | { |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 51284351418f..e9699aaed109 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -223,7 +223,7 @@ static bool processor_physically_present(acpi_handle handle) | |||
223 | type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0; | 223 | type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0; |
224 | cpuid = acpi_get_cpuid(handle, type, acpi_id); | 224 | cpuid = acpi_get_cpuid(handle, type, acpi_id); |
225 | 225 | ||
226 | if (cpuid == -1) | 226 | if ((cpuid == -1) && (num_possible_cpus() > 1)) |
227 | return false; | 227 | return false; |
228 | 228 | ||
229 | return true; | 229 | return true; |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index b1b385692f46..e9a8026d39f0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -76,14 +76,19 @@ static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; | |||
76 | module_param(max_cstate, uint, 0000); | 76 | module_param(max_cstate, uint, 0000); |
77 | static unsigned int nocst __read_mostly; | 77 | static unsigned int nocst __read_mostly; |
78 | module_param(nocst, uint, 0000); | 78 | module_param(nocst, uint, 0000); |
79 | static int bm_check_disable __read_mostly; | ||
80 | module_param(bm_check_disable, uint, 0000); | ||
79 | 81 | ||
80 | static unsigned int latency_factor __read_mostly = 2; | 82 | static unsigned int latency_factor __read_mostly = 2; |
81 | module_param(latency_factor, uint, 0644); | 83 | module_param(latency_factor, uint, 0644); |
82 | 84 | ||
85 | #ifdef CONFIG_ACPI_PROCFS | ||
83 | static u64 us_to_pm_timer_ticks(s64 t) | 86 | static u64 us_to_pm_timer_ticks(s64 t) |
84 | { | 87 | { |
85 | return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); | 88 | return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); |
86 | } | 89 | } |
90 | #endif | ||
91 | |||
87 | /* | 92 | /* |
88 | * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. | 93 | * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. |
89 | * For now disable this. Probably a bug somewhere else. | 94 | * For now disable this. Probably a bug somewhere else. |
@@ -763,6 +768,9 @@ static int acpi_idle_bm_check(void) | |||
763 | { | 768 | { |
764 | u32 bm_status = 0; | 769 | u32 bm_status = 0; |
765 | 770 | ||
771 | if (bm_check_disable) | ||
772 | return 0; | ||
773 | |||
766 | acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status); | 774 | acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status); |
767 | if (bm_status) | 775 | if (bm_status) |
768 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1); | 776 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1); |
@@ -947,7 +955,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
947 | if (acpi_idle_suspend) | 955 | if (acpi_idle_suspend) |
948 | return(acpi_idle_enter_c1(dev, state)); | 956 | return(acpi_idle_enter_c1(dev, state)); |
949 | 957 | ||
950 | if (acpi_idle_bm_check()) { | 958 | if (!cx->bm_sts_skip && acpi_idle_bm_check()) { |
951 | if (dev->safe_state) { | 959 | if (dev->safe_state) { |
952 | dev->last_state = dev->safe_state; | 960 | dev->last_state = dev->safe_state; |
953 | return dev->safe_state->enter(dev, dev->safe_state); | 961 | return dev->safe_state->enter(dev, dev->safe_state); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 5b7c52e4a00f..2862c781b372 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -82,6 +82,20 @@ static int acpi_sleep_prepare(u32 acpi_state) | |||
82 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | 82 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; |
83 | 83 | ||
84 | /* | 84 | /* |
85 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
86 | * and to restore them during the subsequent resume. Windows does that also for | ||
87 | * suspend to RAM. However, it is known that this mechanism does not work on | ||
88 | * all machines, so we allow the user to disable it with the help of the | ||
89 | * 'acpi_sleep=nonvs' kernel command line option. | ||
90 | */ | ||
91 | static bool nvs_nosave; | ||
92 | |||
93 | void __init acpi_nvs_nosave(void) | ||
94 | { | ||
95 | nvs_nosave = true; | ||
96 | } | ||
97 | |||
98 | /* | ||
85 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the | 99 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the |
86 | * user to request that behavior by using the 'acpi_old_suspend_ordering' | 100 | * user to request that behavior by using the 'acpi_old_suspend_ordering' |
87 | * kernel command line option that causes the following variable to be set. | 101 | * kernel command line option that causes the following variable to be set. |
@@ -197,8 +211,7 @@ static int acpi_suspend_begin(suspend_state_t pm_state) | |||
197 | u32 acpi_state = acpi_suspend_states[pm_state]; | 211 | u32 acpi_state = acpi_suspend_states[pm_state]; |
198 | int error = 0; | 212 | int error = 0; |
199 | 213 | ||
200 | error = suspend_nvs_alloc(); | 214 | error = nvs_nosave ? 0 : suspend_nvs_alloc(); |
201 | |||
202 | if (error) | 215 | if (error) |
203 | return error; | 216 | return error; |
204 | 217 | ||
@@ -388,20 +401,6 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
388 | #endif /* CONFIG_SUSPEND */ | 401 | #endif /* CONFIG_SUSPEND */ |
389 | 402 | ||
390 | #ifdef CONFIG_HIBERNATION | 403 | #ifdef CONFIG_HIBERNATION |
391 | /* | ||
392 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
393 | * and to restore them during the subsequent resume. However, it is not certain | ||
394 | * if this mechanism is going to work on all machines, so we allow the user to | ||
395 | * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line | ||
396 | * option. | ||
397 | */ | ||
398 | static bool s4_no_nvs; | ||
399 | |||
400 | void __init acpi_s4_no_nvs(void) | ||
401 | { | ||
402 | s4_no_nvs = true; | ||
403 | } | ||
404 | |||
405 | static unsigned long s4_hardware_signature; | 404 | static unsigned long s4_hardware_signature; |
406 | static struct acpi_table_facs *facs; | 405 | static struct acpi_table_facs *facs; |
407 | static bool nosigcheck; | 406 | static bool nosigcheck; |
@@ -415,7 +414,7 @@ static int acpi_hibernation_begin(void) | |||
415 | { | 414 | { |
416 | int error; | 415 | int error; |
417 | 416 | ||
418 | error = s4_no_nvs ? 0 : suspend_nvs_alloc(); | 417 | error = nvs_nosave ? 0 : suspend_nvs_alloc(); |
419 | if (!error) { | 418 | if (!error) { |
420 | acpi_target_sleep_state = ACPI_STATE_S4; | 419 | acpi_target_sleep_state = ACPI_STATE_S4; |
421 | acpi_sleep_tts_switch(acpi_target_sleep_state); | 420 | acpi_sleep_tts_switch(acpi_target_sleep_state); |
@@ -510,7 +509,7 @@ static int acpi_hibernation_begin_old(void) | |||
510 | error = acpi_sleep_prepare(ACPI_STATE_S4); | 509 | error = acpi_sleep_prepare(ACPI_STATE_S4); |
511 | 510 | ||
512 | if (!error) { | 511 | if (!error) { |
513 | if (!s4_no_nvs) | 512 | if (!nvs_nosave) |
514 | error = suspend_nvs_alloc(); | 513 | error = suspend_nvs_alloc(); |
515 | if (!error) | 514 | if (!error) |
516 | acpi_target_sleep_state = ACPI_STATE_S4; | 515 | acpi_target_sleep_state = ACPI_STATE_S4; |
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index f60b2b6a0931..d31590e7011b 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -122,6 +122,31 @@ static int __init amba_init(void) | |||
122 | 122 | ||
123 | postcore_initcall(amba_init); | 123 | postcore_initcall(amba_init); |
124 | 124 | ||
125 | static int amba_get_enable_pclk(struct amba_device *pcdev) | ||
126 | { | ||
127 | struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk"); | ||
128 | int ret; | ||
129 | |||
130 | pcdev->pclk = pclk; | ||
131 | |||
132 | if (IS_ERR(pclk)) | ||
133 | return PTR_ERR(pclk); | ||
134 | |||
135 | ret = clk_enable(pclk); | ||
136 | if (ret) | ||
137 | clk_put(pclk); | ||
138 | |||
139 | return ret; | ||
140 | } | ||
141 | |||
142 | static void amba_put_disable_pclk(struct amba_device *pcdev) | ||
143 | { | ||
144 | struct clk *pclk = pcdev->pclk; | ||
145 | |||
146 | clk_disable(pclk); | ||
147 | clk_put(pclk); | ||
148 | } | ||
149 | |||
125 | /* | 150 | /* |
126 | * These are the device model conversion veneers; they convert the | 151 | * These are the device model conversion veneers; they convert the |
127 | * device model structures to our more specific structures. | 152 | * device model structures to our more specific structures. |
@@ -130,17 +155,33 @@ static int amba_probe(struct device *dev) | |||
130 | { | 155 | { |
131 | struct amba_device *pcdev = to_amba_device(dev); | 156 | struct amba_device *pcdev = to_amba_device(dev); |
132 | struct amba_driver *pcdrv = to_amba_driver(dev->driver); | 157 | struct amba_driver *pcdrv = to_amba_driver(dev->driver); |
133 | struct amba_id *id; | 158 | struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev); |
159 | int ret; | ||
134 | 160 | ||
135 | id = amba_lookup(pcdrv->id_table, pcdev); | 161 | do { |
162 | ret = amba_get_enable_pclk(pcdev); | ||
163 | if (ret) | ||
164 | break; | ||
165 | |||
166 | ret = pcdrv->probe(pcdev, id); | ||
167 | if (ret == 0) | ||
168 | break; | ||
136 | 169 | ||
137 | return pcdrv->probe(pcdev, id); | 170 | amba_put_disable_pclk(pcdev); |
171 | } while (0); | ||
172 | |||
173 | return ret; | ||
138 | } | 174 | } |
139 | 175 | ||
140 | static int amba_remove(struct device *dev) | 176 | static int amba_remove(struct device *dev) |
141 | { | 177 | { |
178 | struct amba_device *pcdev = to_amba_device(dev); | ||
142 | struct amba_driver *drv = to_amba_driver(dev->driver); | 179 | struct amba_driver *drv = to_amba_driver(dev->driver); |
143 | return drv->remove(to_amba_device(dev)); | 180 | int ret = drv->remove(pcdev); |
181 | |||
182 | amba_put_disable_pclk(pcdev); | ||
183 | |||
184 | return ret; | ||
144 | } | 185 | } |
145 | 186 | ||
146 | static void amba_shutdown(struct device *dev) | 187 | static void amba_shutdown(struct device *dev) |
@@ -203,7 +244,6 @@ static void amba_device_release(struct device *dev) | |||
203 | */ | 244 | */ |
204 | int amba_device_register(struct amba_device *dev, struct resource *parent) | 245 | int amba_device_register(struct amba_device *dev, struct resource *parent) |
205 | { | 246 | { |
206 | u32 pid, cid; | ||
207 | u32 size; | 247 | u32 size; |
208 | void __iomem *tmp; | 248 | void __iomem *tmp; |
209 | int i, ret; | 249 | int i, ret; |
@@ -241,25 +281,35 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
241 | goto err_release; | 281 | goto err_release; |
242 | } | 282 | } |
243 | 283 | ||
244 | /* | 284 | ret = amba_get_enable_pclk(dev); |
245 | * Read pid and cid based on size of resource | 285 | if (ret == 0) { |
246 | * they are located at end of region | 286 | u32 pid, cid; |
247 | */ | ||
248 | for (pid = 0, i = 0; i < 4; i++) | ||
249 | pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) << (i * 8); | ||
250 | for (cid = 0, i = 0; i < 4; i++) | ||
251 | cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) << (i * 8); | ||
252 | 287 | ||
253 | iounmap(tmp); | 288 | /* |
289 | * Read pid and cid based on size of resource | ||
290 | * they are located at end of region | ||
291 | */ | ||
292 | for (pid = 0, i = 0; i < 4; i++) | ||
293 | pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) << | ||
294 | (i * 8); | ||
295 | for (cid = 0, i = 0; i < 4; i++) | ||
296 | cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) << | ||
297 | (i * 8); | ||
254 | 298 | ||
255 | if (cid == 0xb105f00d) | 299 | amba_put_disable_pclk(dev); |
256 | dev->periphid = pid; | ||
257 | 300 | ||
258 | if (!dev->periphid) { | 301 | if (cid == 0xb105f00d) |
259 | ret = -ENODEV; | 302 | dev->periphid = pid; |
260 | goto err_release; | 303 | |
304 | if (!dev->periphid) | ||
305 | ret = -ENODEV; | ||
261 | } | 306 | } |
262 | 307 | ||
308 | iounmap(tmp); | ||
309 | |||
310 | if (ret) | ||
311 | goto err_release; | ||
312 | |||
263 | ret = device_add(&dev->dev); | 313 | ret = device_add(&dev->dev); |
264 | if (ret) | 314 | if (ret) |
265 | goto err_release; | 315 | goto err_release; |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 9630fbdf4e6c..9b9d3bd54e3a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -673,7 +673,7 @@ static struct kobject *get_device_parent(struct device *dev, | |||
673 | */ | 673 | */ |
674 | if (parent == NULL) | 674 | if (parent == NULL) |
675 | parent_kobj = virtual_device_parent(dev); | 675 | parent_kobj = virtual_device_parent(dev); |
676 | else if (parent->class) | 676 | else if (parent->class && !dev->class->ns_type) |
677 | return &parent->kobj; | 677 | return &parent->kobj; |
678 | else | 678 | else |
679 | parent_kobj = &parent->kobj; | 679 | parent_kobj = &parent->kobj; |
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 6f907ebed2d5..6d34f405a2f3 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/wait.h> | 37 | #include <linux/wait.h> |
38 | 38 | ||
39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
40 | #include <asm/io.h> | 40 | #include <linux/io.h> |
41 | 41 | ||
42 | #include <pcmcia/cs_types.h> | 42 | #include <pcmcia/cs_types.h> |
43 | #include <pcmcia/cs.h> | 43 | #include <pcmcia/cs.h> |
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 40aec0fb8596..42d69d4de05c 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c | |||
@@ -244,7 +244,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, | |||
244 | if (rel) { | 244 | if (rel) { |
245 | hdr[0] |= 0x80 + bcsp->msgq_txseq; | 245 | hdr[0] |= 0x80 + bcsp->msgq_txseq; |
246 | BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq); | 246 | BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq); |
247 | bcsp->msgq_txseq = ++(bcsp->msgq_txseq) & 0x07; | 247 | bcsp->msgq_txseq = (bcsp->msgq_txseq + 1) & 0x07; |
248 | } | 248 | } |
249 | 249 | ||
250 | if (bcsp->use_crc) | 250 | if (bcsp->use_crc) |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9344216183a4..a7547150a705 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void) | |||
1216 | 1216 | ||
1217 | /* G33's GTT size defined in gmch_ctrl */ | 1217 | /* G33's GTT size defined in gmch_ctrl */ |
1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); | 1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); |
1219 | switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { | 1219 | switch (gmch_ctrl & I830_GMCH_GMS_MASK) { |
1220 | case G33_PGETBL_SIZE_1M: | 1220 | case I830_GMCH_GMS_STOLEN_512: |
1221 | size = 512; | ||
1222 | break; | ||
1223 | case I830_GMCH_GMS_STOLEN_1024: | ||
1221 | size = 1024; | 1224 | size = 1024; |
1222 | break; | 1225 | break; |
1223 | case G33_PGETBL_SIZE_2M: | 1226 | case I830_GMCH_GMS_STOLEN_8192: |
1224 | size = 2048; | 1227 | size = 8*1024; |
1225 | break; | 1228 | break; |
1226 | default: | 1229 | default: |
1227 | dev_info(&agp_bridge->dev->dev, | 1230 | dev_info(&agp_bridge->dev->dev, |
1228 | "unknown page table size 0x%x, assuming 512KB\n", | 1231 | "unknown page table size 0x%x, assuming 512KB\n", |
1229 | (gmch_ctrl & G33_PGETBL_SIZE_MASK)); | 1232 | (gmch_ctrl & I830_GMCH_GMS_MASK)); |
1230 | size = 512; | 1233 | size = 512; |
1231 | } | 1234 | } |
1232 | } else { | 1235 | } else { |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 5d64e3acb000..878ac0c2cc68 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) | |||
493 | sysrq_key_table[i] = op_p; | 493 | sysrq_key_table[i] = op_p; |
494 | } | 494 | } |
495 | 495 | ||
496 | static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | 496 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) |
497 | { | 497 | { |
498 | struct sysrq_key_op *op_p; | 498 | struct sysrq_key_op *op_p; |
499 | int orig_log_level; | 499 | int orig_log_level; |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 24314a9cffe8..1030f8420137 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -623,7 +623,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | |||
623 | 623 | ||
624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
625 | { | 625 | { |
626 | return tpm_pm_resume(&dev->dev); | 626 | struct tpm_chip *chip = pnp_get_drvdata(dev); |
627 | int ret; | ||
628 | |||
629 | ret = tpm_pm_resume(&dev->dev); | ||
630 | if (!ret) | ||
631 | tpm_continue_selftest(chip); | ||
632 | |||
633 | return ret; | ||
627 | } | 634 | } |
628 | 635 | ||
629 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { | 636 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { |
diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c index d7be69f13154..b7dab32ce63c 100644 --- a/drivers/clocksource/cs5535-clockevt.c +++ b/drivers/clocksource/cs5535-clockevt.c | |||
@@ -194,6 +194,6 @@ err_timer: | |||
194 | 194 | ||
195 | module_init(cs5535_mfgpt_init); | 195 | module_init(cs5535_mfgpt_init); |
196 | 196 | ||
197 | MODULE_AUTHOR("Andres Salomon <dilinger@collabora.co.uk>"); | 197 | MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>"); |
198 | MODULE_DESCRIPTION("CS5535/CS5536 MFGPT clock event driver"); | 198 | MODULE_DESCRIPTION("CS5535/CS5536 MFGPT clock event driver"); |
199 | MODULE_LICENSE("GPL"); | 199 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 063b2184caf5..938b74ea9ffb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1077,6 +1077,7 @@ err_out_unregister: | |||
1077 | 1077 | ||
1078 | err_unlock_policy: | 1078 | err_unlock_policy: |
1079 | unlock_policy_rwsem_write(cpu); | 1079 | unlock_policy_rwsem_write(cpu); |
1080 | free_cpumask_var(policy->related_cpus); | ||
1080 | err_free_cpumask: | 1081 | err_free_cpumask: |
1081 | free_cpumask_var(policy->cpus); | 1082 | free_cpumask_var(policy->cpus); |
1082 | err_free_policy: | 1083 | err_free_policy: |
@@ -1762,17 +1763,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, | |||
1762 | dprintk("governor switch\n"); | 1763 | dprintk("governor switch\n"); |
1763 | 1764 | ||
1764 | /* end old governor */ | 1765 | /* end old governor */ |
1765 | if (data->governor) { | 1766 | if (data->governor) |
1766 | /* | ||
1767 | * Need to release the rwsem around governor | ||
1768 | * stop due to lock dependency between | ||
1769 | * cancel_delayed_work_sync and the read lock | ||
1770 | * taken in the delayed work handler. | ||
1771 | */ | ||
1772 | unlock_policy_rwsem_write(data->cpu); | ||
1773 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); | 1767 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); |
1774 | lock_policy_rwsem_write(data->cpu); | ||
1775 | } | ||
1776 | 1768 | ||
1777 | /* start new governor */ | 1769 | /* start new governor */ |
1778 | data->governor = policy->governor; | 1770 | data->governor = policy->governor; |
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 52ff8aa63f84..1b128702d300 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c | |||
@@ -143,7 +143,7 @@ static inline int which_bucket(unsigned int duration) | |||
143 | * This allows us to calculate | 143 | * This allows us to calculate |
144 | * E(duration)|iowait | 144 | * E(duration)|iowait |
145 | */ | 145 | */ |
146 | if (nr_iowait_cpu()) | 146 | if (nr_iowait_cpu(smp_processor_id())) |
147 | bucket = BUCKETS/2; | 147 | bucket = BUCKETS/2; |
148 | 148 | ||
149 | if (duration < 10) | 149 | if (duration < 10) |
@@ -175,7 +175,7 @@ static inline int performance_multiplier(void) | |||
175 | mult += 2 * get_loadavg(); | 175 | mult += 2 * get_loadavg(); |
176 | 176 | ||
177 | /* for IO wait tasks (per cpu!) we add 5x each */ | 177 | /* for IO wait tasks (per cpu!) we add 5x each */ |
178 | mult += 10 * nr_iowait_cpu(); | 178 | mult += 10 * nr_iowait_cpu(smp_processor_id()); |
179 | 179 | ||
180 | return mult; | 180 | return mult; |
181 | } | 181 | } |
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 637c105f53d2..bd78acf3c365 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -1183,10 +1183,14 @@ static size_t sg_copy_end_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
1183 | /* Copy part of this segment */ | 1183 | /* Copy part of this segment */ |
1184 | ignore = skip - offset; | 1184 | ignore = skip - offset; |
1185 | len = miter.length - ignore; | 1185 | len = miter.length - ignore; |
1186 | if (boffset + len > buflen) | ||
1187 | len = buflen - boffset; | ||
1186 | memcpy(buf + boffset, miter.addr + ignore, len); | 1188 | memcpy(buf + boffset, miter.addr + ignore, len); |
1187 | } else { | 1189 | } else { |
1188 | /* Copy all of this segment */ | 1190 | /* Copy all of this segment (up to buflen) */ |
1189 | len = miter.length; | 1191 | len = miter.length; |
1192 | if (boffset + len > buflen) | ||
1193 | len = buflen - boffset; | ||
1190 | memcpy(buf + boffset, miter.addr, len); | 1194 | memcpy(buf + boffset, miter.addr, len); |
1191 | } | 1195 | } |
1192 | boffset += len; | 1196 | boffset += len; |
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index 5a22ca6927e5..7c3747902a37 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c | |||
@@ -4257,10 +4257,12 @@ static int ppc440spe_adma_setup_irqs(struct ppc440spe_adma_device *adev, | |||
4257 | struct ppc440spe_adma_chan *chan, | 4257 | struct ppc440spe_adma_chan *chan, |
4258 | int *initcode) | 4258 | int *initcode) |
4259 | { | 4259 | { |
4260 | struct of_device *ofdev; | ||
4260 | struct device_node *np; | 4261 | struct device_node *np; |
4261 | int ret; | 4262 | int ret; |
4262 | 4263 | ||
4263 | np = container_of(adev->dev, struct of_device, dev)->node; | 4264 | ofdev = container_of(adev->dev, struct of_device, dev); |
4265 | np = ofdev->dev.of_node; | ||
4264 | if (adev->id != PPC440SPE_XOR_ID) { | 4266 | if (adev->id != PPC440SPE_XOR_ID) { |
4265 | adev->err_irq = irq_of_parse_and_map(np, 1); | 4267 | adev->err_irq = irq_of_parse_and_map(np, 1); |
4266 | if (adev->err_irq == NO_IRQ) { | 4268 | if (adev->err_irq == NO_IRQ) { |
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index aedef7941b22..0d2f9dbb47e4 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig | |||
@@ -209,7 +209,7 @@ config EDAC_I5100 | |||
209 | 209 | ||
210 | config EDAC_MPC85XX | 210 | config EDAC_MPC85XX |
211 | tristate "Freescale MPC83xx / MPC85xx" | 211 | tristate "Freescale MPC83xx / MPC85xx" |
212 | depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || MPC85xx) | 212 | depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx) |
213 | help | 213 | help |
214 | Support for error detection and correction on the Freescale | 214 | Support for error detection and correction on the Freescale |
215 | MPC8349, MPC8560, MPC8540, MPC8548 | 215 | MPC8349, MPC8560, MPC8540, MPC8548 |
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index cf17dbb8014f..ac9f7985096d 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -1958,20 +1958,20 @@ static int get_channel_from_ecc_syndrome(struct mem_ctl_info *mci, u16 syndrome) | |||
1958 | u32 value = 0; | 1958 | u32 value = 0; |
1959 | int err_sym = 0; | 1959 | int err_sym = 0; |
1960 | 1960 | ||
1961 | amd64_read_pci_cfg(pvt->misc_f3_ctl, 0x180, &value); | 1961 | if (boot_cpu_data.x86 == 0x10) { |
1962 | 1962 | ||
1963 | /* F3x180[EccSymbolSize]=1, x8 symbols */ | 1963 | amd64_read_pci_cfg(pvt->misc_f3_ctl, 0x180, &value); |
1964 | if (boot_cpu_data.x86 == 0x10 && | 1964 | |
1965 | boot_cpu_data.x86_model > 7 && | 1965 | /* F3x180[EccSymbolSize]=1 => x8 symbols */ |
1966 | value & BIT(25)) { | 1966 | if (boot_cpu_data.x86_model > 7 && |
1967 | err_sym = decode_syndrome(syndrome, x8_vectors, | 1967 | value & BIT(25)) { |
1968 | ARRAY_SIZE(x8_vectors), 8); | 1968 | err_sym = decode_syndrome(syndrome, x8_vectors, |
1969 | return map_err_sym_to_channel(err_sym, 8); | 1969 | ARRAY_SIZE(x8_vectors), 8); |
1970 | } else { | 1970 | return map_err_sym_to_channel(err_sym, 8); |
1971 | err_sym = decode_syndrome(syndrome, x4_vectors, | 1971 | } |
1972 | ARRAY_SIZE(x4_vectors), 4); | ||
1973 | return map_err_sym_to_channel(err_sym, 4); | ||
1974 | } | 1972 | } |
1973 | err_sym = decode_syndrome(syndrome, x4_vectors, ARRAY_SIZE(x4_vectors), 4); | ||
1974 | return map_err_sym_to_channel(err_sym, 4); | ||
1975 | } | 1975 | } |
1976 | 1976 | ||
1977 | /* | 1977 | /* |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 6b8b7b41ec5f..e0187d16dd7c 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1233,10 +1233,28 @@ static void __init i7core_xeon_pci_fixup(struct pci_id_table *table) | |||
1233 | for (i = 0; i < MAX_SOCKET_BUSES; i++) | 1233 | for (i = 0; i < MAX_SOCKET_BUSES; i++) |
1234 | pcibios_scan_specific_bus(255-i); | 1234 | pcibios_scan_specific_bus(255-i); |
1235 | } | 1235 | } |
1236 | pci_dev_put(pdev); | ||
1236 | table++; | 1237 | table++; |
1237 | } | 1238 | } |
1238 | } | 1239 | } |
1239 | 1240 | ||
1241 | static unsigned i7core_pci_lastbus(void) | ||
1242 | { | ||
1243 | int last_bus = 0, bus; | ||
1244 | struct pci_bus *b = NULL; | ||
1245 | |||
1246 | while ((b = pci_find_next_bus(b)) != NULL) { | ||
1247 | bus = b->number; | ||
1248 | debugf0("Found bus %d\n", bus); | ||
1249 | if (bus > last_bus) | ||
1250 | last_bus = bus; | ||
1251 | } | ||
1252 | |||
1253 | debugf0("Last bus %d\n", last_bus); | ||
1254 | |||
1255 | return last_bus; | ||
1256 | } | ||
1257 | |||
1240 | /* | 1258 | /* |
1241 | * i7core_get_devices Find and perform 'get' operation on the MCH's | 1259 | * i7core_get_devices Find and perform 'get' operation on the MCH's |
1242 | * device/functions we want to reference for this driver | 1260 | * device/functions we want to reference for this driver |
@@ -1244,7 +1262,8 @@ static void __init i7core_xeon_pci_fixup(struct pci_id_table *table) | |||
1244 | * Need to 'get' device 16 func 1 and func 2 | 1262 | * Need to 'get' device 16 func 1 and func 2 |
1245 | */ | 1263 | */ |
1246 | int i7core_get_onedevice(struct pci_dev **prev, int devno, | 1264 | int i7core_get_onedevice(struct pci_dev **prev, int devno, |
1247 | struct pci_id_descr *dev_descr, unsigned n_devs) | 1265 | struct pci_id_descr *dev_descr, unsigned n_devs, |
1266 | unsigned last_bus) | ||
1248 | { | 1267 | { |
1249 | struct i7core_dev *i7core_dev; | 1268 | struct i7core_dev *i7core_dev; |
1250 | 1269 | ||
@@ -1281,7 +1300,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno, | |||
1281 | if (devno == 0) | 1300 | if (devno == 0) |
1282 | return -ENODEV; | 1301 | return -ENODEV; |
1283 | 1302 | ||
1284 | i7core_printk(KERN_ERR, | 1303 | i7core_printk(KERN_INFO, |
1285 | "Device not found: dev %02x.%d PCI ID %04x:%04x\n", | 1304 | "Device not found: dev %02x.%d PCI ID %04x:%04x\n", |
1286 | dev_descr->dev, dev_descr->func, | 1305 | dev_descr->dev, dev_descr->func, |
1287 | PCI_VENDOR_ID_INTEL, dev_descr->dev_id); | 1306 | PCI_VENDOR_ID_INTEL, dev_descr->dev_id); |
@@ -1291,10 +1310,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno, | |||
1291 | } | 1310 | } |
1292 | bus = pdev->bus->number; | 1311 | bus = pdev->bus->number; |
1293 | 1312 | ||
1294 | if (bus == 0x3f) | 1313 | socket = last_bus - bus; |
1295 | socket = 0; | ||
1296 | else | ||
1297 | socket = 255 - bus; | ||
1298 | 1314 | ||
1299 | i7core_dev = get_i7core_dev(socket); | 1315 | i7core_dev = get_i7core_dev(socket); |
1300 | if (!i7core_dev) { | 1316 | if (!i7core_dev) { |
@@ -1358,17 +1374,21 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno, | |||
1358 | 1374 | ||
1359 | static int i7core_get_devices(struct pci_id_table *table) | 1375 | static int i7core_get_devices(struct pci_id_table *table) |
1360 | { | 1376 | { |
1361 | int i, rc; | 1377 | int i, rc, last_bus; |
1362 | struct pci_dev *pdev = NULL; | 1378 | struct pci_dev *pdev = NULL; |
1363 | struct pci_id_descr *dev_descr; | 1379 | struct pci_id_descr *dev_descr; |
1364 | 1380 | ||
1381 | last_bus = i7core_pci_lastbus(); | ||
1382 | |||
1365 | while (table && table->descr) { | 1383 | while (table && table->descr) { |
1366 | dev_descr = table->descr; | 1384 | dev_descr = table->descr; |
1367 | for (i = 0; i < table->n_devs; i++) { | 1385 | for (i = 0; i < table->n_devs; i++) { |
1368 | pdev = NULL; | 1386 | pdev = NULL; |
1369 | do { | 1387 | do { |
1370 | rc = i7core_get_onedevice(&pdev, i, &dev_descr[i], | 1388 | rc = i7core_get_onedevice(&pdev, i, |
1371 | table->n_devs); | 1389 | &dev_descr[i], |
1390 | table->n_devs, | ||
1391 | last_bus); | ||
1372 | if (rc < 0) { | 1392 | if (rc < 0) { |
1373 | if (i == 0) { | 1393 | if (i == 0) { |
1374 | i = table->n_devs; | 1394 | i = table->n_devs; |
@@ -1927,21 +1947,26 @@ fail: | |||
1927 | * 0 for FOUND a device | 1947 | * 0 for FOUND a device |
1928 | * < 0 for error code | 1948 | * < 0 for error code |
1929 | */ | 1949 | */ |
1950 | |||
1951 | static int probed = 0; | ||
1952 | |||
1930 | static int __devinit i7core_probe(struct pci_dev *pdev, | 1953 | static int __devinit i7core_probe(struct pci_dev *pdev, |
1931 | const struct pci_device_id *id) | 1954 | const struct pci_device_id *id) |
1932 | { | 1955 | { |
1933 | int dev_idx = id->driver_data; | ||
1934 | int rc; | 1956 | int rc; |
1935 | struct i7core_dev *i7core_dev; | 1957 | struct i7core_dev *i7core_dev; |
1936 | 1958 | ||
1959 | /* get the pci devices we want to reserve for our use */ | ||
1960 | mutex_lock(&i7core_edac_lock); | ||
1961 | |||
1937 | /* | 1962 | /* |
1938 | * All memory controllers are allocated at the first pass. | 1963 | * All memory controllers are allocated at the first pass. |
1939 | */ | 1964 | */ |
1940 | if (unlikely(dev_idx >= 1)) | 1965 | if (unlikely(probed >= 1)) { |
1966 | mutex_unlock(&i7core_edac_lock); | ||
1941 | return -EINVAL; | 1967 | return -EINVAL; |
1942 | 1968 | } | |
1943 | /* get the pci devices we want to reserve for our use */ | 1969 | probed++; |
1944 | mutex_lock(&i7core_edac_lock); | ||
1945 | 1970 | ||
1946 | rc = i7core_get_devices(pci_dev_table); | 1971 | rc = i7core_get_devices(pci_dev_table); |
1947 | if (unlikely(rc < 0)) | 1972 | if (unlikely(rc < 0)) |
@@ -2013,6 +2038,8 @@ static void __devexit i7core_remove(struct pci_dev *pdev) | |||
2013 | i7core_dev->socket); | 2038 | i7core_dev->socket); |
2014 | } | 2039 | } |
2015 | } | 2040 | } |
2041 | probed--; | ||
2042 | |||
2016 | mutex_unlock(&i7core_edac_lock); | 2043 | mutex_unlock(&i7core_edac_lock); |
2017 | } | 2044 | } |
2018 | 2045 | ||
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 52ca09bf4726..1052340e6802 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c | |||
@@ -336,6 +336,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = { | |||
336 | }, | 336 | }, |
337 | {}, | 337 | {}, |
338 | }; | 338 | }; |
339 | MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match); | ||
339 | 340 | ||
340 | static struct of_platform_driver mpc85xx_pci_err_driver = { | 341 | static struct of_platform_driver mpc85xx_pci_err_driver = { |
341 | .probe = mpc85xx_pci_err_probe, | 342 | .probe = mpc85xx_pci_err_probe, |
@@ -650,6 +651,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = { | |||
650 | { .compatible = "fsl,p2020-l2-cache-controller", }, | 651 | { .compatible = "fsl,p2020-l2-cache-controller", }, |
651 | {}, | 652 | {}, |
652 | }; | 653 | }; |
654 | MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match); | ||
653 | 655 | ||
654 | static struct of_platform_driver mpc85xx_l2_err_driver = { | 656 | static struct of_platform_driver mpc85xx_l2_err_driver = { |
655 | .probe = mpc85xx_l2_err_probe, | 657 | .probe = mpc85xx_l2_err_probe, |
@@ -1120,11 +1122,13 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = { | |||
1120 | { .compatible = "fsl,mpc8555-memory-controller", }, | 1122 | { .compatible = "fsl,mpc8555-memory-controller", }, |
1121 | { .compatible = "fsl,mpc8560-memory-controller", }, | 1123 | { .compatible = "fsl,mpc8560-memory-controller", }, |
1122 | { .compatible = "fsl,mpc8568-memory-controller", }, | 1124 | { .compatible = "fsl,mpc8568-memory-controller", }, |
1125 | { .compatible = "fsl,mpc8569-memory-controller", }, | ||
1123 | { .compatible = "fsl,mpc8572-memory-controller", }, | 1126 | { .compatible = "fsl,mpc8572-memory-controller", }, |
1124 | { .compatible = "fsl,mpc8349-memory-controller", }, | 1127 | { .compatible = "fsl,mpc8349-memory-controller", }, |
1125 | { .compatible = "fsl,p2020-memory-controller", }, | 1128 | { .compatible = "fsl,p2020-memory-controller", }, |
1126 | {}, | 1129 | {}, |
1127 | }; | 1130 | }; |
1131 | MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match); | ||
1128 | 1132 | ||
1129 | static struct of_platform_driver mpc85xx_mc_err_driver = { | 1133 | static struct of_platform_driver mpc85xx_mc_err_driver = { |
1130 | .probe = mpc85xx_mc_err_probe, | 1134 | .probe = mpc85xx_mc_err_probe, |
diff --git a/drivers/gpio/cs5535-gpio.c b/drivers/gpio/cs5535-gpio.c index f73a1555e49d..e23c06893d19 100644 --- a/drivers/gpio/cs5535-gpio.c +++ b/drivers/gpio/cs5535-gpio.c | |||
@@ -352,6 +352,6 @@ static void __exit cs5535_gpio_exit(void) | |||
352 | module_init(cs5535_gpio_init); | 352 | module_init(cs5535_gpio_init); |
353 | module_exit(cs5535_gpio_exit); | 353 | module_exit(cs5535_gpio_exit); |
354 | 354 | ||
355 | MODULE_AUTHOR("Andres Salomon <dilinger@collabora.co.uk>"); | 355 | MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>"); |
356 | MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver"); | 356 | MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver"); |
357 | MODULE_LICENSE("GPL"); | 357 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 3ca36542e338..4e51fe3c1fc4 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -893,10 +893,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low); | |||
893 | void gpio_unexport(unsigned gpio) | 893 | void gpio_unexport(unsigned gpio) |
894 | { | 894 | { |
895 | struct gpio_desc *desc; | 895 | struct gpio_desc *desc; |
896 | int status = -EINVAL; | 896 | int status = 0; |
897 | 897 | ||
898 | if (!gpio_is_valid(gpio)) | 898 | if (!gpio_is_valid(gpio)) { |
899 | status = -EINVAL; | ||
899 | goto done; | 900 | goto done; |
901 | } | ||
900 | 902 | ||
901 | mutex_lock(&sysfs_lock); | 903 | mutex_lock(&sysfs_lock); |
902 | 904 | ||
@@ -911,7 +913,6 @@ void gpio_unexport(unsigned gpio) | |||
911 | clear_bit(FLAG_EXPORT, &desc->flags); | 913 | clear_bit(FLAG_EXPORT, &desc->flags); |
912 | put_device(dev); | 914 | put_device(dev); |
913 | device_unregister(dev); | 915 | device_unregister(dev); |
914 | status = 0; | ||
915 | } else | 916 | } else |
916 | status = -ENODEV; | 917 | status = -ENODEV; |
917 | } | 918 | } |
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c index ee568c8fcbd0..5005990f751f 100644 --- a/drivers/gpio/pl061.c +++ b/drivers/gpio/pl061.c | |||
@@ -232,7 +232,7 @@ static void pl061_irq_handler(unsigned irq, struct irq_desc *desc) | |||
232 | desc->chip->unmask(irq); | 232 | desc->chip->unmask(irq); |
233 | } | 233 | } |
234 | 234 | ||
235 | static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) | 235 | static int pl061_probe(struct amba_device *dev, struct amba_id *id) |
236 | { | 236 | { |
237 | struct pl061_platform_data *pdata; | 237 | struct pl061_platform_data *pdata; |
238 | struct pl061_gpio *chip; | 238 | struct pl061_gpio *chip; |
@@ -333,7 +333,7 @@ free_mem: | |||
333 | return ret; | 333 | return ret; |
334 | } | 334 | } |
335 | 335 | ||
336 | static struct amba_id pl061_ids[] __initdata = { | 336 | static struct amba_id pl061_ids[] = { |
337 | { | 337 | { |
338 | .id = 0x00041061, | 338 | .id = 0x00041061, |
339 | .mask = 0x000fffff, | 339 | .mask = 0x000fffff, |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index c1981861bbbd..f87bf104df7a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -864,8 +864,8 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid, | |||
864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, | 864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, |
865 | false); | 865 | false); |
866 | mode->hdisplay = 1366; | 866 | mode->hdisplay = 1366; |
867 | mode->vsync_start = mode->vsync_start - 1; | 867 | mode->hsync_start = mode->hsync_start - 1; |
868 | mode->vsync_end = mode->vsync_end - 1; | 868 | mode->hsync_end = mode->hsync_end - 1; |
869 | return mode; | 869 | return mode; |
870 | } | 870 | } |
871 | 871 | ||
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 1f2cc6b09623..719662034bbf 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -315,8 +315,9 @@ static void drm_fb_helper_on(struct fb_info *info) | |||
315 | struct drm_device *dev = fb_helper->dev; | 315 | struct drm_device *dev = fb_helper->dev; |
316 | struct drm_crtc *crtc; | 316 | struct drm_crtc *crtc; |
317 | struct drm_crtc_helper_funcs *crtc_funcs; | 317 | struct drm_crtc_helper_funcs *crtc_funcs; |
318 | struct drm_connector *connector; | ||
318 | struct drm_encoder *encoder; | 319 | struct drm_encoder *encoder; |
319 | int i; | 320 | int i, j; |
320 | 321 | ||
321 | /* | 322 | /* |
322 | * For each CRTC in this fb, turn the crtc on then, | 323 | * For each CRTC in this fb, turn the crtc on then, |
@@ -332,7 +333,14 @@ static void drm_fb_helper_on(struct fb_info *info) | |||
332 | 333 | ||
333 | crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON); | 334 | crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON); |
334 | 335 | ||
335 | 336 | /* Walk the connectors & encoders on this fb turning them on */ | |
337 | for (j = 0; j < fb_helper->connector_count; j++) { | ||
338 | connector = fb_helper->connector_info[j]->connector; | ||
339 | connector->dpms = DRM_MODE_DPMS_ON; | ||
340 | drm_connector_property_set_value(connector, | ||
341 | dev->mode_config.dpms_property, | ||
342 | DRM_MODE_DPMS_ON); | ||
343 | } | ||
336 | /* Found a CRTC on this fb, now find encoders */ | 344 | /* Found a CRTC on this fb, now find encoders */ |
337 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 345 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
338 | if (encoder->crtc == crtc) { | 346 | if (encoder->crtc == crtc) { |
@@ -352,8 +360,9 @@ static void drm_fb_helper_off(struct fb_info *info, int dpms_mode) | |||
352 | struct drm_device *dev = fb_helper->dev; | 360 | struct drm_device *dev = fb_helper->dev; |
353 | struct drm_crtc *crtc; | 361 | struct drm_crtc *crtc; |
354 | struct drm_crtc_helper_funcs *crtc_funcs; | 362 | struct drm_crtc_helper_funcs *crtc_funcs; |
363 | struct drm_connector *connector; | ||
355 | struct drm_encoder *encoder; | 364 | struct drm_encoder *encoder; |
356 | int i; | 365 | int i, j; |
357 | 366 | ||
358 | /* | 367 | /* |
359 | * For each CRTC in this fb, find all associated encoders | 368 | * For each CRTC in this fb, find all associated encoders |
@@ -367,6 +376,14 @@ static void drm_fb_helper_off(struct fb_info *info, int dpms_mode) | |||
367 | if (!crtc->enabled) | 376 | if (!crtc->enabled) |
368 | continue; | 377 | continue; |
369 | 378 | ||
379 | /* Walk the connectors on this fb and mark them off */ | ||
380 | for (j = 0; j < fb_helper->connector_count; j++) { | ||
381 | connector = fb_helper->connector_info[j]->connector; | ||
382 | connector->dpms = dpms_mode; | ||
383 | drm_connector_property_set_value(connector, | ||
384 | dev->mode_config.dpms_property, | ||
385 | dpms_mode); | ||
386 | } | ||
370 | /* Found a CRTC on this fb, now find encoders */ | 387 | /* Found a CRTC on this fb, now find encoders */ |
371 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 388 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
372 | if (encoder->crtc == crtc) { | 389 | if (encoder->crtc == crtc) { |
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index aee83fa178f6..9214119c0154 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -605,6 +605,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused) | |||
605 | case FBC_NOT_TILED: | 605 | case FBC_NOT_TILED: |
606 | seq_printf(m, "scanout buffer not tiled"); | 606 | seq_printf(m, "scanout buffer not tiled"); |
607 | break; | 607 | break; |
608 | case FBC_MULTIPLE_PIPES: | ||
609 | seq_printf(m, "multiple pipes are enabled"); | ||
610 | break; | ||
608 | default: | 611 | default: |
609 | seq_printf(m, "unknown reason"); | 612 | seq_printf(m, "unknown reason"); |
610 | } | 613 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index f00c5ae9556c..2305a1234f1e 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1300,7 +1300,7 @@ static void i915_cleanup_compression(struct drm_device *dev) | |||
1300 | struct drm_i915_private *dev_priv = dev->dev_private; | 1300 | struct drm_i915_private *dev_priv = dev->dev_private; |
1301 | 1301 | ||
1302 | drm_mm_put_block(dev_priv->compressed_fb); | 1302 | drm_mm_put_block(dev_priv->compressed_fb); |
1303 | if (!IS_GM45(dev)) | 1303 | if (dev_priv->compressed_llb) |
1304 | drm_mm_put_block(dev_priv->compressed_llb); | 1304 | drm_mm_put_block(dev_priv->compressed_llb); |
1305 | } | 1305 | } |
1306 | 1306 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d147ab2f5bfc..2e1744d37ad5 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -215,6 +215,7 @@ enum no_fbc_reason { | |||
215 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ | 215 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ |
216 | FBC_BAD_PLANE, /* fbc not supported on plane */ | 216 | FBC_BAD_PLANE, /* fbc not supported on plane */ |
217 | FBC_NOT_TILED, /* buffer not tiled */ | 217 | FBC_NOT_TILED, /* buffer not tiled */ |
218 | FBC_MULTIPLE_PIPES, /* more than one pipe active */ | ||
218 | }; | 219 | }; |
219 | 220 | ||
220 | enum intel_pch { | 221 | enum intel_pch { |
@@ -222,6 +223,8 @@ enum intel_pch { | |||
222 | PCH_CPT, /* Cougarpoint PCH */ | 223 | PCH_CPT, /* Cougarpoint PCH */ |
223 | }; | 224 | }; |
224 | 225 | ||
226 | #define QUIRK_PIPEA_FORCE (1<<0) | ||
227 | |||
225 | struct intel_fbdev; | 228 | struct intel_fbdev; |
226 | 229 | ||
227 | typedef struct drm_i915_private { | 230 | typedef struct drm_i915_private { |
@@ -337,6 +340,8 @@ typedef struct drm_i915_private { | |||
337 | /* PCH chipset type */ | 340 | /* PCH chipset type */ |
338 | enum intel_pch pch_type; | 341 | enum intel_pch pch_type; |
339 | 342 | ||
343 | unsigned long quirks; | ||
344 | |||
340 | /* Register state */ | 345 | /* Register state */ |
341 | bool modeset_on_lid; | 346 | bool modeset_on_lid; |
342 | u8 saveLBB; | 347 | u8 saveLBB; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 074385882ccf..5aa747fc25a9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2241,6 +2241,7 @@ i915_gem_object_get_pages(struct drm_gem_object *obj, | |||
2241 | page = read_cache_page_gfp(mapping, i, | 2241 | page = read_cache_page_gfp(mapping, i, |
2242 | GFP_HIGHUSER | | 2242 | GFP_HIGHUSER | |
2243 | __GFP_COLD | | 2243 | __GFP_COLD | |
2244 | __GFP_RECLAIMABLE | | ||
2244 | gfpmask); | 2245 | gfpmask); |
2245 | if (IS_ERR(page)) | 2246 | if (IS_ERR(page)) |
2246 | goto err_pages; | 2247 | goto err_pages; |
@@ -3646,6 +3647,7 @@ i915_gem_wait_for_pending_flip(struct drm_device *dev, | |||
3646 | return ret; | 3647 | return ret; |
3647 | } | 3648 | } |
3648 | 3649 | ||
3650 | |||
3649 | int | 3651 | int |
3650 | i915_gem_do_execbuffer(struct drm_device *dev, void *data, | 3652 | i915_gem_do_execbuffer(struct drm_device *dev, void *data, |
3651 | struct drm_file *file_priv, | 3653 | struct drm_file *file_priv, |
@@ -3793,7 +3795,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3793 | unsigned long long total_size = 0; | 3795 | unsigned long long total_size = 0; |
3794 | int num_fences = 0; | 3796 | int num_fences = 0; |
3795 | for (i = 0; i < args->buffer_count; i++) { | 3797 | for (i = 0; i < args->buffer_count; i++) { |
3796 | obj_priv = object_list[i]->driver_private; | 3798 | obj_priv = to_intel_bo(object_list[i]); |
3797 | 3799 | ||
3798 | total_size += object_list[i]->size; | 3800 | total_size += object_list[i]->size; |
3799 | num_fences += | 3801 | num_fences += |
@@ -4741,6 +4743,16 @@ i915_gem_load(struct drm_device *dev) | |||
4741 | list_add(&dev_priv->mm.shrink_list, &shrink_list); | 4743 | list_add(&dev_priv->mm.shrink_list, &shrink_list); |
4742 | spin_unlock(&shrink_list_lock); | 4744 | spin_unlock(&shrink_list_lock); |
4743 | 4745 | ||
4746 | /* On GEN3 we really need to make sure the ARB C3 LP bit is set */ | ||
4747 | if (IS_GEN3(dev)) { | ||
4748 | u32 tmp = I915_READ(MI_ARB_STATE); | ||
4749 | if (!(tmp & MI_ARB_C3_LP_WRITE_ENABLE)) { | ||
4750 | /* arb state is a masked write, so set bit + bit in mask */ | ||
4751 | tmp = MI_ARB_C3_LP_WRITE_ENABLE | (MI_ARB_C3_LP_WRITE_ENABLE << MI_ARB_MASK_SHIFT); | ||
4752 | I915_WRITE(MI_ARB_STATE, tmp); | ||
4753 | } | ||
4754 | } | ||
4755 | |||
4744 | /* Old X drivers will take 0-2 for front, back, depth buffers */ | 4756 | /* Old X drivers will take 0-2 for front, back, depth buffers */ |
4745 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 4757 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
4746 | dev_priv->fence_reg_start = 3; | 4758 | dev_priv->fence_reg_start = 3; |
@@ -4977,7 +4989,7 @@ i915_gpu_is_active(struct drm_device *dev) | |||
4977 | } | 4989 | } |
4978 | 4990 | ||
4979 | static int | 4991 | static int |
4980 | i915_gem_shrink(int nr_to_scan, gfp_t gfp_mask) | 4992 | i915_gem_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) |
4981 | { | 4993 | { |
4982 | drm_i915_private_t *dev_priv, *next_dev; | 4994 | drm_i915_private_t *dev_priv, *next_dev; |
4983 | struct drm_i915_gem_object *obj_priv, *next_obj; | 4995 | struct drm_i915_gem_object *obj_priv, *next_obj; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 150400f40534..cf41c672defe 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -359,6 +359,70 @@ | |||
359 | #define LM_BURST_LENGTH 0x00000700 | 359 | #define LM_BURST_LENGTH 0x00000700 |
360 | #define LM_FIFO_WATERMARK 0x0000001F | 360 | #define LM_FIFO_WATERMARK 0x0000001F |
361 | #define MI_ARB_STATE 0x020e4 /* 915+ only */ | 361 | #define MI_ARB_STATE 0x020e4 /* 915+ only */ |
362 | #define MI_ARB_MASK_SHIFT 16 /* shift for enable bits */ | ||
363 | |||
364 | /* Make render/texture TLB fetches lower priorty than associated data | ||
365 | * fetches. This is not turned on by default | ||
366 | */ | ||
367 | #define MI_ARB_RENDER_TLB_LOW_PRIORITY (1 << 15) | ||
368 | |||
369 | /* Isoch request wait on GTT enable (Display A/B/C streams). | ||
370 | * Make isoch requests stall on the TLB update. May cause | ||
371 | * display underruns (test mode only) | ||
372 | */ | ||
373 | #define MI_ARB_ISOCH_WAIT_GTT (1 << 14) | ||
374 | |||
375 | /* Block grant count for isoch requests when block count is | ||
376 | * set to a finite value. | ||
377 | */ | ||
378 | #define MI_ARB_BLOCK_GRANT_MASK (3 << 12) | ||
379 | #define MI_ARB_BLOCK_GRANT_8 (0 << 12) /* for 3 display planes */ | ||
380 | #define MI_ARB_BLOCK_GRANT_4 (1 << 12) /* for 2 display planes */ | ||
381 | #define MI_ARB_BLOCK_GRANT_2 (2 << 12) /* for 1 display plane */ | ||
382 | #define MI_ARB_BLOCK_GRANT_0 (3 << 12) /* don't use */ | ||
383 | |||
384 | /* Enable render writes to complete in C2/C3/C4 power states. | ||
385 | * If this isn't enabled, render writes are prevented in low | ||
386 | * power states. That seems bad to me. | ||
387 | */ | ||
388 | #define MI_ARB_C3_LP_WRITE_ENABLE (1 << 11) | ||
389 | |||
390 | /* This acknowledges an async flip immediately instead | ||
391 | * of waiting for 2TLB fetches. | ||
392 | */ | ||
393 | #define MI_ARB_ASYNC_FLIP_ACK_IMMEDIATE (1 << 10) | ||
394 | |||
395 | /* Enables non-sequential data reads through arbiter | ||
396 | */ | ||
397 | #define MI_ARB_DUAL_DATA_PHASE_DISABLE (1 << 9) | ||
398 | |||
399 | /* Disable FSB snooping of cacheable write cycles from binner/render | ||
400 | * command stream | ||
401 | */ | ||
402 | #define MI_ARB_CACHE_SNOOP_DISABLE (1 << 8) | ||
403 | |||
404 | /* Arbiter time slice for non-isoch streams */ | ||
405 | #define MI_ARB_TIME_SLICE_MASK (7 << 5) | ||
406 | #define MI_ARB_TIME_SLICE_1 (0 << 5) | ||
407 | #define MI_ARB_TIME_SLICE_2 (1 << 5) | ||
408 | #define MI_ARB_TIME_SLICE_4 (2 << 5) | ||
409 | #define MI_ARB_TIME_SLICE_6 (3 << 5) | ||
410 | #define MI_ARB_TIME_SLICE_8 (4 << 5) | ||
411 | #define MI_ARB_TIME_SLICE_10 (5 << 5) | ||
412 | #define MI_ARB_TIME_SLICE_14 (6 << 5) | ||
413 | #define MI_ARB_TIME_SLICE_16 (7 << 5) | ||
414 | |||
415 | /* Low priority grace period page size */ | ||
416 | #define MI_ARB_LOW_PRIORITY_GRACE_4KB (0 << 4) /* default */ | ||
417 | #define MI_ARB_LOW_PRIORITY_GRACE_8KB (1 << 4) | ||
418 | |||
419 | /* Disable display A/B trickle feed */ | ||
420 | #define MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE (1 << 2) | ||
421 | |||
422 | /* Set display plane priority */ | ||
423 | #define MI_ARB_DISPLAY_PRIORITY_A_B (0 << 0) /* display A > display B */ | ||
424 | #define MI_ARB_DISPLAY_PRIORITY_B_A (1 << 0) /* display B > display A */ | ||
425 | |||
362 | #define CACHE_MODE_0 0x02120 /* 915+ only */ | 426 | #define CACHE_MODE_0 0x02120 /* 915+ only */ |
363 | #define CM0_MASK_SHIFT 16 | 427 | #define CM0_MASK_SHIFT 16 |
364 | #define CM0_IZ_OPT_DISABLE (1<<6) | 428 | #define CM0_IZ_OPT_DISABLE (1<<6) |
@@ -2805,6 +2869,7 @@ | |||
2805 | 2869 | ||
2806 | #define PCH_PP_STATUS 0xc7200 | 2870 | #define PCH_PP_STATUS 0xc7200 |
2807 | #define PCH_PP_CONTROL 0xc7204 | 2871 | #define PCH_PP_CONTROL 0xc7204 |
2872 | #define PANEL_UNLOCK_REGS (0xabcd << 16) | ||
2808 | #define EDP_FORCE_VDD (1 << 3) | 2873 | #define EDP_FORCE_VDD (1 << 3) |
2809 | #define EDP_BLC_ENABLE (1 << 2) | 2874 | #define EDP_BLC_ENABLE (1 << 2) |
2810 | #define PANEL_POWER_RESET (1 << 1) | 2875 | #define PANEL_POWER_RESET (1 << 1) |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 68dcf36e2793..5e21b3119824 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -862,8 +862,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
862 | intel_clock_t clock; | 862 | intel_clock_t clock; |
863 | int max_n; | 863 | int max_n; |
864 | bool found; | 864 | bool found; |
865 | /* approximately equals target * 0.00488 */ | 865 | /* approximately equals target * 0.00585 */ |
866 | int err_most = (target >> 8) + (target >> 10); | 866 | int err_most = (target >> 8) + (target >> 9); |
867 | found = false; | 867 | found = false; |
868 | 868 | ||
869 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { | 869 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { |
@@ -1180,8 +1180,12 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1180 | struct drm_framebuffer *fb = crtc->fb; | 1180 | struct drm_framebuffer *fb = crtc->fb; |
1181 | struct intel_framebuffer *intel_fb; | 1181 | struct intel_framebuffer *intel_fb; |
1182 | struct drm_i915_gem_object *obj_priv; | 1182 | struct drm_i915_gem_object *obj_priv; |
1183 | struct drm_crtc *tmp_crtc; | ||
1183 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1184 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
1184 | int plane = intel_crtc->plane; | 1185 | int plane = intel_crtc->plane; |
1186 | int crtcs_enabled = 0; | ||
1187 | |||
1188 | DRM_DEBUG_KMS("\n"); | ||
1185 | 1189 | ||
1186 | if (!i915_powersave) | 1190 | if (!i915_powersave) |
1187 | return; | 1191 | return; |
@@ -1199,10 +1203,21 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1199 | * If FBC is already on, we just have to verify that we can | 1203 | * If FBC is already on, we just have to verify that we can |
1200 | * keep it that way... | 1204 | * keep it that way... |
1201 | * Need to disable if: | 1205 | * Need to disable if: |
1206 | * - more than one pipe is active | ||
1202 | * - changing FBC params (stride, fence, mode) | 1207 | * - changing FBC params (stride, fence, mode) |
1203 | * - new fb is too large to fit in compressed buffer | 1208 | * - new fb is too large to fit in compressed buffer |
1204 | * - going to an unsupported config (interlace, pixel multiply, etc.) | 1209 | * - going to an unsupported config (interlace, pixel multiply, etc.) |
1205 | */ | 1210 | */ |
1211 | list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) { | ||
1212 | if (tmp_crtc->enabled) | ||
1213 | crtcs_enabled++; | ||
1214 | } | ||
1215 | DRM_DEBUG_KMS("%d pipes active\n", crtcs_enabled); | ||
1216 | if (crtcs_enabled > 1) { | ||
1217 | DRM_DEBUG_KMS("more than one pipe active, disabling compression\n"); | ||
1218 | dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES; | ||
1219 | goto out_disable; | ||
1220 | } | ||
1206 | if (intel_fb->obj->size > dev_priv->cfb_size) { | 1221 | if (intel_fb->obj->size > dev_priv->cfb_size) { |
1207 | DRM_DEBUG_KMS("framebuffer too large, disabling " | 1222 | DRM_DEBUG_KMS("framebuffer too large, disabling " |
1208 | "compression\n"); | 1223 | "compression\n"); |
@@ -1255,7 +1270,7 @@ out_disable: | |||
1255 | } | 1270 | } |
1256 | } | 1271 | } |
1257 | 1272 | ||
1258 | static int | 1273 | int |
1259 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) | 1274 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) |
1260 | { | 1275 | { |
1261 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 1276 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); |
@@ -2255,6 +2270,11 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2255 | intel_wait_for_vblank(dev); | 2270 | intel_wait_for_vblank(dev); |
2256 | } | 2271 | } |
2257 | 2272 | ||
2273 | /* Don't disable pipe A or pipe A PLLs if needed */ | ||
2274 | if (pipeconf_reg == PIPEACONF && | ||
2275 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | ||
2276 | goto skip_pipe_off; | ||
2277 | |||
2258 | /* Next, disable display pipes */ | 2278 | /* Next, disable display pipes */ |
2259 | temp = I915_READ(pipeconf_reg); | 2279 | temp = I915_READ(pipeconf_reg); |
2260 | if ((temp & PIPEACONF_ENABLE) != 0) { | 2280 | if ((temp & PIPEACONF_ENABLE) != 0) { |
@@ -2270,7 +2290,7 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2270 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); | 2290 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); |
2271 | I915_READ(dpll_reg); | 2291 | I915_READ(dpll_reg); |
2272 | } | 2292 | } |
2273 | 2293 | skip_pipe_off: | |
2274 | /* Wait for the clocks to turn off. */ | 2294 | /* Wait for the clocks to turn off. */ |
2275 | udelay(150); | 2295 | udelay(150); |
2276 | break; | 2296 | break; |
@@ -2356,8 +2376,6 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
2356 | if (mode->clock * 3 > 27000 * 4) | 2376 | if (mode->clock * 3 > 27000 * 4) |
2357 | return MODE_CLOCK_HIGH; | 2377 | return MODE_CLOCK_HIGH; |
2358 | } | 2378 | } |
2359 | |||
2360 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
2361 | return true; | 2379 | return true; |
2362 | } | 2380 | } |
2363 | 2381 | ||
@@ -3736,6 +3754,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3736 | if (dev_priv->lvds_dither) { | 3754 | if (dev_priv->lvds_dither) { |
3737 | if (HAS_PCH_SPLIT(dev)) { | 3755 | if (HAS_PCH_SPLIT(dev)) { |
3738 | pipeconf |= PIPE_ENABLE_DITHER; | 3756 | pipeconf |= PIPE_ENABLE_DITHER; |
3757 | pipeconf &= ~PIPE_DITHER_TYPE_MASK; | ||
3739 | pipeconf |= PIPE_DITHER_TYPE_ST01; | 3758 | pipeconf |= PIPE_DITHER_TYPE_ST01; |
3740 | } else | 3759 | } else |
3741 | lvds |= LVDS_ENABLE_DITHER; | 3760 | lvds |= LVDS_ENABLE_DITHER; |
@@ -4412,7 +4431,8 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule) | |||
4412 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); | 4431 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); |
4413 | 4432 | ||
4414 | /* Unlock panel regs */ | 4433 | /* Unlock panel regs */ |
4415 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4434 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4435 | PANEL_UNLOCK_REGS); | ||
4416 | 4436 | ||
4417 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; | 4437 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; |
4418 | I915_WRITE(dpll_reg, dpll); | 4438 | I915_WRITE(dpll_reg, dpll); |
@@ -4455,7 +4475,8 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc) | |||
4455 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); | 4475 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); |
4456 | 4476 | ||
4457 | /* Unlock panel regs */ | 4477 | /* Unlock panel regs */ |
4458 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4478 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4479 | PANEL_UNLOCK_REGS); | ||
4459 | 4480 | ||
4460 | dpll |= DISPLAY_RATE_SELECT_FPA1; | 4481 | dpll |= DISPLAY_RATE_SELECT_FPA1; |
4461 | I915_WRITE(dpll_reg, dpll); | 4482 | I915_WRITE(dpll_reg, dpll); |
@@ -4695,7 +4716,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4695 | struct drm_gem_object *obj; | 4716 | struct drm_gem_object *obj; |
4696 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4717 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4697 | struct intel_unpin_work *work; | 4718 | struct intel_unpin_work *work; |
4698 | unsigned long flags; | 4719 | unsigned long flags, offset; |
4699 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; | 4720 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; |
4700 | int ret, pipesrc; | 4721 | int ret, pipesrc; |
4701 | u32 flip_mask; | 4722 | u32 flip_mask; |
@@ -4762,19 +4783,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4762 | while (I915_READ(ISR) & flip_mask) | 4783 | while (I915_READ(ISR) & flip_mask) |
4763 | ; | 4784 | ; |
4764 | 4785 | ||
4786 | /* Offset into the new buffer for cases of shared fbs between CRTCs */ | ||
4787 | offset = obj_priv->gtt_offset; | ||
4788 | offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8); | ||
4789 | |||
4765 | BEGIN_LP_RING(4); | 4790 | BEGIN_LP_RING(4); |
4766 | if (IS_I965G(dev)) { | 4791 | if (IS_I965G(dev)) { |
4767 | OUT_RING(MI_DISPLAY_FLIP | | 4792 | OUT_RING(MI_DISPLAY_FLIP | |
4768 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4793 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4769 | OUT_RING(fb->pitch); | 4794 | OUT_RING(fb->pitch); |
4770 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); | 4795 | OUT_RING(offset | obj_priv->tiling_mode); |
4771 | pipesrc = I915_READ(pipesrc_reg); | 4796 | pipesrc = I915_READ(pipesrc_reg); |
4772 | OUT_RING(pipesrc & 0x0fff0fff); | 4797 | OUT_RING(pipesrc & 0x0fff0fff); |
4773 | } else { | 4798 | } else { |
4774 | OUT_RING(MI_DISPLAY_FLIP_I915 | | 4799 | OUT_RING(MI_DISPLAY_FLIP_I915 | |
4775 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4800 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4776 | OUT_RING(fb->pitch); | 4801 | OUT_RING(fb->pitch); |
4777 | OUT_RING(obj_priv->gtt_offset); | 4802 | OUT_RING(offset); |
4778 | OUT_RING(MI_NOOP); | 4803 | OUT_RING(MI_NOOP); |
4779 | } | 4804 | } |
4780 | ADVANCE_LP_RING(); | 4805 | ADVANCE_LP_RING(); |
@@ -5506,6 +5531,66 @@ static void intel_init_display(struct drm_device *dev) | |||
5506 | } | 5531 | } |
5507 | } | 5532 | } |
5508 | 5533 | ||
5534 | /* | ||
5535 | * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend, | ||
5536 | * resume, or other times. This quirk makes sure that's the case for | ||
5537 | * affected systems. | ||
5538 | */ | ||
5539 | static void quirk_pipea_force (struct drm_device *dev) | ||
5540 | { | ||
5541 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5542 | |||
5543 | dev_priv->quirks |= QUIRK_PIPEA_FORCE; | ||
5544 | DRM_DEBUG_DRIVER("applying pipe a force quirk\n"); | ||
5545 | } | ||
5546 | |||
5547 | struct intel_quirk { | ||
5548 | int device; | ||
5549 | int subsystem_vendor; | ||
5550 | int subsystem_device; | ||
5551 | void (*hook)(struct drm_device *dev); | ||
5552 | }; | ||
5553 | |||
5554 | struct intel_quirk intel_quirks[] = { | ||
5555 | /* HP Compaq 2730p needs pipe A force quirk (LP: #291555) */ | ||
5556 | { 0x2a42, 0x103c, 0x30eb, quirk_pipea_force }, | ||
5557 | /* HP Mini needs pipe A force quirk (LP: #322104) */ | ||
5558 | { 0x27ae,0x103c, 0x361a, quirk_pipea_force }, | ||
5559 | |||
5560 | /* Thinkpad R31 needs pipe A force quirk */ | ||
5561 | { 0x3577, 0x1014, 0x0505, quirk_pipea_force }, | ||
5562 | /* Toshiba Protege R-205, S-209 needs pipe A force quirk */ | ||
5563 | { 0x2592, 0x1179, 0x0001, quirk_pipea_force }, | ||
5564 | |||
5565 | /* ThinkPad X30 needs pipe A force quirk (LP: #304614) */ | ||
5566 | { 0x3577, 0x1014, 0x0513, quirk_pipea_force }, | ||
5567 | /* ThinkPad X40 needs pipe A force quirk */ | ||
5568 | |||
5569 | /* ThinkPad T60 needs pipe A force quirk (bug #16494) */ | ||
5570 | { 0x2782, 0x17aa, 0x201a, quirk_pipea_force }, | ||
5571 | |||
5572 | /* 855 & before need to leave pipe A & dpll A up */ | ||
5573 | { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5574 | { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5575 | }; | ||
5576 | |||
5577 | static void intel_init_quirks(struct drm_device *dev) | ||
5578 | { | ||
5579 | struct pci_dev *d = dev->pdev; | ||
5580 | int i; | ||
5581 | |||
5582 | for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) { | ||
5583 | struct intel_quirk *q = &intel_quirks[i]; | ||
5584 | |||
5585 | if (d->device == q->device && | ||
5586 | (d->subsystem_vendor == q->subsystem_vendor || | ||
5587 | q->subsystem_vendor == PCI_ANY_ID) && | ||
5588 | (d->subsystem_device == q->subsystem_device || | ||
5589 | q->subsystem_device == PCI_ANY_ID)) | ||
5590 | q->hook(dev); | ||
5591 | } | ||
5592 | } | ||
5593 | |||
5509 | void intel_modeset_init(struct drm_device *dev) | 5594 | void intel_modeset_init(struct drm_device *dev) |
5510 | { | 5595 | { |
5511 | struct drm_i915_private *dev_priv = dev->dev_private; | 5596 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5518,6 +5603,8 @@ void intel_modeset_init(struct drm_device *dev) | |||
5518 | 5603 | ||
5519 | dev->mode_config.funcs = (void *)&intel_mode_funcs; | 5604 | dev->mode_config.funcs = (void *)&intel_mode_funcs; |
5520 | 5605 | ||
5606 | intel_init_quirks(dev); | ||
5607 | |||
5521 | intel_init_display(dev); | 5608 | intel_init_display(dev); |
5522 | 5609 | ||
5523 | if (IS_I965G(dev)) { | 5610 | if (IS_I965G(dev)) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1aac59e83bff..5dde80f9e652 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -717,6 +717,51 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
717 | } | 717 | } |
718 | } | 718 | } |
719 | 719 | ||
720 | static void ironlake_edp_panel_on (struct drm_device *dev) | ||
721 | { | ||
722 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
723 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
724 | u32 pp, pp_status; | ||
725 | |||
726 | pp_status = I915_READ(PCH_PP_STATUS); | ||
727 | if (pp_status & PP_ON) | ||
728 | return; | ||
729 | |||
730 | pp = I915_READ(PCH_PP_CONTROL); | ||
731 | pp |= PANEL_UNLOCK_REGS | POWER_TARGET_ON; | ||
732 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
733 | do { | ||
734 | pp_status = I915_READ(PCH_PP_STATUS); | ||
735 | } while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout)); | ||
736 | |||
737 | if (time_after(jiffies, timeout)) | ||
738 | DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status); | ||
739 | |||
740 | pp &= ~(PANEL_UNLOCK_REGS | EDP_FORCE_VDD); | ||
741 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
742 | } | ||
743 | |||
744 | static void ironlake_edp_panel_off (struct drm_device *dev) | ||
745 | { | ||
746 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
747 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
748 | u32 pp, pp_status; | ||
749 | |||
750 | pp = I915_READ(PCH_PP_CONTROL); | ||
751 | pp &= ~POWER_TARGET_ON; | ||
752 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
753 | do { | ||
754 | pp_status = I915_READ(PCH_PP_STATUS); | ||
755 | } while ((pp_status & PP_ON) && !time_after(jiffies, timeout)); | ||
756 | |||
757 | if (time_after(jiffies, timeout)) | ||
758 | DRM_DEBUG_KMS("panel off wait timed out\n"); | ||
759 | |||
760 | /* Make sure VDD is enabled so DP AUX will work */ | ||
761 | pp |= EDP_FORCE_VDD; | ||
762 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
763 | } | ||
764 | |||
720 | static void ironlake_edp_backlight_on (struct drm_device *dev) | 765 | static void ironlake_edp_backlight_on (struct drm_device *dev) |
721 | { | 766 | { |
722 | struct drm_i915_private *dev_priv = dev->dev_private; | 767 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -751,14 +796,18 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
751 | if (mode != DRM_MODE_DPMS_ON) { | 796 | if (mode != DRM_MODE_DPMS_ON) { |
752 | if (dp_reg & DP_PORT_EN) { | 797 | if (dp_reg & DP_PORT_EN) { |
753 | intel_dp_link_down(intel_encoder, dp_priv->DP); | 798 | intel_dp_link_down(intel_encoder, dp_priv->DP); |
754 | if (IS_eDP(intel_encoder)) | 799 | if (IS_eDP(intel_encoder)) { |
755 | ironlake_edp_backlight_off(dev); | 800 | ironlake_edp_backlight_off(dev); |
801 | ironlake_edp_panel_off(dev); | ||
802 | } | ||
756 | } | 803 | } |
757 | } else { | 804 | } else { |
758 | if (!(dp_reg & DP_PORT_EN)) { | 805 | if (!(dp_reg & DP_PORT_EN)) { |
759 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); | 806 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); |
760 | if (IS_eDP(intel_encoder)) | 807 | if (IS_eDP(intel_encoder)) { |
808 | ironlake_edp_panel_on(dev); | ||
761 | ironlake_edp_backlight_on(dev); | 809 | ironlake_edp_backlight_on(dev); |
810 | } | ||
762 | } | 811 | } |
763 | } | 812 | } |
764 | dp_priv->dpms_mode = mode; | 813 | dp_priv->dpms_mode = mode; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 72206f37c4fb..2f7970be9051 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -215,6 +215,9 @@ extern void intel_init_clock_gating(struct drm_device *dev); | |||
215 | extern void ironlake_enable_drps(struct drm_device *dev); | 215 | extern void ironlake_enable_drps(struct drm_device *dev); |
216 | extern void ironlake_disable_drps(struct drm_device *dev); | 216 | extern void ironlake_disable_drps(struct drm_device *dev); |
217 | 217 | ||
218 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, | ||
219 | struct drm_gem_object *obj); | ||
220 | |||
218 | extern int intel_framebuffer_init(struct drm_device *dev, | 221 | extern int intel_framebuffer_init(struct drm_device *dev, |
219 | struct intel_framebuffer *ifb, | 222 | struct intel_framebuffer *ifb, |
220 | struct drm_mode_fb_cmd *mode_cmd, | 223 | struct drm_mode_fb_cmd *mode_cmd, |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index c3c505244e07..3e18c9e7729b 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev, | |||
98 | 98 | ||
99 | mutex_lock(&dev->struct_mutex); | 99 | mutex_lock(&dev->struct_mutex); |
100 | 100 | ||
101 | ret = i915_gem_object_pin(fbo, 64*1024); | 101 | ret = intel_pin_and_fence_fb_obj(dev, fbo); |
102 | if (ret) { | 102 | if (ret) { |
103 | DRM_ERROR("failed to pin fb: %d\n", ret); | 103 | DRM_ERROR("failed to pin fb: %d\n", ret); |
104 | goto out_unref; | 104 | goto out_unref; |
@@ -236,7 +236,7 @@ int intel_fbdev_destroy(struct drm_device *dev, | |||
236 | 236 | ||
237 | drm_framebuffer_cleanup(&ifb->base); | 237 | drm_framebuffer_cleanup(&ifb->base); |
238 | if (ifb->obj) | 238 | if (ifb->obj) |
239 | drm_gem_object_unreference_unlocked(ifb->obj); | 239 | drm_gem_object_unreference(ifb->obj); |
240 | 240 | ||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 31df55f0a0a7..0eab8df5bf7e 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -599,6 +599,26 @@ static int intel_lvds_get_modes(struct drm_connector *connector) | |||
599 | return 0; | 599 | return 0; |
600 | } | 600 | } |
601 | 601 | ||
602 | static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id) | ||
603 | { | ||
604 | DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident); | ||
605 | return 1; | ||
606 | } | ||
607 | |||
608 | /* The GPU hangs up on these systems if modeset is performed on LID open */ | ||
609 | static const struct dmi_system_id intel_no_modeset_on_lid[] = { | ||
610 | { | ||
611 | .callback = intel_no_modeset_on_lid_dmi_callback, | ||
612 | .ident = "Toshiba Tecra A11", | ||
613 | .matches = { | ||
614 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
615 | DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"), | ||
616 | }, | ||
617 | }, | ||
618 | |||
619 | { } /* terminating entry */ | ||
620 | }; | ||
621 | |||
602 | /* | 622 | /* |
603 | * Lid events. Note the use of 'modeset_on_lid': | 623 | * Lid events. Note the use of 'modeset_on_lid': |
604 | * - we set it on lid close, and reset it on open | 624 | * - we set it on lid close, and reset it on open |
@@ -622,6 +642,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | |||
622 | */ | 642 | */ |
623 | if (connector) | 643 | if (connector) |
624 | connector->status = connector->funcs->detect(connector); | 644 | connector->status = connector->funcs->detect(connector); |
645 | /* Don't force modeset on machines where it causes a GPU lockup */ | ||
646 | if (dmi_check_system(intel_no_modeset_on_lid)) | ||
647 | return NOTIFY_OK; | ||
625 | if (!acpi_lid_open()) { | 648 | if (!acpi_lid_open()) { |
626 | dev_priv->modeset_on_lid = 1; | 649 | dev_priv->modeset_on_lid = 1; |
627 | return NOTIFY_OK; | 650 | return NOTIFY_OK; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index fc924b649195..e492919faf44 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -203,36 +203,26 @@ struct methods { | |||
203 | const bool rw; | 203 | const bool rw; |
204 | }; | 204 | }; |
205 | 205 | ||
206 | static struct methods nv04_methods[] = { | 206 | static struct methods shadow_methods[] = { |
207 | { "PROM", load_vbios_prom, false }, | ||
208 | { "PRAMIN", load_vbios_pramin, true }, | ||
209 | { "PCIROM", load_vbios_pci, true }, | ||
210 | }; | ||
211 | |||
212 | static struct methods nv50_methods[] = { | ||
213 | { "ACPI", load_vbios_acpi, true }, | ||
214 | { "PRAMIN", load_vbios_pramin, true }, | 207 | { "PRAMIN", load_vbios_pramin, true }, |
215 | { "PROM", load_vbios_prom, false }, | 208 | { "PROM", load_vbios_prom, false }, |
216 | { "PCIROM", load_vbios_pci, true }, | 209 | { "PCIROM", load_vbios_pci, true }, |
210 | { "ACPI", load_vbios_acpi, true }, | ||
217 | }; | 211 | }; |
218 | 212 | ||
219 | #define METHODCNT 3 | ||
220 | |||
221 | static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) | 213 | static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) |
222 | { | 214 | { |
223 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 215 | const int nr_methods = ARRAY_SIZE(shadow_methods); |
224 | struct methods *methods; | 216 | struct methods *methods = shadow_methods; |
225 | int i; | ||
226 | int testscore = 3; | 217 | int testscore = 3; |
227 | int scores[METHODCNT]; | 218 | int scores[nr_methods], i; |
228 | 219 | ||
229 | if (nouveau_vbios) { | 220 | if (nouveau_vbios) { |
230 | methods = nv04_methods; | 221 | for (i = 0; i < nr_methods; i++) |
231 | for (i = 0; i < METHODCNT; i++) | ||
232 | if (!strcasecmp(nouveau_vbios, methods[i].desc)) | 222 | if (!strcasecmp(nouveau_vbios, methods[i].desc)) |
233 | break; | 223 | break; |
234 | 224 | ||
235 | if (i < METHODCNT) { | 225 | if (i < nr_methods) { |
236 | NV_INFO(dev, "Attempting to use BIOS image from %s\n", | 226 | NV_INFO(dev, "Attempting to use BIOS image from %s\n", |
237 | methods[i].desc); | 227 | methods[i].desc); |
238 | 228 | ||
@@ -244,12 +234,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) | |||
244 | NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios); | 234 | NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios); |
245 | } | 235 | } |
246 | 236 | ||
247 | if (dev_priv->card_type < NV_50) | 237 | for (i = 0; i < nr_methods; i++) { |
248 | methods = nv04_methods; | ||
249 | else | ||
250 | methods = nv50_methods; | ||
251 | |||
252 | for (i = 0; i < METHODCNT; i++) { | ||
253 | NV_TRACE(dev, "Attempting to load BIOS image from %s\n", | 238 | NV_TRACE(dev, "Attempting to load BIOS image from %s\n", |
254 | methods[i].desc); | 239 | methods[i].desc); |
255 | data[0] = data[1] = 0; /* avoid reuse of previous image */ | 240 | data[0] = data[1] = 0; /* avoid reuse of previous image */ |
@@ -260,7 +245,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) | |||
260 | } | 245 | } |
261 | 246 | ||
262 | while (--testscore > 0) { | 247 | while (--testscore > 0) { |
263 | for (i = 0; i < METHODCNT; i++) { | 248 | for (i = 0; i < nr_methods; i++) { |
264 | if (scores[i] == testscore) { | 249 | if (scores[i] == testscore) { |
265 | NV_TRACE(dev, "Using BIOS image from %s\n", | 250 | NV_TRACE(dev, "Using BIOS image from %s\n", |
266 | methods[i].desc); | 251 | methods[i].desc); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index c9a4a0d2a115..257ea130ae13 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -387,7 +387,8 @@ int nouveau_fbcon_init(struct drm_device *dev) | |||
387 | dev_priv->nfbdev = nfbdev; | 387 | dev_priv->nfbdev = nfbdev; |
388 | nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; | 388 | nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; |
389 | 389 | ||
390 | ret = drm_fb_helper_init(dev, &nfbdev->helper, 2, 4); | 390 | ret = drm_fb_helper_init(dev, &nfbdev->helper, |
391 | nv_two_heads(dev) ? 2 : 1, 4); | ||
391 | if (ret) { | 392 | if (ret) { |
392 | kfree(nfbdev); | 393 | kfree(nfbdev); |
393 | return ret; | 394 | return ret; |
diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 010963d4570f..345a75a03c96 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c | |||
@@ -333,7 +333,6 @@ static int evergreen_cs_packet_parse_vline(struct radeon_cs_parser *p) | |||
333 | header = radeon_get_ib_value(p, h_idx); | 333 | header = radeon_get_ib_value(p, h_idx); |
334 | crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1); | 334 | crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1); |
335 | reg = CP_PACKET0_GET_REG(header); | 335 | reg = CP_PACKET0_GET_REG(header); |
336 | mutex_lock(&p->rdev->ddev->mode_config.mutex); | ||
337 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); | 336 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); |
338 | if (!obj) { | 337 | if (!obj) { |
339 | DRM_ERROR("cannot find crtc %d\n", crtc_id); | 338 | DRM_ERROR("cannot find crtc %d\n", crtc_id); |
@@ -368,7 +367,6 @@ static int evergreen_cs_packet_parse_vline(struct radeon_cs_parser *p) | |||
368 | } | 367 | } |
369 | } | 368 | } |
370 | out: | 369 | out: |
371 | mutex_unlock(&p->rdev->ddev->mode_config.mutex); | ||
372 | return r; | 370 | return r; |
373 | } | 371 | } |
374 | 372 | ||
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 3970e62eaab8..a89a15ab524d 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -1230,7 +1230,6 @@ int r100_cs_packet_parse_vline(struct radeon_cs_parser *p) | |||
1230 | header = radeon_get_ib_value(p, h_idx); | 1230 | header = radeon_get_ib_value(p, h_idx); |
1231 | crtc_id = radeon_get_ib_value(p, h_idx + 5); | 1231 | crtc_id = radeon_get_ib_value(p, h_idx + 5); |
1232 | reg = CP_PACKET0_GET_REG(header); | 1232 | reg = CP_PACKET0_GET_REG(header); |
1233 | mutex_lock(&p->rdev->ddev->mode_config.mutex); | ||
1234 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); | 1233 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); |
1235 | if (!obj) { | 1234 | if (!obj) { |
1236 | DRM_ERROR("cannot find crtc %d\n", crtc_id); | 1235 | DRM_ERROR("cannot find crtc %d\n", crtc_id); |
@@ -1264,7 +1263,6 @@ int r100_cs_packet_parse_vline(struct radeon_cs_parser *p) | |||
1264 | ib[h_idx + 3] |= RADEON_ENG_DISPLAY_SELECT_CRTC1; | 1263 | ib[h_idx + 3] |= RADEON_ENG_DISPLAY_SELECT_CRTC1; |
1265 | } | 1264 | } |
1266 | out: | 1265 | out: |
1267 | mutex_unlock(&p->rdev->ddev->mode_config.mutex); | ||
1268 | return r; | 1266 | return r; |
1269 | } | 1267 | } |
1270 | 1268 | ||
@@ -2354,6 +2352,7 @@ void r100_mc_init(struct radeon_device *rdev) | |||
2354 | if (rdev->flags & RADEON_IS_IGP) | 2352 | if (rdev->flags & RADEON_IS_IGP) |
2355 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; | 2353 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; |
2356 | radeon_vram_location(rdev, &rdev->mc, base); | 2354 | radeon_vram_location(rdev, &rdev->mc, base); |
2355 | rdev->mc.gtt_base_align = 0; | ||
2357 | if (!(rdev->flags & RADEON_IS_AGP)) | 2356 | if (!(rdev->flags & RADEON_IS_AGP)) |
2358 | radeon_gtt_location(rdev, &rdev->mc); | 2357 | radeon_gtt_location(rdev, &rdev->mc); |
2359 | radeon_update_bandwidth_info(rdev); | 2358 | radeon_update_bandwidth_info(rdev); |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 7e81db5eb804..19a7ef7ee344 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -481,6 +481,7 @@ void r300_mc_init(struct radeon_device *rdev) | |||
481 | if (rdev->flags & RADEON_IS_IGP) | 481 | if (rdev->flags & RADEON_IS_IGP) |
482 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; | 482 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; |
483 | radeon_vram_location(rdev, &rdev->mc, base); | 483 | radeon_vram_location(rdev, &rdev->mc, base); |
484 | rdev->mc.gtt_base_align = 0; | ||
484 | if (!(rdev->flags & RADEON_IS_AGP)) | 485 | if (!(rdev->flags & RADEON_IS_AGP)) |
485 | radeon_gtt_location(rdev, &rdev->mc); | 486 | radeon_gtt_location(rdev, &rdev->mc); |
486 | radeon_update_bandwidth_info(rdev); | 487 | radeon_update_bandwidth_info(rdev); |
@@ -1176,6 +1177,8 @@ int r300_cs_parse(struct radeon_cs_parser *p) | |||
1176 | int r; | 1177 | int r; |
1177 | 1178 | ||
1178 | track = kzalloc(sizeof(*track), GFP_KERNEL); | 1179 | track = kzalloc(sizeof(*track), GFP_KERNEL); |
1180 | if (track == NULL) | ||
1181 | return -ENOMEM; | ||
1179 | r100_cs_track_clear(p->rdev, track); | 1182 | r100_cs_track_clear(p->rdev, track); |
1180 | p->track = track; | 1183 | p->track = track; |
1181 | do { | 1184 | do { |
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index 34330df28483..694af7cc23ac 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
@@ -125,6 +125,7 @@ void r520_mc_init(struct radeon_device *rdev) | |||
125 | r520_vram_get_type(rdev); | 125 | r520_vram_get_type(rdev); |
126 | r100_vram_init_sizes(rdev); | 126 | r100_vram_init_sizes(rdev); |
127 | radeon_vram_location(rdev, &rdev->mc, 0); | 127 | radeon_vram_location(rdev, &rdev->mc, 0); |
128 | rdev->mc.gtt_base_align = 0; | ||
128 | if (!(rdev->flags & RADEON_IS_AGP)) | 129 | if (!(rdev->flags & RADEON_IS_AGP)) |
129 | radeon_gtt_location(rdev, &rdev->mc); | 130 | radeon_gtt_location(rdev, &rdev->mc); |
130 | radeon_update_bandwidth_info(rdev); | 131 | radeon_update_bandwidth_info(rdev); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 3d6645ce2151..e100f69faeec 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1179,6 +1179,7 @@ void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
1179 | if (rdev->flags & RADEON_IS_IGP) | 1179 | if (rdev->flags & RADEON_IS_IGP) |
1180 | base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24; | 1180 | base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24; |
1181 | radeon_vram_location(rdev, &rdev->mc, base); | 1181 | radeon_vram_location(rdev, &rdev->mc, base); |
1182 | rdev->mc.gtt_base_align = 0; | ||
1182 | radeon_gtt_location(rdev, mc); | 1183 | radeon_gtt_location(rdev, mc); |
1183 | } | 1184 | } |
1184 | } | 1185 | } |
diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c index f4fb88ece2bb..ca5c29f70779 100644 --- a/drivers/gpu/drm/radeon/r600_blit.c +++ b/drivers/gpu/drm/radeon/r600_blit.c | |||
@@ -538,9 +538,12 @@ int | |||
538 | r600_prepare_blit_copy(struct drm_device *dev, struct drm_file *file_priv) | 538 | r600_prepare_blit_copy(struct drm_device *dev, struct drm_file *file_priv) |
539 | { | 539 | { |
540 | drm_radeon_private_t *dev_priv = dev->dev_private; | 540 | drm_radeon_private_t *dev_priv = dev->dev_private; |
541 | int ret; | ||
541 | DRM_DEBUG("\n"); | 542 | DRM_DEBUG("\n"); |
542 | 543 | ||
543 | r600_nomm_get_vb(dev); | 544 | ret = r600_nomm_get_vb(dev); |
545 | if (ret) | ||
546 | return ret; | ||
544 | 547 | ||
545 | dev_priv->blit_vb->file_priv = file_priv; | 548 | dev_priv->blit_vb->file_priv = file_priv; |
546 | 549 | ||
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index c39c1bc13016..144c32d37136 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
@@ -585,7 +585,7 @@ static int r600_cs_packet_parse_vline(struct radeon_cs_parser *p) | |||
585 | header = radeon_get_ib_value(p, h_idx); | 585 | header = radeon_get_ib_value(p, h_idx); |
586 | crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1); | 586 | crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1); |
587 | reg = CP_PACKET0_GET_REG(header); | 587 | reg = CP_PACKET0_GET_REG(header); |
588 | mutex_lock(&p->rdev->ddev->mode_config.mutex); | 588 | |
589 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); | 589 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); |
590 | if (!obj) { | 590 | if (!obj) { |
591 | DRM_ERROR("cannot find crtc %d\n", crtc_id); | 591 | DRM_ERROR("cannot find crtc %d\n", crtc_id); |
@@ -620,7 +620,6 @@ static int r600_cs_packet_parse_vline(struct radeon_cs_parser *p) | |||
620 | ib[h_idx + 4] = AVIVO_D2MODE_VLINE_STATUS >> 2; | 620 | ib[h_idx + 4] = AVIVO_D2MODE_VLINE_STATUS >> 2; |
621 | } | 621 | } |
622 | out: | 622 | out: |
623 | mutex_unlock(&p->rdev->ddev->mode_config.mutex); | ||
624 | return r; | 623 | return r; |
625 | } | 624 | } |
626 | 625 | ||
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index ab61aaa887bb..2f94dc66c183 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -351,6 +351,7 @@ struct radeon_mc { | |||
351 | int vram_mtrr; | 351 | int vram_mtrr; |
352 | bool vram_is_ddr; | 352 | bool vram_is_ddr; |
353 | bool igp_sideport_enabled; | 353 | bool igp_sideport_enabled; |
354 | u64 gtt_base_align; | ||
354 | }; | 355 | }; |
355 | 356 | ||
356 | bool radeon_combios_sideport_present(struct radeon_device *rdev); | 357 | bool radeon_combios_sideport_present(struct radeon_device *rdev); |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 99bd8a9c56b3..10673ae59cfa 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -280,6 +280,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, | |||
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | /* ASUS HD 3600 board lists the DVI port as HDMI */ | ||
284 | if ((dev->pdev->device == 0x9598) && | ||
285 | (dev->pdev->subsystem_vendor == 0x1043) && | ||
286 | (dev->pdev->subsystem_device == 0x01e4)) { | ||
287 | if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) { | ||
288 | *connector_type = DRM_MODE_CONNECTOR_DVII; | ||
289 | } | ||
290 | } | ||
291 | |||
283 | /* ASUS HD 3450 board lists the DVI port as HDMI */ | 292 | /* ASUS HD 3450 board lists the DVI port as HDMI */ |
284 | if ((dev->pdev->device == 0x95C5) && | 293 | if ((dev->pdev->device == 0x95C5) && |
285 | (dev->pdev->subsystem_vendor == 0x1043) && | 294 | (dev->pdev->subsystem_vendor == 0x1043) && |
@@ -1029,8 +1038,15 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev) | |||
1029 | data_offset); | 1038 | data_offset); |
1030 | switch (crev) { | 1039 | switch (crev) { |
1031 | case 1: | 1040 | case 1: |
1032 | if (igp_info->info.ucMemoryType & 0xf0) | 1041 | /* AMD IGPS */ |
1033 | return true; | 1042 | if ((rdev->family == CHIP_RS690) || |
1043 | (rdev->family == CHIP_RS740)) { | ||
1044 | if (igp_info->info.ulBootUpMemoryClock) | ||
1045 | return true; | ||
1046 | } else { | ||
1047 | if (igp_info->info.ucMemoryType & 0xf0) | ||
1048 | return true; | ||
1049 | } | ||
1034 | break; | 1050 | break; |
1035 | case 2: | 1051 | case 2: |
1036 | if (igp_info->info_2.ucMemoryType & 0x0f) | 1052 | if (igp_info->info_2.ucMemoryType & 0x0f) |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index d1c1d8dd93ce..2417d7b06fdb 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -3050,6 +3050,14 @@ void radeon_combios_asic_init(struct drm_device *dev) | |||
3050 | rdev->pdev->subsystem_device == 0x308b) | 3050 | rdev->pdev->subsystem_device == 0x308b) |
3051 | return; | 3051 | return; |
3052 | 3052 | ||
3053 | /* quirk for rs4xx HP dv5000 laptop to make it resume | ||
3054 | * - it hangs on resume inside the dynclk 1 table. | ||
3055 | */ | ||
3056 | if (rdev->family == CHIP_RS480 && | ||
3057 | rdev->pdev->subsystem_vendor == 0x103c && | ||
3058 | rdev->pdev->subsystem_device == 0x30a4) | ||
3059 | return; | ||
3060 | |||
3053 | /* DYN CLK 1 */ | 3061 | /* DYN CLK 1 */ |
3054 | table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE); | 3062 | table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE); |
3055 | if (table) | 3063 | if (table) |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 0c7ccc6961a3..adccbc2c202c 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -771,30 +771,27 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect | |||
771 | } else | 771 | } else |
772 | ret = connector_status_connected; | 772 | ret = connector_status_connected; |
773 | 773 | ||
774 | /* multiple connectors on the same encoder with the same ddc line | 774 | /* This gets complicated. We have boards with VGA + HDMI with a |
775 | * This tends to be HDMI and DVI on the same encoder with the | 775 | * shared DDC line and we have boards with DVI-D + HDMI with a shared |
776 | * same ddc line. If the edid says HDMI, consider the HDMI port | 776 | * DDC line. The latter is more complex because with DVI<->HDMI adapters |
777 | * connected and the DVI port disconnected. If the edid doesn't | 777 | * you don't really know what's connected to which port as both are digital. |
778 | * say HDMI, vice versa. | ||
779 | */ | 778 | */ |
780 | if (radeon_connector->shared_ddc && (ret == connector_status_connected)) { | 779 | if (radeon_connector->shared_ddc && (ret == connector_status_connected)) { |
781 | struct drm_device *dev = connector->dev; | 780 | struct drm_device *dev = connector->dev; |
781 | struct radeon_device *rdev = dev->dev_private; | ||
782 | struct drm_connector *list_connector; | 782 | struct drm_connector *list_connector; |
783 | struct radeon_connector *list_radeon_connector; | 783 | struct radeon_connector *list_radeon_connector; |
784 | list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { | 784 | list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { |
785 | if (connector == list_connector) | 785 | if (connector == list_connector) |
786 | continue; | 786 | continue; |
787 | list_radeon_connector = to_radeon_connector(list_connector); | 787 | list_radeon_connector = to_radeon_connector(list_connector); |
788 | if (radeon_connector->devices == list_radeon_connector->devices) { | 788 | if (list_radeon_connector->shared_ddc && |
789 | if (drm_detect_hdmi_monitor(radeon_connector->edid)) { | 789 | (list_radeon_connector->ddc_bus->rec.i2c_id == |
790 | if (connector->connector_type == DRM_MODE_CONNECTOR_DVID) { | 790 | radeon_connector->ddc_bus->rec.i2c_id)) { |
791 | kfree(radeon_connector->edid); | 791 | /* cases where both connectors are digital */ |
792 | radeon_connector->edid = NULL; | 792 | if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) { |
793 | ret = connector_status_disconnected; | 793 | /* hpd is our only option in this case */ |
794 | } | 794 | if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { |
795 | } else { | ||
796 | if ((connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) || | ||
797 | (connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)) { | ||
798 | kfree(radeon_connector->edid); | 795 | kfree(radeon_connector->edid); |
799 | radeon_connector->edid = NULL; | 796 | radeon_connector->edid = NULL; |
800 | ret = connector_status_disconnected; | 797 | ret = connector_status_disconnected; |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 5f317317aba2..dd279da90546 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -226,20 +226,20 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
226 | { | 226 | { |
227 | u64 size_af, size_bf; | 227 | u64 size_af, size_bf; |
228 | 228 | ||
229 | size_af = 0xFFFFFFFF - mc->vram_end; | 229 | size_af = ((0xFFFFFFFF - mc->vram_end) + mc->gtt_base_align) & ~mc->gtt_base_align; |
230 | size_bf = mc->vram_start; | 230 | size_bf = mc->vram_start & ~mc->gtt_base_align; |
231 | if (size_bf > size_af) { | 231 | if (size_bf > size_af) { |
232 | if (mc->gtt_size > size_bf) { | 232 | if (mc->gtt_size > size_bf) { |
233 | dev_warn(rdev->dev, "limiting GTT\n"); | 233 | dev_warn(rdev->dev, "limiting GTT\n"); |
234 | mc->gtt_size = size_bf; | 234 | mc->gtt_size = size_bf; |
235 | } | 235 | } |
236 | mc->gtt_start = mc->vram_start - mc->gtt_size; | 236 | mc->gtt_start = (mc->vram_start & ~mc->gtt_base_align) - mc->gtt_size; |
237 | } else { | 237 | } else { |
238 | if (mc->gtt_size > size_af) { | 238 | if (mc->gtt_size > size_af) { |
239 | dev_warn(rdev->dev, "limiting GTT\n"); | 239 | dev_warn(rdev->dev, "limiting GTT\n"); |
240 | mc->gtt_size = size_af; | 240 | mc->gtt_size = size_af; |
241 | } | 241 | } |
242 | mc->gtt_start = mc->vram_end + 1; | 242 | mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align; |
243 | } | 243 | } |
244 | mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; | 244 | mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; |
245 | dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n", | 245 | dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n", |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 6a70c0dc7f92..ab389f89fa8d 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -128,7 +128,8 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
128 | for (i = 0, found = 0; i < rdev->num_crtc; i++) { | 128 | for (i = 0, found = 0; i < rdev->num_crtc; i++) { |
129 | crtc = (struct drm_crtc *)minfo->crtcs[i]; | 129 | crtc = (struct drm_crtc *)minfo->crtcs[i]; |
130 | if (crtc && crtc->base.id == value) { | 130 | if (crtc && crtc->base.id == value) { |
131 | value = i; | 131 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
132 | value = radeon_crtc->crtc_id; | ||
132 | found = 1; | 133 | found = 1; |
133 | break; | 134 | break; |
134 | } | 135 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index bad77f40a9da..5688a0cf6bbe 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
@@ -108,6 +108,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
108 | udelay(panel_pwr_delay * 1000); | 108 | udelay(panel_pwr_delay * 1000); |
109 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); | 109 | WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); |
110 | WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl); | 110 | WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl); |
111 | udelay(panel_pwr_delay * 1000); | ||
111 | break; | 112 | break; |
112 | } | 113 | } |
113 | 114 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c b/drivers/gpu/drm/radeon/radeon_legacy_tv.c index f2ed27c8055b..032040397743 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c | |||
@@ -642,8 +642,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder, | |||
642 | } | 642 | } |
643 | flicker_removal = (tmp + 500) / 1000; | 643 | flicker_removal = (tmp + 500) / 1000; |
644 | 644 | ||
645 | if (flicker_removal < 2) | 645 | if (flicker_removal < 3) |
646 | flicker_removal = 2; | 646 | flicker_removal = 3; |
647 | for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) { | 647 | for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) { |
648 | if (flicker_removal == SLOPE_limit[i]) | 648 | if (flicker_removal == SLOPE_limit[i]) |
649 | break; | 649 | break; |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 115d26b762cc..3fa6984d9896 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -333,6 +333,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev, | |||
333 | return snprintf(buf, PAGE_SIZE, "%s\n", | 333 | return snprintf(buf, PAGE_SIZE, "%s\n", |
334 | (cp == PM_PROFILE_AUTO) ? "auto" : | 334 | (cp == PM_PROFILE_AUTO) ? "auto" : |
335 | (cp == PM_PROFILE_LOW) ? "low" : | 335 | (cp == PM_PROFILE_LOW) ? "low" : |
336 | (cp == PM_PROFILE_MID) ? "mid" : | ||
336 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); | 337 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); |
337 | } | 338 | } |
338 | 339 | ||
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 9e4240b3bf0b..f454c9a5e7f2 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
@@ -57,7 +57,9 @@ void rs400_gart_adjust_size(struct radeon_device *rdev) | |||
57 | } | 57 | } |
58 | if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) { | 58 | if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) { |
59 | /* FIXME: RS400 & RS480 seems to have issue with GART size | 59 | /* FIXME: RS400 & RS480 seems to have issue with GART size |
60 | * if 4G of system memory (needs more testing) */ | 60 | * if 4G of system memory (needs more testing) |
61 | */ | ||
62 | /* XXX is this still an issue with proper alignment? */ | ||
61 | rdev->mc.gtt_size = 32 * 1024 * 1024; | 63 | rdev->mc.gtt_size = 32 * 1024 * 1024; |
62 | DRM_ERROR("Forcing to 32M GART size (because of ASIC bug ?)\n"); | 64 | DRM_ERROR("Forcing to 32M GART size (because of ASIC bug ?)\n"); |
63 | } | 65 | } |
@@ -263,6 +265,7 @@ void rs400_mc_init(struct radeon_device *rdev) | |||
263 | r100_vram_init_sizes(rdev); | 265 | r100_vram_init_sizes(rdev); |
264 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; | 266 | base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; |
265 | radeon_vram_location(rdev, &rdev->mc, base); | 267 | radeon_vram_location(rdev, &rdev->mc, base); |
268 | rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1; | ||
266 | radeon_gtt_location(rdev, &rdev->mc); | 269 | radeon_gtt_location(rdev, &rdev->mc); |
267 | radeon_update_bandwidth_info(rdev); | 270 | radeon_update_bandwidth_info(rdev); |
268 | } | 271 | } |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 7bb4c3e52f3b..6dc15ea8ba33 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -698,6 +698,7 @@ void rs600_mc_init(struct radeon_device *rdev) | |||
698 | base = G_000004_MC_FB_START(base) << 16; | 698 | base = G_000004_MC_FB_START(base) << 16; |
699 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 699 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
700 | radeon_vram_location(rdev, &rdev->mc, base); | 700 | radeon_vram_location(rdev, &rdev->mc, base); |
701 | rdev->mc.gtt_base_align = 0; | ||
701 | radeon_gtt_location(rdev, &rdev->mc); | 702 | radeon_gtt_location(rdev, &rdev->mc); |
702 | radeon_update_bandwidth_info(rdev); | 703 | radeon_update_bandwidth_info(rdev); |
703 | } | 704 | } |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index f4f0a61bcdce..ce4ecbe10816 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
@@ -162,6 +162,7 @@ void rs690_mc_init(struct radeon_device *rdev) | |||
162 | rs690_pm_info(rdev); | 162 | rs690_pm_info(rdev); |
163 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 163 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
164 | radeon_vram_location(rdev, &rdev->mc, base); | 164 | radeon_vram_location(rdev, &rdev->mc, base); |
165 | rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1; | ||
165 | radeon_gtt_location(rdev, &rdev->mc); | 166 | radeon_gtt_location(rdev, &rdev->mc); |
166 | radeon_update_bandwidth_info(rdev); | 167 | radeon_update_bandwidth_info(rdev); |
167 | } | 168 | } |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 7d9a7b0a180a..0c9c169a6852 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -195,6 +195,7 @@ void rv515_mc_init(struct radeon_device *rdev) | |||
195 | rv515_vram_get_type(rdev); | 195 | rv515_vram_get_type(rdev); |
196 | r100_vram_init_sizes(rdev); | 196 | r100_vram_init_sizes(rdev); |
197 | radeon_vram_location(rdev, &rdev->mc, 0); | 197 | radeon_vram_location(rdev, &rdev->mc, 0); |
198 | rdev->mc.gtt_base_align = 0; | ||
198 | if (!(rdev->flags & RADEON_IS_AGP)) | 199 | if (!(rdev->flags & RADEON_IS_AGP)) |
199 | radeon_gtt_location(rdev, &rdev->mc); | 200 | radeon_gtt_location(rdev, &rdev->mc); |
200 | radeon_update_bandwidth_info(rdev); | 201 | radeon_update_bandwidth_info(rdev); |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 2f047577b1e3..ca904799f018 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
@@ -40,11 +40,13 @@ | |||
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | 41 | ||
42 | #include <asm/atomic.h> | 42 | #include <asm/atomic.h> |
43 | #include <asm/agp.h> | ||
44 | 43 | ||
45 | #include "ttm/ttm_bo_driver.h" | 44 | #include "ttm/ttm_bo_driver.h" |
46 | #include "ttm/ttm_page_alloc.h" | 45 | #include "ttm/ttm_page_alloc.h" |
47 | 46 | ||
47 | #ifdef TTM_HAS_AGP | ||
48 | #include <asm/agp.h> | ||
49 | #endif | ||
48 | 50 | ||
49 | #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(struct page *)) | 51 | #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(struct page *)) |
50 | #define SMALL_ALLOCATION 16 | 52 | #define SMALL_ALLOCATION 16 |
@@ -104,7 +106,6 @@ struct ttm_pool_opts { | |||
104 | struct ttm_pool_manager { | 106 | struct ttm_pool_manager { |
105 | struct kobject kobj; | 107 | struct kobject kobj; |
106 | struct shrinker mm_shrink; | 108 | struct shrinker mm_shrink; |
107 | atomic_t page_alloc_inited; | ||
108 | struct ttm_pool_opts options; | 109 | struct ttm_pool_opts options; |
109 | 110 | ||
110 | union { | 111 | union { |
@@ -142,7 +143,7 @@ static void ttm_pool_kobj_release(struct kobject *kobj) | |||
142 | { | 143 | { |
143 | struct ttm_pool_manager *m = | 144 | struct ttm_pool_manager *m = |
144 | container_of(kobj, struct ttm_pool_manager, kobj); | 145 | container_of(kobj, struct ttm_pool_manager, kobj); |
145 | (void)m; | 146 | kfree(m); |
146 | } | 147 | } |
147 | 148 | ||
148 | static ssize_t ttm_pool_store(struct kobject *kobj, | 149 | static ssize_t ttm_pool_store(struct kobject *kobj, |
@@ -214,9 +215,7 @@ static struct kobj_type ttm_pool_kobj_type = { | |||
214 | .default_attrs = ttm_pool_attrs, | 215 | .default_attrs = ttm_pool_attrs, |
215 | }; | 216 | }; |
216 | 217 | ||
217 | static struct ttm_pool_manager _manager = { | 218 | static struct ttm_pool_manager *_manager; |
218 | .page_alloc_inited = ATOMIC_INIT(0) | ||
219 | }; | ||
220 | 219 | ||
221 | #ifndef CONFIG_X86 | 220 | #ifndef CONFIG_X86 |
222 | static int set_pages_array_wb(struct page **pages, int addrinarray) | 221 | static int set_pages_array_wb(struct page **pages, int addrinarray) |
@@ -271,7 +270,7 @@ static struct ttm_page_pool *ttm_get_pool(int flags, | |||
271 | if (flags & TTM_PAGE_FLAG_DMA32) | 270 | if (flags & TTM_PAGE_FLAG_DMA32) |
272 | pool_index |= 0x2; | 271 | pool_index |= 0x2; |
273 | 272 | ||
274 | return &_manager.pools[pool_index]; | 273 | return &_manager->pools[pool_index]; |
275 | } | 274 | } |
276 | 275 | ||
277 | /* set memory back to wb and free the pages. */ | 276 | /* set memory back to wb and free the pages. */ |
@@ -387,7 +386,7 @@ static int ttm_pool_get_num_unused_pages(void) | |||
387 | unsigned i; | 386 | unsigned i; |
388 | int total = 0; | 387 | int total = 0; |
389 | for (i = 0; i < NUM_POOLS; ++i) | 388 | for (i = 0; i < NUM_POOLS; ++i) |
390 | total += _manager.pools[i].npages; | 389 | total += _manager->pools[i].npages; |
391 | 390 | ||
392 | return total; | 391 | return total; |
393 | } | 392 | } |
@@ -395,7 +394,7 @@ static int ttm_pool_get_num_unused_pages(void) | |||
395 | /** | 394 | /** |
396 | * Callback for mm to request pool to reduce number of page held. | 395 | * Callback for mm to request pool to reduce number of page held. |
397 | */ | 396 | */ |
398 | static int ttm_pool_mm_shrink(int shrink_pages, gfp_t gfp_mask) | 397 | static int ttm_pool_mm_shrink(struct shrinker *shrink, int shrink_pages, gfp_t gfp_mask) |
399 | { | 398 | { |
400 | static atomic_t start_pool = ATOMIC_INIT(0); | 399 | static atomic_t start_pool = ATOMIC_INIT(0); |
401 | unsigned i; | 400 | unsigned i; |
@@ -408,7 +407,7 @@ static int ttm_pool_mm_shrink(int shrink_pages, gfp_t gfp_mask) | |||
408 | unsigned nr_free = shrink_pages; | 407 | unsigned nr_free = shrink_pages; |
409 | if (shrink_pages == 0) | 408 | if (shrink_pages == 0) |
410 | break; | 409 | break; |
411 | pool = &_manager.pools[(i + pool_offset)%NUM_POOLS]; | 410 | pool = &_manager->pools[(i + pool_offset)%NUM_POOLS]; |
412 | shrink_pages = ttm_page_pool_free(pool, nr_free); | 411 | shrink_pages = ttm_page_pool_free(pool, nr_free); |
413 | } | 412 | } |
414 | /* return estimated number of unused pages in pool */ | 413 | /* return estimated number of unused pages in pool */ |
@@ -576,10 +575,10 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool, | |||
576 | 575 | ||
577 | /* If allocation request is small and there is not enough | 576 | /* If allocation request is small and there is not enough |
578 | * pages in pool we fill the pool first */ | 577 | * pages in pool we fill the pool first */ |
579 | if (count < _manager.options.small | 578 | if (count < _manager->options.small |
580 | && count > pool->npages) { | 579 | && count > pool->npages) { |
581 | struct list_head new_pages; | 580 | struct list_head new_pages; |
582 | unsigned alloc_size = _manager.options.alloc_size; | 581 | unsigned alloc_size = _manager->options.alloc_size; |
583 | 582 | ||
584 | /** | 583 | /** |
585 | * Can't change page caching if in irqsave context. We have to | 584 | * Can't change page caching if in irqsave context. We have to |
@@ -759,8 +758,8 @@ void ttm_put_pages(struct list_head *pages, unsigned page_count, int flags, | |||
759 | pool->npages += page_count; | 758 | pool->npages += page_count; |
760 | /* Check that we don't go over the pool limit */ | 759 | /* Check that we don't go over the pool limit */ |
761 | page_count = 0; | 760 | page_count = 0; |
762 | if (pool->npages > _manager.options.max_size) { | 761 | if (pool->npages > _manager->options.max_size) { |
763 | page_count = pool->npages - _manager.options.max_size; | 762 | page_count = pool->npages - _manager->options.max_size; |
764 | /* free at least NUM_PAGES_TO_ALLOC number of pages | 763 | /* free at least NUM_PAGES_TO_ALLOC number of pages |
765 | * to reduce calls to set_memory_wb */ | 764 | * to reduce calls to set_memory_wb */ |
766 | if (page_count < NUM_PAGES_TO_ALLOC) | 765 | if (page_count < NUM_PAGES_TO_ALLOC) |
@@ -785,33 +784,36 @@ static void ttm_page_pool_init_locked(struct ttm_page_pool *pool, int flags, | |||
785 | int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) | 784 | int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) |
786 | { | 785 | { |
787 | int ret; | 786 | int ret; |
788 | if (atomic_add_return(1, &_manager.page_alloc_inited) > 1) | 787 | |
789 | return 0; | 788 | WARN_ON(_manager); |
790 | 789 | ||
791 | printk(KERN_INFO TTM_PFX "Initializing pool allocator.\n"); | 790 | printk(KERN_INFO TTM_PFX "Initializing pool allocator.\n"); |
792 | 791 | ||
793 | ttm_page_pool_init_locked(&_manager.wc_pool, GFP_HIGHUSER, "wc"); | 792 | _manager = kzalloc(sizeof(*_manager), GFP_KERNEL); |
793 | |||
794 | ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, "wc"); | ||
794 | 795 | ||
795 | ttm_page_pool_init_locked(&_manager.uc_pool, GFP_HIGHUSER, "uc"); | 796 | ttm_page_pool_init_locked(&_manager->uc_pool, GFP_HIGHUSER, "uc"); |
796 | 797 | ||
797 | ttm_page_pool_init_locked(&_manager.wc_pool_dma32, GFP_USER | GFP_DMA32, | 798 | ttm_page_pool_init_locked(&_manager->wc_pool_dma32, |
798 | "wc dma"); | 799 | GFP_USER | GFP_DMA32, "wc dma"); |
799 | 800 | ||
800 | ttm_page_pool_init_locked(&_manager.uc_pool_dma32, GFP_USER | GFP_DMA32, | 801 | ttm_page_pool_init_locked(&_manager->uc_pool_dma32, |
801 | "uc dma"); | 802 | GFP_USER | GFP_DMA32, "uc dma"); |
802 | 803 | ||
803 | _manager.options.max_size = max_pages; | 804 | _manager->options.max_size = max_pages; |
804 | _manager.options.small = SMALL_ALLOCATION; | 805 | _manager->options.small = SMALL_ALLOCATION; |
805 | _manager.options.alloc_size = NUM_PAGES_TO_ALLOC; | 806 | _manager->options.alloc_size = NUM_PAGES_TO_ALLOC; |
806 | 807 | ||
807 | kobject_init(&_manager.kobj, &ttm_pool_kobj_type); | 808 | ret = kobject_init_and_add(&_manager->kobj, &ttm_pool_kobj_type, |
808 | ret = kobject_add(&_manager.kobj, &glob->kobj, "pool"); | 809 | &glob->kobj, "pool"); |
809 | if (unlikely(ret != 0)) { | 810 | if (unlikely(ret != 0)) { |
810 | kobject_put(&_manager.kobj); | 811 | kobject_put(&_manager->kobj); |
812 | _manager = NULL; | ||
811 | return ret; | 813 | return ret; |
812 | } | 814 | } |
813 | 815 | ||
814 | ttm_pool_mm_shrink_init(&_manager); | 816 | ttm_pool_mm_shrink_init(_manager); |
815 | 817 | ||
816 | return 0; | 818 | return 0; |
817 | } | 819 | } |
@@ -820,16 +822,14 @@ void ttm_page_alloc_fini() | |||
820 | { | 822 | { |
821 | int i; | 823 | int i; |
822 | 824 | ||
823 | if (atomic_sub_return(1, &_manager.page_alloc_inited) > 0) | ||
824 | return; | ||
825 | |||
826 | printk(KERN_INFO TTM_PFX "Finalizing pool allocator.\n"); | 825 | printk(KERN_INFO TTM_PFX "Finalizing pool allocator.\n"); |
827 | ttm_pool_mm_shrink_fini(&_manager); | 826 | ttm_pool_mm_shrink_fini(_manager); |
828 | 827 | ||
829 | for (i = 0; i < NUM_POOLS; ++i) | 828 | for (i = 0; i < NUM_POOLS; ++i) |
830 | ttm_page_pool_free(&_manager.pools[i], FREE_ALL_PAGES); | 829 | ttm_page_pool_free(&_manager->pools[i], FREE_ALL_PAGES); |
831 | 830 | ||
832 | kobject_put(&_manager.kobj); | 831 | kobject_put(&_manager->kobj); |
832 | _manager = NULL; | ||
833 | } | 833 | } |
834 | 834 | ||
835 | int ttm_page_alloc_debugfs(struct seq_file *m, void *data) | 835 | int ttm_page_alloc_debugfs(struct seq_file *m, void *data) |
@@ -837,14 +837,14 @@ int ttm_page_alloc_debugfs(struct seq_file *m, void *data) | |||
837 | struct ttm_page_pool *p; | 837 | struct ttm_page_pool *p; |
838 | unsigned i; | 838 | unsigned i; |
839 | char *h[] = {"pool", "refills", "pages freed", "size"}; | 839 | char *h[] = {"pool", "refills", "pages freed", "size"}; |
840 | if (atomic_read(&_manager.page_alloc_inited) == 0) { | 840 | if (!_manager) { |
841 | seq_printf(m, "No pool allocator running.\n"); | 841 | seq_printf(m, "No pool allocator running.\n"); |
842 | return 0; | 842 | return 0; |
843 | } | 843 | } |
844 | seq_printf(m, "%6s %12s %13s %8s\n", | 844 | seq_printf(m, "%6s %12s %13s %8s\n", |
845 | h[0], h[1], h[2], h[3]); | 845 | h[0], h[1], h[2], h[3]); |
846 | for (i = 0; i < NUM_POOLS; ++i) { | 846 | for (i = 0; i < NUM_POOLS; ++i) { |
847 | p = &_manager.pools[i]; | 847 | p = &_manager->pools[i]; |
848 | 848 | ||
849 | seq_printf(m, "%6s %12ld %13ld %8d\n", | 849 | seq_printf(m, "%6s %12ld %13ld %8d\n", |
850 | p->name, p->nrefills, | 850 | p->name, p->nrefills, |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index f1d626112415..437ac786277a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -972,6 +972,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, | |||
972 | ret = copy_from_user(rects, user_rects, rects_size); | 972 | ret = copy_from_user(rects, user_rects, rects_size); |
973 | if (unlikely(ret != 0)) { | 973 | if (unlikely(ret != 0)) { |
974 | DRM_ERROR("Failed to get rects.\n"); | 974 | DRM_ERROR("Failed to get rects.\n"); |
975 | ret = -EFAULT; | ||
975 | goto out_free; | 976 | goto out_free; |
976 | } | 977 | } |
977 | 978 | ||
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 132278fa6240..434099369058 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -358,6 +358,7 @@ config HID_ROCCAT | |||
358 | config HID_ROCCAT_KONE | 358 | config HID_ROCCAT_KONE |
359 | tristate "Roccat Kone Mouse support" | 359 | tristate "Roccat Kone Mouse support" |
360 | depends on USB_HID | 360 | depends on USB_HID |
361 | select HID_ROCCAT | ||
361 | ---help--- | 362 | ---help--- |
362 | Support for Roccat Kone mouse. | 363 | Support for Roccat Kone mouse. |
363 | 364 | ||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index aa0f7dcabcd7..866e54ec5fb2 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1337,6 +1337,24 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1337 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, | 1337 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, |
1338 | { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, | 1338 | { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, |
1339 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, | 1339 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, |
1340 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1) }, | ||
1341 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_2) }, | ||
1342 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_3) }, | ||
1343 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_4) }, | ||
1344 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_5) }, | ||
1345 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_6) }, | ||
1346 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_7) }, | ||
1347 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_8) }, | ||
1348 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_9) }, | ||
1349 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_10) }, | ||
1350 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_11) }, | ||
1351 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_12) }, | ||
1352 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_13) }, | ||
1353 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_14) }, | ||
1354 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_15) }, | ||
1355 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16) }, | ||
1356 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17) }, | ||
1357 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) }, | ||
1340 | { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, | 1358 | { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, |
1341 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, | 1359 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, |
1342 | { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) }, | 1360 | { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) }, |
@@ -1760,7 +1778,8 @@ int hid_add_device(struct hid_device *hdev) | |||
1760 | 1778 | ||
1761 | /* we need to kill them here, otherwise they will stay allocated to | 1779 | /* we need to kill them here, otherwise they will stay allocated to |
1762 | * wait for coming driver */ | 1780 | * wait for coming driver */ |
1763 | if (!(hdev->quirks & HID_QUIRK_NO_IGNORE) && hid_ignore(hdev)) | 1781 | if (!(hdev->quirks & HID_QUIRK_NO_IGNORE) |
1782 | && (hid_ignore(hdev) || (hdev->quirks & HID_QUIRK_IGNORE))) | ||
1764 | return -ENODEV; | 1783 | return -ENODEV; |
1765 | 1784 | ||
1766 | /* XXX hack, any other cleaner solution after the driver core | 1785 | /* XXX hack, any other cleaner solution after the driver core |
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index c94026768570..850d02a7a925 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -949,8 +949,8 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer, | |||
949 | int ret = 0, len; | 949 | int ret = 0, len; |
950 | DECLARE_WAITQUEUE(wait, current); | 950 | DECLARE_WAITQUEUE(wait, current); |
951 | 951 | ||
952 | mutex_lock(&list->read_mutex); | ||
952 | while (ret == 0) { | 953 | while (ret == 0) { |
953 | mutex_lock(&list->read_mutex); | ||
954 | if (list->head == list->tail) { | 954 | if (list->head == list->tail) { |
955 | add_wait_queue(&list->hdev->debug_wait, &wait); | 955 | add_wait_queue(&list->hdev->debug_wait, &wait); |
956 | set_current_state(TASK_INTERRUPTIBLE); | 956 | set_current_state(TASK_INTERRUPTIBLE); |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 6af77ed0b555..31601eef25dd 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -134,6 +134,7 @@ | |||
134 | #define USB_VENDOR_ID_CH 0x068e | 134 | #define USB_VENDOR_ID_CH 0x068e |
135 | #define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 | 135 | #define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 |
136 | #define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4 | 136 | #define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4 |
137 | #define USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE 0x0051 | ||
137 | #define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff | 138 | #define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff |
138 | #define USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK 0x00d3 | 139 | #define USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK 0x00d3 |
139 | 140 | ||
@@ -369,6 +370,8 @@ | |||
369 | #define USB_DEVICE_ID_MS_PRESENTER_8K_BT 0x0701 | 370 | #define USB_DEVICE_ID_MS_PRESENTER_8K_BT 0x0701 |
370 | #define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713 | 371 | #define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713 |
371 | 372 | ||
373 | #define USB_VENDOR_ID_MOJO 0x8282 | ||
374 | #define USB_DEVICE_ID_RETRO_ADAPTER 0x3201 | ||
372 | 375 | ||
373 | #define USB_VENDOR_ID_MONTEREY 0x0566 | 376 | #define USB_VENDOR_ID_MONTEREY 0x0566 |
374 | #define USB_DEVICE_ID_GENIUS_KB29E 0x3004 | 377 | #define USB_DEVICE_ID_GENIUS_KB29E 0x3004 |
@@ -391,6 +394,24 @@ | |||
391 | 394 | ||
392 | #define USB_VENDOR_ID_NTRIG 0x1b96 | 395 | #define USB_VENDOR_ID_NTRIG 0x1b96 |
393 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001 | 396 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001 |
397 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1 0x0003 | ||
398 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_2 0x0004 | ||
399 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_3 0x0005 | ||
400 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_4 0x0006 | ||
401 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_5 0x0007 | ||
402 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_6 0x0008 | ||
403 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_7 0x0009 | ||
404 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_8 0x000A | ||
405 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_9 0x000B | ||
406 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_10 0x000C | ||
407 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_11 0x000D | ||
408 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_12 0x000E | ||
409 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_13 0x000F | ||
410 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_14 0x0010 | ||
411 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_15 0x0011 | ||
412 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16 0x0012 | ||
413 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17 0x0013 | ||
414 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18 0x0014 | ||
394 | 415 | ||
395 | #define USB_VENDOR_ID_ONTRAK 0x0a07 | 416 | #define USB_VENDOR_ID_ONTRAK 0x0a07 |
396 | #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064 | 417 | #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064 |
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index b6b0caeeac58..fb69b8c4953f 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c | |||
@@ -868,6 +868,42 @@ static void ntrig_remove(struct hid_device *hdev) | |||
868 | static const struct hid_device_id ntrig_devices[] = { | 868 | static const struct hid_device_id ntrig_devices[] = { |
869 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN), | 869 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN), |
870 | .driver_data = NTRIG_DUPLICATE_USAGES }, | 870 | .driver_data = NTRIG_DUPLICATE_USAGES }, |
871 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1), | ||
872 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
873 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_2), | ||
874 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
875 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_3), | ||
876 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
877 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_4), | ||
878 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
879 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_5), | ||
880 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
881 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_6), | ||
882 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
883 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_7), | ||
884 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
885 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_8), | ||
886 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
887 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_9), | ||
888 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
889 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_10), | ||
890 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
891 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_11), | ||
892 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
893 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_12), | ||
894 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
895 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_13), | ||
896 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
897 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_14), | ||
898 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
899 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_15), | ||
900 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
901 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16), | ||
902 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
903 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17), | ||
904 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
905 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18), | ||
906 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
871 | { } | 907 | { } |
872 | }; | 908 | }; |
873 | MODULE_DEVICE_TABLE(hid, ntrig_devices); | 909 | MODULE_DEVICE_TABLE(hid, ntrig_devices); |
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 1ebd3244eb85..b729c0286679 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -827,14 +827,21 @@ static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t co | |||
827 | ret++; | 827 | ret++; |
828 | } | 828 | } |
829 | } else { | 829 | } else { |
830 | int skipped_report_id = 0; | ||
831 | if (buf[0] == 0x0) { | ||
832 | /* Don't send the Report ID */ | ||
833 | buf++; | ||
834 | count--; | ||
835 | skipped_report_id = 1; | ||
836 | } | ||
830 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | 837 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), |
831 | HID_REQ_SET_REPORT, | 838 | HID_REQ_SET_REPORT, |
832 | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | 839 | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, |
833 | ((report_type + 1) << 8) | *buf, | 840 | ((report_type + 1) << 8) | *buf, |
834 | interface->desc.bInterfaceNumber, buf + 1, count - 1, | 841 | interface->desc.bInterfaceNumber, buf, count, |
835 | USB_CTRL_SET_TIMEOUT); | 842 | USB_CTRL_SET_TIMEOUT); |
836 | /* count also the report id */ | 843 | /* count also the report id, if this was a numbered report. */ |
837 | if (ret > 0) | 844 | if (ret > 0 && skipped_report_id) |
838 | ret++; | 845 | ret++; |
839 | } | 846 | } |
840 | 847 | ||
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 5ff8d327f33a..5f5aa39b3988 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -34,6 +34,7 @@ static const struct hid_blacklist { | |||
34 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, | 34 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, |
35 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, | 35 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, |
36 | { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT }, | 36 | { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT }, |
37 | { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT }, | ||
37 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 38 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
38 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 39 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
39 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 40 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
@@ -56,6 +57,7 @@ static const struct hid_blacklist { | |||
56 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, | 57 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, |
57 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, | 58 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, |
58 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, | 59 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, |
60 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE, HID_QUIRK_NOGET }, | ||
59 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET }, | 61 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET }, |
60 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS, HID_QUIRK_NOGET }, | 62 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS, HID_QUIRK_NOGET }, |
61 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK, HID_QUIRK_NOGET }, | 63 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK, HID_QUIRK_NOGET }, |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 2988da150ed6..05344af50734 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -53,6 +53,7 @@ struct coretemp_data { | |||
53 | struct mutex update_lock; | 53 | struct mutex update_lock; |
54 | const char *name; | 54 | const char *name; |
55 | u32 id; | 55 | u32 id; |
56 | u16 core_id; | ||
56 | char valid; /* zero until following fields are valid */ | 57 | char valid; /* zero until following fields are valid */ |
57 | unsigned long last_updated; /* in jiffies */ | 58 | unsigned long last_updated; /* in jiffies */ |
58 | int temp; | 59 | int temp; |
@@ -75,7 +76,7 @@ static ssize_t show_name(struct device *dev, struct device_attribute | |||
75 | if (attr->index == SHOW_NAME) | 76 | if (attr->index == SHOW_NAME) |
76 | ret = sprintf(buf, "%s\n", data->name); | 77 | ret = sprintf(buf, "%s\n", data->name); |
77 | else /* show label */ | 78 | else /* show label */ |
78 | ret = sprintf(buf, "Core %d\n", data->id); | 79 | ret = sprintf(buf, "Core %d\n", data->core_id); |
79 | return ret; | 80 | return ret; |
80 | } | 81 | } |
81 | 82 | ||
@@ -304,6 +305,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev) | |||
304 | } | 305 | } |
305 | 306 | ||
306 | data->id = pdev->id; | 307 | data->id = pdev->id; |
308 | #ifdef CONFIG_SMP | ||
309 | data->core_id = c->cpu_core_id; | ||
310 | #endif | ||
307 | data->name = "coretemp"; | 311 | data->name = "coretemp"; |
308 | mutex_init(&data->update_lock); | 312 | mutex_init(&data->update_lock); |
309 | 313 | ||
@@ -405,6 +409,10 @@ struct pdev_entry { | |||
405 | struct list_head list; | 409 | struct list_head list; |
406 | struct platform_device *pdev; | 410 | struct platform_device *pdev; |
407 | unsigned int cpu; | 411 | unsigned int cpu; |
412 | #ifdef CONFIG_SMP | ||
413 | u16 phys_proc_id; | ||
414 | u16 cpu_core_id; | ||
415 | #endif | ||
408 | }; | 416 | }; |
409 | 417 | ||
410 | static LIST_HEAD(pdev_list); | 418 | static LIST_HEAD(pdev_list); |
@@ -415,6 +423,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) | |||
415 | int err; | 423 | int err; |
416 | struct platform_device *pdev; | 424 | struct platform_device *pdev; |
417 | struct pdev_entry *pdev_entry; | 425 | struct pdev_entry *pdev_entry; |
426 | #ifdef CONFIG_SMP | ||
427 | struct cpuinfo_x86 *c = &cpu_data(cpu); | ||
428 | #endif | ||
429 | |||
430 | mutex_lock(&pdev_list_mutex); | ||
431 | |||
432 | #ifdef CONFIG_SMP | ||
433 | /* Skip second HT entry of each core */ | ||
434 | list_for_each_entry(pdev_entry, &pdev_list, list) { | ||
435 | if (c->phys_proc_id == pdev_entry->phys_proc_id && | ||
436 | c->cpu_core_id == pdev_entry->cpu_core_id) { | ||
437 | err = 0; /* Not an error */ | ||
438 | goto exit; | ||
439 | } | ||
440 | } | ||
441 | #endif | ||
418 | 442 | ||
419 | pdev = platform_device_alloc(DRVNAME, cpu); | 443 | pdev = platform_device_alloc(DRVNAME, cpu); |
420 | if (!pdev) { | 444 | if (!pdev) { |
@@ -438,7 +462,10 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) | |||
438 | 462 | ||
439 | pdev_entry->pdev = pdev; | 463 | pdev_entry->pdev = pdev; |
440 | pdev_entry->cpu = cpu; | 464 | pdev_entry->cpu = cpu; |
441 | mutex_lock(&pdev_list_mutex); | 465 | #ifdef CONFIG_SMP |
466 | pdev_entry->phys_proc_id = c->phys_proc_id; | ||
467 | pdev_entry->cpu_core_id = c->cpu_core_id; | ||
468 | #endif | ||
442 | list_add_tail(&pdev_entry->list, &pdev_list); | 469 | list_add_tail(&pdev_entry->list, &pdev_list); |
443 | mutex_unlock(&pdev_list_mutex); | 470 | mutex_unlock(&pdev_list_mutex); |
444 | 471 | ||
@@ -449,6 +476,7 @@ exit_device_free: | |||
449 | exit_device_put: | 476 | exit_device_put: |
450 | platform_device_put(pdev); | 477 | platform_device_put(pdev); |
451 | exit: | 478 | exit: |
479 | mutex_unlock(&pdev_list_mutex); | ||
452 | return err; | 480 | return err; |
453 | } | 481 | } |
454 | 482 | ||
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 5be09c048c5f..25763d2223b6 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -80,6 +80,13 @@ superio_inb(int reg) | |||
80 | return inb(VAL); | 80 | return inb(VAL); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline void | ||
84 | superio_outb(int reg, int val) | ||
85 | { | ||
86 | outb(reg, REG); | ||
87 | outb(val, VAL); | ||
88 | } | ||
89 | |||
83 | static int superio_inw(int reg) | 90 | static int superio_inw(int reg) |
84 | { | 91 | { |
85 | int val; | 92 | int val; |
@@ -1517,6 +1524,21 @@ static int __init it87_find(unsigned short *address, | |||
1517 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); | 1524 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); |
1518 | 1525 | ||
1519 | reg = superio_inb(IT87_SIO_PINX2_REG); | 1526 | reg = superio_inb(IT87_SIO_PINX2_REG); |
1527 | /* | ||
1528 | * The IT8720F has no VIN7 pin, so VCCH should always be | ||
1529 | * routed internally to VIN7 with an internal divider. | ||
1530 | * Curiously, there still is a configuration bit to control | ||
1531 | * this, which means it can be set incorrectly. And even | ||
1532 | * more curiously, many boards out there are improperly | ||
1533 | * configured, even though the IT8720F datasheet claims | ||
1534 | * that the internal routing of VCCH to VIN7 is the default | ||
1535 | * setting. So we force the internal routing in this case. | ||
1536 | */ | ||
1537 | if (sio_data->type == it8720 && !(reg & (1 << 1))) { | ||
1538 | reg |= (1 << 1); | ||
1539 | superio_outb(IT87_SIO_PINX2_REG, reg); | ||
1540 | pr_notice("it87: Routing internal VCCH to in7\n"); | ||
1541 | } | ||
1520 | if (reg & (1 << 0)) | 1542 | if (reg & (1 << 0)) |
1521 | pr_info("it87: in3 is VCC (+5V)\n"); | 1543 | pr_info("it87: in3 is VCC (+5V)\n"); |
1522 | if (reg & (1 << 1)) | 1544 | if (reg & (1 << 1)) |
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index f26acdb11681..8bdf80d91598 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c | |||
@@ -180,11 +180,13 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, | |||
180 | } | 180 | } |
181 | 181 | ||
182 | if ((model >= 0x69) && | 182 | if ((model >= 0x69) && |
183 | !(model == 0xc1 || model == 0x6c || model == 0x7c)) { | 183 | !(model == 0xc1 || model == 0x6c || model == 0x7c || |
184 | model == 0x6b || model == 0x6f || model == 0x7f)) { | ||
184 | /* | 185 | /* |
185 | * RevG desktop CPUs (i.e. no socket S1G1 parts) | 186 | * RevG desktop CPUs (i.e. no socket S1G1 or |
186 | * need additional offset, otherwise reported | 187 | * ASB1 parts) need additional offset, |
187 | * temperature is below ambient temperature | 188 | * otherwise reported temperature is below |
189 | * ambient temperature | ||
188 | */ | 190 | */ |
189 | data->temp_offset = 21000; | 191 | data->temp_offset = 21000; |
190 | } | 192 | } |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index f4b21f2bb8ed..c60081169cc3 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_device(u8 type, const char *name, | |||
655 | /* & ~0x80, ignore enabled/disabled bit */ | 655 | /* & ~0x80, ignore enabled/disabled bit */ |
656 | if ((type & ~0x80) != dmi_devices[i].type) | 656 | if ((type & ~0x80) != dmi_devices[i].type) |
657 | continue; | 657 | continue; |
658 | if (strcmp(name, dmi_devices[i].name)) | 658 | if (strcasecmp(name, dmi_devices[i].name)) |
659 | continue; | 659 | continue; |
660 | 660 | ||
661 | memset(&info, 0, sizeof(struct i2c_board_info)); | 661 | memset(&info, 0, sizeof(struct i2c_board_info)); |
@@ -704,9 +704,6 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
704 | { | 704 | { |
705 | unsigned char temp; | 705 | unsigned char temp; |
706 | int err, i; | 706 | int err, i; |
707 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | ||
708 | const char *vendor; | ||
709 | #endif | ||
710 | 707 | ||
711 | I801_dev = dev; | 708 | I801_dev = dev; |
712 | i801_features = 0; | 709 | i801_features = 0; |
@@ -808,8 +805,7 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
808 | } | 805 | } |
809 | #endif | 806 | #endif |
810 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | 807 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE |
811 | vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | 808 | if (dmi_name_in_vendors("FUJITSU")) |
812 | if (vendor && !strcmp(vendor, "FUJITSU SIEMENS")) | ||
813 | dmi_walk(dmi_check_onboard_devices, &i801_adapter); | 809 | dmi_walk(dmi_check_onboard_devices, &i801_adapter); |
814 | #endif | 810 | #endif |
815 | 811 | ||
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 3d76a188e42f..0fe505d7abe9 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c | |||
@@ -94,7 +94,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr, | |||
94 | } | 94 | } |
95 | break; | 95 | break; |
96 | default: | 96 | default: |
97 | return -1; /* XXXKW better error code? */ | 97 | return -EOPNOTSUPP; |
98 | } | 98 | } |
99 | 99 | ||
100 | while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY) | 100 | while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY) |
@@ -104,7 +104,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr, | |||
104 | if (error & M_SMB_ERROR) { | 104 | if (error & M_SMB_ERROR) { |
105 | /* Clear error bit by writing a 1 */ | 105 | /* Clear error bit by writing a 1 */ |
106 | csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS)); | 106 | csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS)); |
107 | return -1; /* XXXKW better error code? */ | 107 | return (error & M_SMB_ERROR_TYPE) ? -EIO : -ENXIO; |
108 | } | 108 | } |
109 | 109 | ||
110 | if (data_bytes == 1) | 110 | if (data_bytes == 1) |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 1cca2631e5b3..0815e10da7c6 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -1428,13 +1428,12 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | |||
1428 | if (!(adapter->class & driver->class)) | 1428 | if (!(adapter->class & driver->class)) |
1429 | goto exit_free; | 1429 | goto exit_free; |
1430 | 1430 | ||
1431 | /* Stop here if we can't use SMBUS_QUICK */ | 1431 | /* Stop here if the bus doesn't support probing */ |
1432 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { | 1432 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE)) { |
1433 | if (address_list[0] == I2C_CLIENT_END) | 1433 | if (address_list[0] == I2C_CLIENT_END) |
1434 | goto exit_free; | 1434 | goto exit_free; |
1435 | 1435 | ||
1436 | dev_warn(&adapter->dev, "SMBus Quick command not supported, " | 1436 | dev_warn(&adapter->dev, "Probing not supported\n"); |
1437 | "can't probe for chips\n"); | ||
1438 | err = -EOPNOTSUPP; | 1437 | err = -EOPNOTSUPP; |
1439 | goto exit_free; | 1438 | goto exit_free; |
1440 | } | 1439 | } |
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 30ce0a8eca09..855ee44fdb52 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -969,7 +969,8 @@ static void process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb) | |||
969 | goto err; | 969 | goto err; |
970 | goto out; | 970 | goto out; |
971 | err: | 971 | err: |
972 | abort_connection(ep, skb, GFP_KERNEL); | 972 | state_set(&ep->com, ABORTING); |
973 | send_abort(ep, skb, GFP_KERNEL); | ||
973 | out: | 974 | out: |
974 | connect_reply_upcall(ep, err); | 975 | connect_reply_upcall(ep, err); |
975 | return; | 976 | return; |
@@ -1372,7 +1373,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb) | |||
1372 | pdev, 0); | 1373 | pdev, 0); |
1373 | mtu = pdev->mtu; | 1374 | mtu = pdev->mtu; |
1374 | tx_chan = cxgb4_port_chan(pdev); | 1375 | tx_chan = cxgb4_port_chan(pdev); |
1375 | smac_idx = tx_chan << 1; | 1376 | smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1; |
1376 | step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan; | 1377 | step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan; |
1377 | txq_idx = cxgb4_port_idx(pdev) * step; | 1378 | txq_idx = cxgb4_port_idx(pdev) * step; |
1378 | step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan; | 1379 | step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan; |
@@ -1383,7 +1384,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb) | |||
1383 | dst->neighbour->dev, 0); | 1384 | dst->neighbour->dev, 0); |
1384 | mtu = dst_mtu(dst); | 1385 | mtu = dst_mtu(dst); |
1385 | tx_chan = cxgb4_port_chan(dst->neighbour->dev); | 1386 | tx_chan = cxgb4_port_chan(dst->neighbour->dev); |
1386 | smac_idx = tx_chan << 1; | 1387 | smac_idx = (cxgb4_port_viid(dst->neighbour->dev) & 0x7F) << 1; |
1387 | step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan; | 1388 | step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan; |
1388 | txq_idx = cxgb4_port_idx(dst->neighbour->dev) * step; | 1389 | txq_idx = cxgb4_port_idx(dst->neighbour->dev) * step; |
1389 | step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan; | 1390 | step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan; |
@@ -1950,7 +1951,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
1950 | pdev, 0); | 1951 | pdev, 0); |
1951 | ep->mtu = pdev->mtu; | 1952 | ep->mtu = pdev->mtu; |
1952 | ep->tx_chan = cxgb4_port_chan(pdev); | 1953 | ep->tx_chan = cxgb4_port_chan(pdev); |
1953 | ep->smac_idx = ep->tx_chan << 1; | 1954 | ep->smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1; |
1954 | step = ep->com.dev->rdev.lldi.ntxq / | 1955 | step = ep->com.dev->rdev.lldi.ntxq / |
1955 | ep->com.dev->rdev.lldi.nchan; | 1956 | ep->com.dev->rdev.lldi.nchan; |
1956 | ep->txq_idx = cxgb4_port_idx(pdev) * step; | 1957 | ep->txq_idx = cxgb4_port_idx(pdev) * step; |
@@ -1965,7 +1966,8 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
1965 | ep->dst->neighbour->dev, 0); | 1966 | ep->dst->neighbour->dev, 0); |
1966 | ep->mtu = dst_mtu(ep->dst); | 1967 | ep->mtu = dst_mtu(ep->dst); |
1967 | ep->tx_chan = cxgb4_port_chan(ep->dst->neighbour->dev); | 1968 | ep->tx_chan = cxgb4_port_chan(ep->dst->neighbour->dev); |
1968 | ep->smac_idx = ep->tx_chan << 1; | 1969 | ep->smac_idx = (cxgb4_port_viid(ep->dst->neighbour->dev) & |
1970 | 0x7F) << 1; | ||
1969 | step = ep->com.dev->rdev.lldi.ntxq / | 1971 | step = ep->com.dev->rdev.lldi.ntxq / |
1970 | ep->com.dev->rdev.lldi.nchan; | 1972 | ep->com.dev->rdev.lldi.nchan; |
1971 | ep->txq_idx = cxgb4_port_idx(ep->dst->neighbour->dev) * step; | 1973 | ep->txq_idx = cxgb4_port_idx(ep->dst->neighbour->dev) * step; |
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index 2447f5295482..fac5c6e68011 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c | |||
@@ -77,7 +77,7 @@ static int destroy_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, | |||
77 | kfree(cq->sw_queue); | 77 | kfree(cq->sw_queue); |
78 | dma_free_coherent(&(rdev->lldi.pdev->dev), | 78 | dma_free_coherent(&(rdev->lldi.pdev->dev), |
79 | cq->memsize, cq->queue, | 79 | cq->memsize, cq->queue, |
80 | pci_unmap_addr(cq, mapping)); | 80 | dma_unmap_addr(cq, mapping)); |
81 | c4iw_put_cqid(rdev, cq->cqid, uctx); | 81 | c4iw_put_cqid(rdev, cq->cqid, uctx); |
82 | return ret; | 82 | return ret; |
83 | } | 83 | } |
@@ -112,7 +112,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, | |||
112 | ret = -ENOMEM; | 112 | ret = -ENOMEM; |
113 | goto err3; | 113 | goto err3; |
114 | } | 114 | } |
115 | pci_unmap_addr_set(cq, mapping, cq->dma_addr); | 115 | dma_unmap_addr_set(cq, mapping, cq->dma_addr); |
116 | memset(cq->queue, 0, cq->memsize); | 116 | memset(cq->queue, 0, cq->memsize); |
117 | 117 | ||
118 | /* build fw_ri_res_wr */ | 118 | /* build fw_ri_res_wr */ |
@@ -179,7 +179,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, | |||
179 | return 0; | 179 | return 0; |
180 | err4: | 180 | err4: |
181 | dma_free_coherent(&rdev->lldi.pdev->dev, cq->memsize, cq->queue, | 181 | dma_free_coherent(&rdev->lldi.pdev->dev, cq->memsize, cq->queue, |
182 | pci_unmap_addr(cq, mapping)); | 182 | dma_unmap_addr(cq, mapping)); |
183 | err3: | 183 | err3: |
184 | kfree(cq->sw_queue); | 184 | kfree(cq->sw_queue); |
185 | err2: | 185 | err2: |
@@ -764,7 +764,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, | |||
764 | struct c4iw_create_cq_resp uresp; | 764 | struct c4iw_create_cq_resp uresp; |
765 | struct c4iw_ucontext *ucontext = NULL; | 765 | struct c4iw_ucontext *ucontext = NULL; |
766 | int ret; | 766 | int ret; |
767 | size_t memsize; | 767 | size_t memsize, hwentries; |
768 | struct c4iw_mm_entry *mm, *mm2; | 768 | struct c4iw_mm_entry *mm, *mm2; |
769 | 769 | ||
770 | PDBG("%s ib_dev %p entries %d\n", __func__, ibdev, entries); | 770 | PDBG("%s ib_dev %p entries %d\n", __func__, ibdev, entries); |
@@ -788,14 +788,29 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, | |||
788 | * entries must be multiple of 16 for HW. | 788 | * entries must be multiple of 16 for HW. |
789 | */ | 789 | */ |
790 | entries = roundup(entries, 16); | 790 | entries = roundup(entries, 16); |
791 | memsize = entries * sizeof *chp->cq.queue; | 791 | |
792 | /* | ||
793 | * Make actual HW queue 2x to avoid cdix_inc overflows. | ||
794 | */ | ||
795 | hwentries = entries * 2; | ||
796 | |||
797 | /* | ||
798 | * Make HW queue at least 64 entries so GTS updates aren't too | ||
799 | * frequent. | ||
800 | */ | ||
801 | if (hwentries < 64) | ||
802 | hwentries = 64; | ||
803 | |||
804 | memsize = hwentries * sizeof *chp->cq.queue; | ||
792 | 805 | ||
793 | /* | 806 | /* |
794 | * memsize must be a multiple of the page size if its a user cq. | 807 | * memsize must be a multiple of the page size if its a user cq. |
795 | */ | 808 | */ |
796 | if (ucontext) | 809 | if (ucontext) { |
797 | memsize = roundup(memsize, PAGE_SIZE); | 810 | memsize = roundup(memsize, PAGE_SIZE); |
798 | chp->cq.size = entries; | 811 | hwentries = memsize / sizeof *chp->cq.queue; |
812 | } | ||
813 | chp->cq.size = hwentries; | ||
799 | chp->cq.memsize = memsize; | 814 | chp->cq.memsize = memsize; |
800 | 815 | ||
801 | ret = create_cq(&rhp->rdev, &chp->cq, | 816 | ret = create_cq(&rhp->rdev, &chp->cq, |
@@ -805,7 +820,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, | |||
805 | 820 | ||
806 | chp->rhp = rhp; | 821 | chp->rhp = rhp; |
807 | chp->cq.size--; /* status page */ | 822 | chp->cq.size--; /* status page */ |
808 | chp->ibcq.cqe = chp->cq.size - 1; | 823 | chp->ibcq.cqe = entries - 2; |
809 | spin_lock_init(&chp->lock); | 824 | spin_lock_init(&chp->lock); |
810 | atomic_set(&chp->refcnt, 1); | 825 | atomic_set(&chp->refcnt, 1); |
811 | init_waitqueue_head(&chp->wait); | 826 | init_waitqueue_head(&chp->wait); |
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index 277ab589b44d..d33e1a668811 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
@@ -261,7 +261,7 @@ static inline struct c4iw_mw *to_c4iw_mw(struct ib_mw *ibmw) | |||
261 | 261 | ||
262 | struct c4iw_fr_page_list { | 262 | struct c4iw_fr_page_list { |
263 | struct ib_fast_reg_page_list ibpl; | 263 | struct ib_fast_reg_page_list ibpl; |
264 | DECLARE_PCI_UNMAP_ADDR(mapping); | 264 | DEFINE_DMA_UNMAP_ADDR(mapping); |
265 | dma_addr_t dma_addr; | 265 | dma_addr_t dma_addr; |
266 | struct c4iw_dev *dev; | 266 | struct c4iw_dev *dev; |
267 | int size; | 267 | int size; |
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c index 7f94da1a2437..82b5703b8947 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c | |||
@@ -764,7 +764,7 @@ struct ib_fast_reg_page_list *c4iw_alloc_fastreg_pbl(struct ib_device *device, | |||
764 | if (!c4pl) | 764 | if (!c4pl) |
765 | return ERR_PTR(-ENOMEM); | 765 | return ERR_PTR(-ENOMEM); |
766 | 766 | ||
767 | pci_unmap_addr_set(c4pl, mapping, dma_addr); | 767 | dma_unmap_addr_set(c4pl, mapping, dma_addr); |
768 | c4pl->dma_addr = dma_addr; | 768 | c4pl->dma_addr = dma_addr; |
769 | c4pl->dev = dev; | 769 | c4pl->dev = dev; |
770 | c4pl->size = size; | 770 | c4pl->size = size; |
@@ -779,7 +779,7 @@ void c4iw_free_fastreg_pbl(struct ib_fast_reg_page_list *ibpl) | |||
779 | struct c4iw_fr_page_list *c4pl = to_c4iw_fr_page_list(ibpl); | 779 | struct c4iw_fr_page_list *c4pl = to_c4iw_fr_page_list(ibpl); |
780 | 780 | ||
781 | dma_free_coherent(&c4pl->dev->rdev.lldi.pdev->dev, c4pl->size, | 781 | dma_free_coherent(&c4pl->dev->rdev.lldi.pdev->dev, c4pl->size, |
782 | c4pl, pci_unmap_addr(c4pl, mapping)); | 782 | c4pl, dma_unmap_addr(c4pl, mapping)); |
783 | } | 783 | } |
784 | 784 | ||
785 | int c4iw_dereg_mr(struct ib_mr *ib_mr) | 785 | int c4iw_dereg_mr(struct ib_mr *ib_mr) |
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index 0c28ed1eafa6..7065cb310553 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c | |||
@@ -40,10 +40,10 @@ static int destroy_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, | |||
40 | */ | 40 | */ |
41 | dma_free_coherent(&(rdev->lldi.pdev->dev), | 41 | dma_free_coherent(&(rdev->lldi.pdev->dev), |
42 | wq->rq.memsize, wq->rq.queue, | 42 | wq->rq.memsize, wq->rq.queue, |
43 | pci_unmap_addr(&wq->rq, mapping)); | 43 | dma_unmap_addr(&wq->rq, mapping)); |
44 | dma_free_coherent(&(rdev->lldi.pdev->dev), | 44 | dma_free_coherent(&(rdev->lldi.pdev->dev), |
45 | wq->sq.memsize, wq->sq.queue, | 45 | wq->sq.memsize, wq->sq.queue, |
46 | pci_unmap_addr(&wq->sq, mapping)); | 46 | dma_unmap_addr(&wq->sq, mapping)); |
47 | c4iw_rqtpool_free(rdev, wq->rq.rqt_hwaddr, wq->rq.rqt_size); | 47 | c4iw_rqtpool_free(rdev, wq->rq.rqt_hwaddr, wq->rq.rqt_size); |
48 | kfree(wq->rq.sw_rq); | 48 | kfree(wq->rq.sw_rq); |
49 | kfree(wq->sq.sw_sq); | 49 | kfree(wq->sq.sw_sq); |
@@ -99,7 +99,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, | |||
99 | if (!wq->sq.queue) | 99 | if (!wq->sq.queue) |
100 | goto err5; | 100 | goto err5; |
101 | memset(wq->sq.queue, 0, wq->sq.memsize); | 101 | memset(wq->sq.queue, 0, wq->sq.memsize); |
102 | pci_unmap_addr_set(&wq->sq, mapping, wq->sq.dma_addr); | 102 | dma_unmap_addr_set(&wq->sq, mapping, wq->sq.dma_addr); |
103 | 103 | ||
104 | wq->rq.queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), | 104 | wq->rq.queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), |
105 | wq->rq.memsize, &(wq->rq.dma_addr), | 105 | wq->rq.memsize, &(wq->rq.dma_addr), |
@@ -112,7 +112,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, | |||
112 | wq->rq.queue, | 112 | wq->rq.queue, |
113 | (unsigned long long)virt_to_phys(wq->rq.queue)); | 113 | (unsigned long long)virt_to_phys(wq->rq.queue)); |
114 | memset(wq->rq.queue, 0, wq->rq.memsize); | 114 | memset(wq->rq.queue, 0, wq->rq.memsize); |
115 | pci_unmap_addr_set(&wq->rq, mapping, wq->rq.dma_addr); | 115 | dma_unmap_addr_set(&wq->rq, mapping, wq->rq.dma_addr); |
116 | 116 | ||
117 | wq->db = rdev->lldi.db_reg; | 117 | wq->db = rdev->lldi.db_reg; |
118 | wq->gts = rdev->lldi.gts_reg; | 118 | wq->gts = rdev->lldi.gts_reg; |
@@ -217,11 +217,11 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, | |||
217 | err7: | 217 | err7: |
218 | dma_free_coherent(&(rdev->lldi.pdev->dev), | 218 | dma_free_coherent(&(rdev->lldi.pdev->dev), |
219 | wq->rq.memsize, wq->rq.queue, | 219 | wq->rq.memsize, wq->rq.queue, |
220 | pci_unmap_addr(&wq->rq, mapping)); | 220 | dma_unmap_addr(&wq->rq, mapping)); |
221 | err6: | 221 | err6: |
222 | dma_free_coherent(&(rdev->lldi.pdev->dev), | 222 | dma_free_coherent(&(rdev->lldi.pdev->dev), |
223 | wq->sq.memsize, wq->sq.queue, | 223 | wq->sq.memsize, wq->sq.queue, |
224 | pci_unmap_addr(&wq->sq, mapping)); | 224 | dma_unmap_addr(&wq->sq, mapping)); |
225 | err5: | 225 | err5: |
226 | c4iw_rqtpool_free(rdev, wq->rq.rqt_hwaddr, wq->rq.rqt_size); | 226 | c4iw_rqtpool_free(rdev, wq->rq.rqt_hwaddr, wq->rq.rqt_size); |
227 | err4: | 227 | err4: |
diff --git a/drivers/infiniband/hw/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h index 1057cb96302e..9cf8d85bfcff 100644 --- a/drivers/infiniband/hw/cxgb4/t4.h +++ b/drivers/infiniband/hw/cxgb4/t4.h | |||
@@ -279,7 +279,7 @@ struct t4_swsqe { | |||
279 | struct t4_sq { | 279 | struct t4_sq { |
280 | union t4_wr *queue; | 280 | union t4_wr *queue; |
281 | dma_addr_t dma_addr; | 281 | dma_addr_t dma_addr; |
282 | DECLARE_PCI_UNMAP_ADDR(mapping); | 282 | DEFINE_DMA_UNMAP_ADDR(mapping); |
283 | struct t4_swsqe *sw_sq; | 283 | struct t4_swsqe *sw_sq; |
284 | struct t4_swsqe *oldest_read; | 284 | struct t4_swsqe *oldest_read; |
285 | u64 udb; | 285 | u64 udb; |
@@ -298,7 +298,7 @@ struct t4_swrqe { | |||
298 | struct t4_rq { | 298 | struct t4_rq { |
299 | union t4_recv_wr *queue; | 299 | union t4_recv_wr *queue; |
300 | dma_addr_t dma_addr; | 300 | dma_addr_t dma_addr; |
301 | DECLARE_PCI_UNMAP_ADDR(mapping); | 301 | DEFINE_DMA_UNMAP_ADDR(mapping); |
302 | struct t4_swrqe *sw_rq; | 302 | struct t4_swrqe *sw_rq; |
303 | u64 udb; | 303 | u64 udb; |
304 | size_t memsize; | 304 | size_t memsize; |
@@ -429,7 +429,7 @@ static inline int t4_wq_db_enabled(struct t4_wq *wq) | |||
429 | struct t4_cq { | 429 | struct t4_cq { |
430 | struct t4_cqe *queue; | 430 | struct t4_cqe *queue; |
431 | dma_addr_t dma_addr; | 431 | dma_addr_t dma_addr; |
432 | DECLARE_PCI_UNMAP_ADDR(mapping); | 432 | DEFINE_DMA_UNMAP_ADDR(mapping); |
433 | struct t4_cqe *sw_queue; | 433 | struct t4_cqe *sw_queue; |
434 | void __iomem *gts; | 434 | void __iomem *gts; |
435 | struct c4iw_rdev *rdev; | 435 | struct c4iw_rdev *rdev; |
diff --git a/drivers/infiniband/hw/qib/Makefile b/drivers/infiniband/hw/qib/Makefile index c6515a1b9a6a..f12d7bb8b39f 100644 --- a/drivers/infiniband/hw/qib/Makefile +++ b/drivers/infiniband/hw/qib/Makefile | |||
@@ -6,7 +6,7 @@ ib_qib-y := qib_cq.o qib_diag.o qib_dma.o qib_driver.o qib_eeprom.o \ | |||
6 | qib_qp.o qib_qsfp.o qib_rc.o qib_ruc.o qib_sdma.o qib_srq.o \ | 6 | qib_qp.o qib_qsfp.o qib_rc.o qib_ruc.o qib_sdma.o qib_srq.o \ |
7 | qib_sysfs.o qib_twsi.o qib_tx.o qib_uc.o qib_ud.o \ | 7 | qib_sysfs.o qib_twsi.o qib_tx.o qib_uc.o qib_ud.o \ |
8 | qib_user_pages.o qib_user_sdma.o qib_verbs_mcast.o qib_iba7220.o \ | 8 | qib_user_pages.o qib_user_sdma.o qib_verbs_mcast.o qib_iba7220.o \ |
9 | qib_sd7220.o qib_sd7220_img.o qib_iba7322.o qib_verbs.o | 9 | qib_sd7220.o qib_iba7322.o qib_verbs.o |
10 | 10 | ||
11 | # 6120 has no fallback if no MSI interrupts, others can do INTx | 11 | # 6120 has no fallback if no MSI interrupts, others can do INTx |
12 | ib_qib-$(CONFIG_PCI_MSI) += qib_iba6120.o | 12 | ib_qib-$(CONFIG_PCI_MSI) += qib_iba6120.o |
diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h index 32d9208efcff..3593983df7ba 100644 --- a/drivers/infiniband/hw/qib/qib.h +++ b/drivers/infiniband/hw/qib/qib.h | |||
@@ -686,6 +686,7 @@ struct qib_devdata { | |||
686 | void __iomem *piobase; | 686 | void __iomem *piobase; |
687 | /* mem-mapped pointer to base of user chip regs (if using WC PAT) */ | 687 | /* mem-mapped pointer to base of user chip regs (if using WC PAT) */ |
688 | u64 __iomem *userbase; | 688 | u64 __iomem *userbase; |
689 | void __iomem *piovl15base; /* base of VL15 buffers, if not WC */ | ||
689 | /* | 690 | /* |
690 | * points to area where PIOavail registers will be DMA'ed. | 691 | * points to area where PIOavail registers will be DMA'ed. |
691 | * Has to be on a page of it's own, because the page will be | 692 | * Has to be on a page of it's own, because the page will be |
diff --git a/drivers/infiniband/hw/qib/qib_7220.h b/drivers/infiniband/hw/qib/qib_7220.h index ea0bfd896f92..21f374aa0631 100644 --- a/drivers/infiniband/hw/qib/qib_7220.h +++ b/drivers/infiniband/hw/qib/qib_7220.h | |||
@@ -109,10 +109,6 @@ struct qib_chippport_specific { | |||
109 | */ | 109 | */ |
110 | int qib_sd7220_presets(struct qib_devdata *dd); | 110 | int qib_sd7220_presets(struct qib_devdata *dd); |
111 | int qib_sd7220_init(struct qib_devdata *dd); | 111 | int qib_sd7220_init(struct qib_devdata *dd); |
112 | int qib_sd7220_prog_ld(struct qib_devdata *dd, int sdnum, u8 *img, | ||
113 | int len, int offset); | ||
114 | int qib_sd7220_prog_vfy(struct qib_devdata *dd, int sdnum, const u8 *img, | ||
115 | int len, int offset); | ||
116 | void qib_sd7220_clr_ibpar(struct qib_devdata *); | 112 | void qib_sd7220_clr_ibpar(struct qib_devdata *); |
117 | /* | 113 | /* |
118 | * Below used for sdnum parameter, selecting one of the two sections | 114 | * Below used for sdnum parameter, selecting one of the two sections |
@@ -121,9 +117,6 @@ void qib_sd7220_clr_ibpar(struct qib_devdata *); | |||
121 | */ | 117 | */ |
122 | #define IB_7220_SERDES 2 | 118 | #define IB_7220_SERDES 2 |
123 | 119 | ||
124 | int qib_sd7220_ib_load(struct qib_devdata *dd); | ||
125 | int qib_sd7220_ib_vfy(struct qib_devdata *dd); | ||
126 | |||
127 | static inline u32 qib_read_kreg32(const struct qib_devdata *dd, | 120 | static inline u32 qib_read_kreg32(const struct qib_devdata *dd, |
128 | const u16 regno) | 121 | const u16 regno) |
129 | { | 122 | { |
diff --git a/drivers/infiniband/hw/qib/qib_7322_regs.h b/drivers/infiniband/hw/qib/qib_7322_regs.h index a97440ba924c..32dc81ff8d4a 100644 --- a/drivers/infiniband/hw/qib/qib_7322_regs.h +++ b/drivers/infiniband/hw/qib/qib_7322_regs.h | |||
@@ -742,15 +742,15 @@ | |||
742 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_1_LSB 0xF | 742 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_1_LSB 0xF |
743 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_1_MSB 0xF | 743 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_1_MSB 0xF |
744 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_1_RMASK 0x1 | 744 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_1_RMASK 0x1 |
745 | #define QIB_7322_HwErrMask_statusValidNoEopMask_1_LSB 0xE | 745 | #define QIB_7322_HwErrMask_IBCBusToSPCParityErrMask_1_LSB 0xE |
746 | #define QIB_7322_HwErrMask_statusValidNoEopMask_1_MSB 0xE | 746 | #define QIB_7322_HwErrMask_IBCBusToSPCParityErrMask_1_MSB 0xE |
747 | #define QIB_7322_HwErrMask_statusValidNoEopMask_1_RMASK 0x1 | 747 | #define QIB_7322_HwErrMask_IBCBusToSPCParityErrMask_1_RMASK 0x1 |
748 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_0_LSB 0xD | 748 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_0_LSB 0xD |
749 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_0_MSB 0xD | 749 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_0_MSB 0xD |
750 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_0_RMASK 0x1 | 750 | #define QIB_7322_HwErrMask_IBCBusFromSPCParityErrMask_0_RMASK 0x1 |
751 | #define QIB_7322_HwErrMask_statusValidNoEopMask_0_LSB 0xC | 751 | #define QIB_7322_HwErrMask_statusValidNoEopMask_LSB 0xC |
752 | #define QIB_7322_HwErrMask_statusValidNoEopMask_0_MSB 0xC | 752 | #define QIB_7322_HwErrMask_statusValidNoEopMask_MSB 0xC |
753 | #define QIB_7322_HwErrMask_statusValidNoEopMask_0_RMASK 0x1 | 753 | #define QIB_7322_HwErrMask_statusValidNoEopMask_RMASK 0x1 |
754 | #define QIB_7322_HwErrMask_LATriggeredMask_LSB 0xB | 754 | #define QIB_7322_HwErrMask_LATriggeredMask_LSB 0xB |
755 | #define QIB_7322_HwErrMask_LATriggeredMask_MSB 0xB | 755 | #define QIB_7322_HwErrMask_LATriggeredMask_MSB 0xB |
756 | #define QIB_7322_HwErrMask_LATriggeredMask_RMASK 0x1 | 756 | #define QIB_7322_HwErrMask_LATriggeredMask_RMASK 0x1 |
@@ -796,15 +796,15 @@ | |||
796 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_1_LSB 0xF | 796 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_1_LSB 0xF |
797 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_1_MSB 0xF | 797 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_1_MSB 0xF |
798 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_1_RMASK 0x1 | 798 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_1_RMASK 0x1 |
799 | #define QIB_7322_HwErrStatus_statusValidNoEop_1_LSB 0xE | 799 | #define QIB_7322_HwErrStatus_IBCBusToSPCParityErr_1_LSB 0xE |
800 | #define QIB_7322_HwErrStatus_statusValidNoEop_1_MSB 0xE | 800 | #define QIB_7322_HwErrStatus_IBCBusToSPCParityErr_1_MSB 0xE |
801 | #define QIB_7322_HwErrStatus_statusValidNoEop_1_RMASK 0x1 | 801 | #define QIB_7322_HwErrStatus_IBCBusToSPCParityErr_1_RMASK 0x1 |
802 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_0_LSB 0xD | 802 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_0_LSB 0xD |
803 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_0_MSB 0xD | 803 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_0_MSB 0xD |
804 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_0_RMASK 0x1 | 804 | #define QIB_7322_HwErrStatus_IBCBusFromSPCParityErr_0_RMASK 0x1 |
805 | #define QIB_7322_HwErrStatus_statusValidNoEop_0_LSB 0xC | 805 | #define QIB_7322_HwErrStatus_statusValidNoEop_LSB 0xC |
806 | #define QIB_7322_HwErrStatus_statusValidNoEop_0_MSB 0xC | 806 | #define QIB_7322_HwErrStatus_statusValidNoEop_MSB 0xC |
807 | #define QIB_7322_HwErrStatus_statusValidNoEop_0_RMASK 0x1 | 807 | #define QIB_7322_HwErrStatus_statusValidNoEop_RMASK 0x1 |
808 | #define QIB_7322_HwErrStatus_LATriggered_LSB 0xB | 808 | #define QIB_7322_HwErrStatus_LATriggered_LSB 0xB |
809 | #define QIB_7322_HwErrStatus_LATriggered_MSB 0xB | 809 | #define QIB_7322_HwErrStatus_LATriggered_MSB 0xB |
810 | #define QIB_7322_HwErrStatus_LATriggered_RMASK 0x1 | 810 | #define QIB_7322_HwErrStatus_LATriggered_RMASK 0x1 |
@@ -850,15 +850,15 @@ | |||
850 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_1_LSB 0xF | 850 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_1_LSB 0xF |
851 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_1_MSB 0xF | 851 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_1_MSB 0xF |
852 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_1_RMASK 0x1 | 852 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_1_RMASK 0x1 |
853 | #define QIB_7322_HwErrClear_IBCBusToSPCparityErrClear_1_LSB 0xE | 853 | #define QIB_7322_HwErrClear_IBCBusToSPCParityErrClear_1_LSB 0xE |
854 | #define QIB_7322_HwErrClear_IBCBusToSPCparityErrClear_1_MSB 0xE | 854 | #define QIB_7322_HwErrClear_IBCBusToSPCParityErrClear_1_MSB 0xE |
855 | #define QIB_7322_HwErrClear_IBCBusToSPCparityErrClear_1_RMASK 0x1 | 855 | #define QIB_7322_HwErrClear_IBCBusToSPCParityErrClear_1_RMASK 0x1 |
856 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_0_LSB 0xD | 856 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_0_LSB 0xD |
857 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_0_MSB 0xD | 857 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_0_MSB 0xD |
858 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_0_RMASK 0x1 | 858 | #define QIB_7322_HwErrClear_IBCBusFromSPCParityErrClear_0_RMASK 0x1 |
859 | #define QIB_7322_HwErrClear_IBCBusToSPCparityErrClear_0_LSB 0xC | 859 | #define QIB_7322_HwErrClear_statusValidNoEopClear_LSB 0xC |
860 | #define QIB_7322_HwErrClear_IBCBusToSPCparityErrClear_0_MSB 0xC | 860 | #define QIB_7322_HwErrClear_statusValidNoEopClear_MSB 0xC |
861 | #define QIB_7322_HwErrClear_IBCBusToSPCparityErrClear_0_RMASK 0x1 | 861 | #define QIB_7322_HwErrClear_statusValidNoEopClear_RMASK 0x1 |
862 | #define QIB_7322_HwErrClear_LATriggeredClear_LSB 0xB | 862 | #define QIB_7322_HwErrClear_LATriggeredClear_LSB 0xB |
863 | #define QIB_7322_HwErrClear_LATriggeredClear_MSB 0xB | 863 | #define QIB_7322_HwErrClear_LATriggeredClear_MSB 0xB |
864 | #define QIB_7322_HwErrClear_LATriggeredClear_RMASK 0x1 | 864 | #define QIB_7322_HwErrClear_LATriggeredClear_RMASK 0x1 |
@@ -880,15 +880,15 @@ | |||
880 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_1_LSB 0xF | 880 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_1_LSB 0xF |
881 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_1_MSB 0xF | 881 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_1_MSB 0xF |
882 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_1_RMASK 0x1 | 882 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_1_RMASK 0x1 |
883 | #define QIB_7322_HwDiagCtrl_ForcestatusValidNoEop_1_LSB 0xE | 883 | #define QIB_7322_HwDiagCtrl_ForceIBCBusToSPCParityErr_1_LSB 0xE |
884 | #define QIB_7322_HwDiagCtrl_ForcestatusValidNoEop_1_MSB 0xE | 884 | #define QIB_7322_HwDiagCtrl_ForceIBCBusToSPCParityErr_1_MSB 0xE |
885 | #define QIB_7322_HwDiagCtrl_ForcestatusValidNoEop_1_RMASK 0x1 | 885 | #define QIB_7322_HwDiagCtrl_ForceIBCBusToSPCParityErr_1_RMASK 0x1 |
886 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_0_LSB 0xD | 886 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_0_LSB 0xD |
887 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_0_MSB 0xD | 887 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_0_MSB 0xD |
888 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_0_RMASK 0x1 | 888 | #define QIB_7322_HwDiagCtrl_ForceIBCBusFromSPCParityErr_0_RMASK 0x1 |
889 | #define QIB_7322_HwDiagCtrl_ForcestatusValidNoEop_0_LSB 0xC | 889 | #define QIB_7322_HwDiagCtrl_ForceIBCBusToSPCParityErr_0_LSB 0xC |
890 | #define QIB_7322_HwDiagCtrl_ForcestatusValidNoEop_0_MSB 0xC | 890 | #define QIB_7322_HwDiagCtrl_ForceIBCBusToSPCParityErr_0_MSB 0xC |
891 | #define QIB_7322_HwDiagCtrl_ForcestatusValidNoEop_0_RMASK 0x1 | 891 | #define QIB_7322_HwDiagCtrl_ForceIBCBusToSPCParityErr_0_RMASK 0x1 |
892 | 892 | ||
893 | #define QIB_7322_EXTStatus_OFFS 0xC0 | 893 | #define QIB_7322_EXTStatus_OFFS 0xC0 |
894 | #define QIB_7322_EXTStatus_DEF 0x000000000000X000 | 894 | #define QIB_7322_EXTStatus_DEF 0x000000000000X000 |
diff --git a/drivers/infiniband/hw/qib/qib_diag.c b/drivers/infiniband/hw/qib/qib_diag.c index ca98dd523752..05dcf0d9a7d3 100644 --- a/drivers/infiniband/hw/qib/qib_diag.c +++ b/drivers/infiniband/hw/qib/qib_diag.c | |||
@@ -233,6 +233,7 @@ static u32 __iomem *qib_remap_ioaddr32(struct qib_devdata *dd, u32 offset, | |||
233 | u32 __iomem *krb32 = (u32 __iomem *)dd->kregbase; | 233 | u32 __iomem *krb32 = (u32 __iomem *)dd->kregbase; |
234 | u32 __iomem *map = NULL; | 234 | u32 __iomem *map = NULL; |
235 | u32 cnt = 0; | 235 | u32 cnt = 0; |
236 | u32 tot4k, offs4k; | ||
236 | 237 | ||
237 | /* First, simplest case, offset is within the first map. */ | 238 | /* First, simplest case, offset is within the first map. */ |
238 | kreglen = (dd->kregend - dd->kregbase) * sizeof(u64); | 239 | kreglen = (dd->kregend - dd->kregbase) * sizeof(u64); |
@@ -250,7 +251,8 @@ static u32 __iomem *qib_remap_ioaddr32(struct qib_devdata *dd, u32 offset, | |||
250 | if (dd->userbase) { | 251 | if (dd->userbase) { |
251 | /* If user regs mapped, they are after send, so set limit. */ | 252 | /* If user regs mapped, they are after send, so set limit. */ |
252 | u32 ulim = (dd->cfgctxts * dd->ureg_align) + dd->uregbase; | 253 | u32 ulim = (dd->cfgctxts * dd->ureg_align) + dd->uregbase; |
253 | snd_lim = dd->uregbase; | 254 | if (!dd->piovl15base) |
255 | snd_lim = dd->uregbase; | ||
254 | krb32 = (u32 __iomem *)dd->userbase; | 256 | krb32 = (u32 __iomem *)dd->userbase; |
255 | if (offset >= dd->uregbase && offset < ulim) { | 257 | if (offset >= dd->uregbase && offset < ulim) { |
256 | map = krb32 + (offset - dd->uregbase) / sizeof(u32); | 258 | map = krb32 + (offset - dd->uregbase) / sizeof(u32); |
@@ -277,14 +279,14 @@ static u32 __iomem *qib_remap_ioaddr32(struct qib_devdata *dd, u32 offset, | |||
277 | /* If 4k buffers exist, account for them by bumping | 279 | /* If 4k buffers exist, account for them by bumping |
278 | * appropriate limit. | 280 | * appropriate limit. |
279 | */ | 281 | */ |
282 | tot4k = dd->piobcnt4k * dd->align4k; | ||
283 | offs4k = dd->piobufbase >> 32; | ||
280 | if (dd->piobcnt4k) { | 284 | if (dd->piobcnt4k) { |
281 | u32 tot4k = dd->piobcnt4k * dd->align4k; | ||
282 | u32 offs4k = dd->piobufbase >> 32; | ||
283 | if (snd_bottom > offs4k) | 285 | if (snd_bottom > offs4k) |
284 | snd_bottom = offs4k; | 286 | snd_bottom = offs4k; |
285 | else { | 287 | else { |
286 | /* 4k above 2k. Bump snd_lim, if needed*/ | 288 | /* 4k above 2k. Bump snd_lim, if needed*/ |
287 | if (!dd->userbase) | 289 | if (!dd->userbase || dd->piovl15base) |
288 | snd_lim = offs4k + tot4k; | 290 | snd_lim = offs4k + tot4k; |
289 | } | 291 | } |
290 | } | 292 | } |
@@ -298,6 +300,15 @@ static u32 __iomem *qib_remap_ioaddr32(struct qib_devdata *dd, u32 offset, | |||
298 | cnt = snd_lim - offset; | 300 | cnt = snd_lim - offset; |
299 | } | 301 | } |
300 | 302 | ||
303 | if (!map && offs4k && dd->piovl15base) { | ||
304 | snd_lim = offs4k + tot4k + 2 * dd->align4k; | ||
305 | if (offset >= (offs4k + tot4k) && offset < snd_lim) { | ||
306 | map = (u32 __iomem *)dd->piovl15base + | ||
307 | ((offset - (offs4k + tot4k)) / sizeof(u32)); | ||
308 | cnt = snd_lim - offset; | ||
309 | } | ||
310 | } | ||
311 | |||
301 | mapped: | 312 | mapped: |
302 | if (cntp) | 313 | if (cntp) |
303 | *cntp = cnt; | 314 | *cntp = cnt; |
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c index 1eadadc13da8..a5e29dbb9537 100644 --- a/drivers/infiniband/hw/qib/qib_iba6120.c +++ b/drivers/infiniband/hw/qib/qib_iba6120.c | |||
@@ -1355,8 +1355,7 @@ static int qib_6120_bringup_serdes(struct qib_pportdata *ppd) | |||
1355 | hwstat = qib_read_kreg64(dd, kr_hwerrstatus); | 1355 | hwstat = qib_read_kreg64(dd, kr_hwerrstatus); |
1356 | if (hwstat) { | 1356 | if (hwstat) { |
1357 | /* should just have PLL, clear all set, in an case */ | 1357 | /* should just have PLL, clear all set, in an case */ |
1358 | if (hwstat & ~QLOGIC_IB_HWE_SERDESPLLFAILED) | 1358 | qib_write_kreg(dd, kr_hwerrclear, hwstat); |
1359 | qib_write_kreg(dd, kr_hwerrclear, hwstat); | ||
1360 | qib_write_kreg(dd, kr_errclear, ERR_MASK(HardwareErr)); | 1359 | qib_write_kreg(dd, kr_errclear, ERR_MASK(HardwareErr)); |
1361 | } | 1360 | } |
1362 | 1361 | ||
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c index 503992d9c5ce..5eedf83e2c3b 100644 --- a/drivers/infiniband/hw/qib/qib_iba7322.c +++ b/drivers/infiniband/hw/qib/qib_iba7322.c | |||
@@ -543,7 +543,7 @@ struct vendor_txdds_ent { | |||
543 | static void write_tx_serdes_param(struct qib_pportdata *, struct txdds_ent *); | 543 | static void write_tx_serdes_param(struct qib_pportdata *, struct txdds_ent *); |
544 | 544 | ||
545 | #define TXDDS_TABLE_SZ 16 /* number of entries per speed in onchip table */ | 545 | #define TXDDS_TABLE_SZ 16 /* number of entries per speed in onchip table */ |
546 | #define TXDDS_EXTRA_SZ 11 /* number of extra tx settings entries */ | 546 | #define TXDDS_EXTRA_SZ 13 /* number of extra tx settings entries */ |
547 | #define SERDES_CHANS 4 /* yes, it's obvious, but one less magic number */ | 547 | #define SERDES_CHANS 4 /* yes, it's obvious, but one less magic number */ |
548 | 548 | ||
549 | #define H1_FORCE_VAL 8 | 549 | #define H1_FORCE_VAL 8 |
@@ -1100,9 +1100,9 @@ static const struct qib_hwerror_msgs qib_7322_hwerror_msgs[] = { | |||
1100 | HWE_AUTO_P(SDmaMemReadErr, 1), | 1100 | HWE_AUTO_P(SDmaMemReadErr, 1), |
1101 | HWE_AUTO_P(SDmaMemReadErr, 0), | 1101 | HWE_AUTO_P(SDmaMemReadErr, 0), |
1102 | HWE_AUTO_P(IBCBusFromSPCParityErr, 1), | 1102 | HWE_AUTO_P(IBCBusFromSPCParityErr, 1), |
1103 | HWE_AUTO_P(IBCBusToSPCParityErr, 1), | ||
1103 | HWE_AUTO_P(IBCBusFromSPCParityErr, 0), | 1104 | HWE_AUTO_P(IBCBusFromSPCParityErr, 0), |
1104 | HWE_AUTO_P(statusValidNoEop, 1), | 1105 | HWE_AUTO(statusValidNoEop), |
1105 | HWE_AUTO_P(statusValidNoEop, 0), | ||
1106 | HWE_AUTO(LATriggered), | 1106 | HWE_AUTO(LATriggered), |
1107 | { .mask = 0 } | 1107 | { .mask = 0 } |
1108 | }; | 1108 | }; |
@@ -4763,6 +4763,8 @@ static void qib_7322_mini_pcs_reset(struct qib_pportdata *ppd) | |||
4763 | SYM_MASK(IBPCSConfig_0, tx_rx_reset); | 4763 | SYM_MASK(IBPCSConfig_0, tx_rx_reset); |
4764 | 4764 | ||
4765 | val = qib_read_kreg_port(ppd, krp_ib_pcsconfig); | 4765 | val = qib_read_kreg_port(ppd, krp_ib_pcsconfig); |
4766 | qib_write_kreg(dd, kr_hwerrmask, | ||
4767 | dd->cspec->hwerrmask & ~HWE_MASK(statusValidNoEop)); | ||
4766 | qib_write_kreg_port(ppd, krp_ibcctrl_a, | 4768 | qib_write_kreg_port(ppd, krp_ibcctrl_a, |
4767 | ppd->cpspec->ibcctrl_a & | 4769 | ppd->cpspec->ibcctrl_a & |
4768 | ~SYM_MASK(IBCCtrlA_0, IBLinkEn)); | 4770 | ~SYM_MASK(IBCCtrlA_0, IBLinkEn)); |
@@ -4772,6 +4774,9 @@ static void qib_7322_mini_pcs_reset(struct qib_pportdata *ppd) | |||
4772 | qib_write_kreg_port(ppd, krp_ib_pcsconfig, val & ~reset_bits); | 4774 | qib_write_kreg_port(ppd, krp_ib_pcsconfig, val & ~reset_bits); |
4773 | qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a); | 4775 | qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a); |
4774 | qib_write_kreg(dd, kr_scratch, 0ULL); | 4776 | qib_write_kreg(dd, kr_scratch, 0ULL); |
4777 | qib_write_kreg(dd, kr_hwerrclear, | ||
4778 | SYM_MASK(HwErrClear, statusValidNoEopClear)); | ||
4779 | qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); | ||
4775 | } | 4780 | } |
4776 | 4781 | ||
4777 | /* | 4782 | /* |
@@ -5624,6 +5629,8 @@ static void set_no_qsfp_atten(struct qib_devdata *dd, int change) | |||
5624 | if (ppd->port != port || !ppd->link_speed_supported) | 5629 | if (ppd->port != port || !ppd->link_speed_supported) |
5625 | continue; | 5630 | continue; |
5626 | ppd->cpspec->no_eep = val; | 5631 | ppd->cpspec->no_eep = val; |
5632 | if (seth1) | ||
5633 | ppd->cpspec->h1_val = h1; | ||
5627 | /* now change the IBC and serdes, overriding generic */ | 5634 | /* now change the IBC and serdes, overriding generic */ |
5628 | init_txdds_table(ppd, 1); | 5635 | init_txdds_table(ppd, 1); |
5629 | any++; | 5636 | any++; |
@@ -6064,9 +6071,9 @@ static int qib_init_7322_variables(struct qib_devdata *dd) | |||
6064 | * the "cable info" setup here. Can be overridden | 6071 | * the "cable info" setup here. Can be overridden |
6065 | * in adapter-specific routines. | 6072 | * in adapter-specific routines. |
6066 | */ | 6073 | */ |
6067 | if (!(ppd->dd->flags & QIB_HAS_QSFP)) { | 6074 | if (!(dd->flags & QIB_HAS_QSFP)) { |
6068 | if (!IS_QMH(ppd->dd) && !IS_QME(ppd->dd)) | 6075 | if (!IS_QMH(dd) && !IS_QME(dd)) |
6069 | qib_devinfo(ppd->dd->pcidev, "IB%u:%u: " | 6076 | qib_devinfo(dd->pcidev, "IB%u:%u: " |
6070 | "Unknown mezzanine card type\n", | 6077 | "Unknown mezzanine card type\n", |
6071 | dd->unit, ppd->port); | 6078 | dd->unit, ppd->port); |
6072 | cp->h1_val = IS_QMH(dd) ? H1_FORCE_QMH : H1_FORCE_QME; | 6079 | cp->h1_val = IS_QMH(dd) ? H1_FORCE_QMH : H1_FORCE_QME; |
@@ -6119,9 +6126,25 @@ static int qib_init_7322_variables(struct qib_devdata *dd) | |||
6119 | qib_set_ctxtcnt(dd); | 6126 | qib_set_ctxtcnt(dd); |
6120 | 6127 | ||
6121 | if (qib_wc_pat) { | 6128 | if (qib_wc_pat) { |
6122 | ret = init_chip_wc_pat(dd, NUM_VL15_BUFS * dd->align4k); | 6129 | resource_size_t vl15off; |
6130 | /* | ||
6131 | * We do not set WC on the VL15 buffers to avoid | ||
6132 | * a rare problem with unaligned writes from | ||
6133 | * interrupt-flushed store buffers, so we need | ||
6134 | * to map those separately here. We can't solve | ||
6135 | * this for the rarely used mtrr case. | ||
6136 | */ | ||
6137 | ret = init_chip_wc_pat(dd, 0); | ||
6123 | if (ret) | 6138 | if (ret) |
6124 | goto bail; | 6139 | goto bail; |
6140 | |||
6141 | /* vl15 buffers start just after the 4k buffers */ | ||
6142 | vl15off = dd->physaddr + (dd->piobufbase >> 32) + | ||
6143 | dd->piobcnt4k * dd->align4k; | ||
6144 | dd->piovl15base = ioremap_nocache(vl15off, | ||
6145 | NUM_VL15_BUFS * dd->align4k); | ||
6146 | if (!dd->piovl15base) | ||
6147 | goto bail; | ||
6125 | } | 6148 | } |
6126 | qib_7322_set_baseaddrs(dd); /* set chip access pointers now */ | 6149 | qib_7322_set_baseaddrs(dd); /* set chip access pointers now */ |
6127 | 6150 | ||
@@ -6932,6 +6955,8 @@ static const struct txdds_ent txdds_extra_sdr[TXDDS_EXTRA_SZ] = { | |||
6932 | { 0, 0, 0, 11 }, /* QME7342 backplane settings */ | 6955 | { 0, 0, 0, 11 }, /* QME7342 backplane settings */ |
6933 | { 0, 0, 0, 11 }, /* QME7342 backplane settings */ | 6956 | { 0, 0, 0, 11 }, /* QME7342 backplane settings */ |
6934 | { 0, 0, 0, 11 }, /* QME7342 backplane settings */ | 6957 | { 0, 0, 0, 11 }, /* QME7342 backplane settings */ |
6958 | { 0, 0, 0, 3 }, /* QMH7342 backplane settings */ | ||
6959 | { 0, 0, 0, 4 }, /* QMH7342 backplane settings */ | ||
6935 | }; | 6960 | }; |
6936 | 6961 | ||
6937 | static const struct txdds_ent txdds_extra_ddr[TXDDS_EXTRA_SZ] = { | 6962 | static const struct txdds_ent txdds_extra_ddr[TXDDS_EXTRA_SZ] = { |
@@ -6947,6 +6972,8 @@ static const struct txdds_ent txdds_extra_ddr[TXDDS_EXTRA_SZ] = { | |||
6947 | { 0, 0, 0, 13 }, /* QME7342 backplane settings */ | 6972 | { 0, 0, 0, 13 }, /* QME7342 backplane settings */ |
6948 | { 0, 0, 0, 13 }, /* QME7342 backplane settings */ | 6973 | { 0, 0, 0, 13 }, /* QME7342 backplane settings */ |
6949 | { 0, 0, 0, 13 }, /* QME7342 backplane settings */ | 6974 | { 0, 0, 0, 13 }, /* QME7342 backplane settings */ |
6975 | { 0, 0, 0, 9 }, /* QMH7342 backplane settings */ | ||
6976 | { 0, 0, 0, 10 }, /* QMH7342 backplane settings */ | ||
6950 | }; | 6977 | }; |
6951 | 6978 | ||
6952 | static const struct txdds_ent txdds_extra_qdr[TXDDS_EXTRA_SZ] = { | 6979 | static const struct txdds_ent txdds_extra_qdr[TXDDS_EXTRA_SZ] = { |
@@ -6962,6 +6989,8 @@ static const struct txdds_ent txdds_extra_qdr[TXDDS_EXTRA_SZ] = { | |||
6962 | { 0, 1, 12, 6 }, /* QME7342 backplane setting */ | 6989 | { 0, 1, 12, 6 }, /* QME7342 backplane setting */ |
6963 | { 0, 1, 12, 7 }, /* QME7342 backplane setting */ | 6990 | { 0, 1, 12, 7 }, /* QME7342 backplane setting */ |
6964 | { 0, 1, 12, 8 }, /* QME7342 backplane setting */ | 6991 | { 0, 1, 12, 8 }, /* QME7342 backplane setting */ |
6992 | { 0, 1, 0, 10 }, /* QMH7342 backplane settings */ | ||
6993 | { 0, 1, 0, 12 }, /* QMH7342 backplane settings */ | ||
6965 | }; | 6994 | }; |
6966 | 6995 | ||
6967 | static const struct txdds_ent *get_atten_table(const struct txdds_ent *txdds, | 6996 | static const struct txdds_ent *get_atten_table(const struct txdds_ent *txdds, |
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c index 9b40f345ac3f..a873dd596e81 100644 --- a/drivers/infiniband/hw/qib/qib_init.c +++ b/drivers/infiniband/hw/qib/qib_init.c | |||
@@ -1059,7 +1059,7 @@ static int __init qlogic_ib_init(void) | |||
1059 | goto bail_dev; | 1059 | goto bail_dev; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | qib_cq_wq = create_workqueue("qib_cq"); | 1062 | qib_cq_wq = create_singlethread_workqueue("qib_cq"); |
1063 | if (!qib_cq_wq) { | 1063 | if (!qib_cq_wq) { |
1064 | ret = -ENOMEM; | 1064 | ret = -ENOMEM; |
1065 | goto bail_wq; | 1065 | goto bail_wq; |
@@ -1289,8 +1289,18 @@ static int __devinit qib_init_one(struct pci_dev *pdev, | |||
1289 | 1289 | ||
1290 | if (qib_mini_init || initfail || ret) { | 1290 | if (qib_mini_init || initfail || ret) { |
1291 | qib_stop_timers(dd); | 1291 | qib_stop_timers(dd); |
1292 | flush_scheduled_work(); | ||
1292 | for (pidx = 0; pidx < dd->num_pports; ++pidx) | 1293 | for (pidx = 0; pidx < dd->num_pports; ++pidx) |
1293 | dd->f_quiet_serdes(dd->pport + pidx); | 1294 | dd->f_quiet_serdes(dd->pport + pidx); |
1295 | if (qib_mini_init) | ||
1296 | goto bail; | ||
1297 | if (!j) { | ||
1298 | (void) qibfs_remove(dd); | ||
1299 | qib_device_remove(dd); | ||
1300 | } | ||
1301 | if (!ret) | ||
1302 | qib_unregister_ib_device(dd); | ||
1303 | qib_postinit_cleanup(dd); | ||
1294 | if (initfail) | 1304 | if (initfail) |
1295 | ret = initfail; | 1305 | ret = initfail; |
1296 | goto bail; | 1306 | goto bail; |
@@ -1472,6 +1482,9 @@ int qib_setup_eagerbufs(struct qib_ctxtdata *rcd) | |||
1472 | dma_addr_t pa = rcd->rcvegrbuf_phys[chunk]; | 1482 | dma_addr_t pa = rcd->rcvegrbuf_phys[chunk]; |
1473 | unsigned i; | 1483 | unsigned i; |
1474 | 1484 | ||
1485 | /* clear for security and sanity on each use */ | ||
1486 | memset(rcd->rcvegrbuf[chunk], 0, size); | ||
1487 | |||
1475 | for (i = 0; e < egrcnt && i < egrperchunk; e++, i++) { | 1488 | for (i = 0; e < egrcnt && i < egrperchunk; e++, i++) { |
1476 | dd->f_put_tid(dd, e + egroff + | 1489 | dd->f_put_tid(dd, e + egroff + |
1477 | (u64 __iomem *) | 1490 | (u64 __iomem *) |
@@ -1499,6 +1512,12 @@ bail: | |||
1499 | return -ENOMEM; | 1512 | return -ENOMEM; |
1500 | } | 1513 | } |
1501 | 1514 | ||
1515 | /* | ||
1516 | * Note: Changes to this routine should be mirrored | ||
1517 | * for the diagnostics routine qib_remap_ioaddr32(). | ||
1518 | * There is also related code for VL15 buffers in qib_init_7322_variables(). | ||
1519 | * The teardown code that unmaps is in qib_pcie_ddcleanup() | ||
1520 | */ | ||
1502 | int init_chip_wc_pat(struct qib_devdata *dd, u32 vl15buflen) | 1521 | int init_chip_wc_pat(struct qib_devdata *dd, u32 vl15buflen) |
1503 | { | 1522 | { |
1504 | u64 __iomem *qib_kregbase = NULL; | 1523 | u64 __iomem *qib_kregbase = NULL; |
diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c index c926bf4541df..7fa6e5592630 100644 --- a/drivers/infiniband/hw/qib/qib_pcie.c +++ b/drivers/infiniband/hw/qib/qib_pcie.c | |||
@@ -179,6 +179,8 @@ void qib_pcie_ddcleanup(struct qib_devdata *dd) | |||
179 | iounmap(dd->piobase); | 179 | iounmap(dd->piobase); |
180 | if (dd->userbase) | 180 | if (dd->userbase) |
181 | iounmap(dd->userbase); | 181 | iounmap(dd->userbase); |
182 | if (dd->piovl15base) | ||
183 | iounmap(dd->piovl15base); | ||
182 | 184 | ||
183 | pci_disable_device(dd->pcidev); | 185 | pci_disable_device(dd->pcidev); |
184 | pci_release_regions(dd->pcidev); | 186 | pci_release_regions(dd->pcidev); |
diff --git a/drivers/infiniband/hw/qib/qib_sd7220.c b/drivers/infiniband/hw/qib/qib_sd7220.c index 0aeed0e74cb6..e9f9f8bc3204 100644 --- a/drivers/infiniband/hw/qib/qib_sd7220.c +++ b/drivers/infiniband/hw/qib/qib_sd7220.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. | 2 | * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation. |
3 | * All rights reserved. | ||
3 | * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. | 4 | * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. |
4 | * | 5 | * |
5 | * This software is available to you under a choice of one of two | 6 | * This software is available to you under a choice of one of two |
@@ -37,10 +38,14 @@ | |||
37 | 38 | ||
38 | #include <linux/pci.h> | 39 | #include <linux/pci.h> |
39 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
41 | #include <linux/firmware.h> | ||
40 | 42 | ||
41 | #include "qib.h" | 43 | #include "qib.h" |
42 | #include "qib_7220.h" | 44 | #include "qib_7220.h" |
43 | 45 | ||
46 | #define SD7220_FW_NAME "qlogic/sd7220.fw" | ||
47 | MODULE_FIRMWARE(SD7220_FW_NAME); | ||
48 | |||
44 | /* | 49 | /* |
45 | * Same as in qib_iba7220.c, but just the registers needed here. | 50 | * Same as in qib_iba7220.c, but just the registers needed here. |
46 | * Could move whole set to qib_7220.h, but decided better to keep | 51 | * Could move whole set to qib_7220.h, but decided better to keep |
@@ -102,6 +107,10 @@ static int qib_internal_presets(struct qib_devdata *dd); | |||
102 | /* Tweak the register (CMUCTRL5) that contains the TRIMSELF controls */ | 107 | /* Tweak the register (CMUCTRL5) that contains the TRIMSELF controls */ |
103 | static int qib_sd_trimself(struct qib_devdata *dd, int val); | 108 | static int qib_sd_trimself(struct qib_devdata *dd, int val); |
104 | static int epb_access(struct qib_devdata *dd, int sdnum, int claim); | 109 | static int epb_access(struct qib_devdata *dd, int sdnum, int claim); |
110 | static int qib_sd7220_ib_load(struct qib_devdata *dd, | ||
111 | const struct firmware *fw); | ||
112 | static int qib_sd7220_ib_vfy(struct qib_devdata *dd, | ||
113 | const struct firmware *fw); | ||
105 | 114 | ||
106 | /* | 115 | /* |
107 | * Below keeps track of whether the "once per power-on" initialization has | 116 | * Below keeps track of whether the "once per power-on" initialization has |
@@ -110,10 +119,13 @@ static int epb_access(struct qib_devdata *dd, int sdnum, int claim); | |||
110 | * state of the reset "pin", is no longer valid. Instead, we check for the | 119 | * state of the reset "pin", is no longer valid. Instead, we check for the |
111 | * actual uC code having been loaded. | 120 | * actual uC code having been loaded. |
112 | */ | 121 | */ |
113 | static int qib_ibsd_ucode_loaded(struct qib_pportdata *ppd) | 122 | static int qib_ibsd_ucode_loaded(struct qib_pportdata *ppd, |
123 | const struct firmware *fw) | ||
114 | { | 124 | { |
115 | struct qib_devdata *dd = ppd->dd; | 125 | struct qib_devdata *dd = ppd->dd; |
116 | if (!dd->cspec->serdes_first_init_done && (qib_sd7220_ib_vfy(dd) > 0)) | 126 | |
127 | if (!dd->cspec->serdes_first_init_done && | ||
128 | qib_sd7220_ib_vfy(dd, fw) > 0) | ||
117 | dd->cspec->serdes_first_init_done = 1; | 129 | dd->cspec->serdes_first_init_done = 1; |
118 | return dd->cspec->serdes_first_init_done; | 130 | return dd->cspec->serdes_first_init_done; |
119 | } | 131 | } |
@@ -377,6 +389,7 @@ static void qib_sd_trimdone_monitor(struct qib_devdata *dd, | |||
377 | */ | 389 | */ |
378 | int qib_sd7220_init(struct qib_devdata *dd) | 390 | int qib_sd7220_init(struct qib_devdata *dd) |
379 | { | 391 | { |
392 | const struct firmware *fw; | ||
380 | int ret = 1; /* default to failure */ | 393 | int ret = 1; /* default to failure */ |
381 | int first_reset, was_reset; | 394 | int first_reset, was_reset; |
382 | 395 | ||
@@ -387,8 +400,15 @@ int qib_sd7220_init(struct qib_devdata *dd) | |||
387 | qib_ibsd_reset(dd, 1); | 400 | qib_ibsd_reset(dd, 1); |
388 | qib_sd_trimdone_monitor(dd, "Driver-reload"); | 401 | qib_sd_trimdone_monitor(dd, "Driver-reload"); |
389 | } | 402 | } |
403 | |||
404 | ret = request_firmware(&fw, SD7220_FW_NAME, &dd->pcidev->dev); | ||
405 | if (ret) { | ||
406 | qib_dev_err(dd, "Failed to load IB SERDES image\n"); | ||
407 | goto done; | ||
408 | } | ||
409 | |||
390 | /* Substitute our deduced value for was_reset */ | 410 | /* Substitute our deduced value for was_reset */ |
391 | ret = qib_ibsd_ucode_loaded(dd->pport); | 411 | ret = qib_ibsd_ucode_loaded(dd->pport, fw); |
392 | if (ret < 0) | 412 | if (ret < 0) |
393 | goto bail; | 413 | goto bail; |
394 | 414 | ||
@@ -437,13 +457,13 @@ int qib_sd7220_init(struct qib_devdata *dd) | |||
437 | int vfy; | 457 | int vfy; |
438 | int trim_done; | 458 | int trim_done; |
439 | 459 | ||
440 | ret = qib_sd7220_ib_load(dd); | 460 | ret = qib_sd7220_ib_load(dd, fw); |
441 | if (ret < 0) { | 461 | if (ret < 0) { |
442 | qib_dev_err(dd, "Failed to load IB SERDES image\n"); | 462 | qib_dev_err(dd, "Failed to load IB SERDES image\n"); |
443 | goto bail; | 463 | goto bail; |
444 | } else { | 464 | } else { |
445 | /* Loaded image, try to verify */ | 465 | /* Loaded image, try to verify */ |
446 | vfy = qib_sd7220_ib_vfy(dd); | 466 | vfy = qib_sd7220_ib_vfy(dd, fw); |
447 | if (vfy != ret) { | 467 | if (vfy != ret) { |
448 | qib_dev_err(dd, "SERDES PRAM VFY failed\n"); | 468 | qib_dev_err(dd, "SERDES PRAM VFY failed\n"); |
449 | goto bail; | 469 | goto bail; |
@@ -506,6 +526,8 @@ bail: | |||
506 | done: | 526 | done: |
507 | /* start relock timer regardless, but start at 1 second */ | 527 | /* start relock timer regardless, but start at 1 second */ |
508 | set_7220_relock_poll(dd, -1); | 528 | set_7220_relock_poll(dd, -1); |
529 | |||
530 | release_firmware(fw); | ||
509 | return ret; | 531 | return ret; |
510 | } | 532 | } |
511 | 533 | ||
@@ -829,8 +851,8 @@ static int qib_sd7220_ram_xfer(struct qib_devdata *dd, int sdnum, u32 loc, | |||
829 | 851 | ||
830 | #define PROG_CHUNK 64 | 852 | #define PROG_CHUNK 64 |
831 | 853 | ||
832 | int qib_sd7220_prog_ld(struct qib_devdata *dd, int sdnum, | 854 | static int qib_sd7220_prog_ld(struct qib_devdata *dd, int sdnum, |
833 | u8 *img, int len, int offset) | 855 | const u8 *img, int len, int offset) |
834 | { | 856 | { |
835 | int cnt, sofar, req; | 857 | int cnt, sofar, req; |
836 | 858 | ||
@@ -840,7 +862,7 @@ int qib_sd7220_prog_ld(struct qib_devdata *dd, int sdnum, | |||
840 | if (req > PROG_CHUNK) | 862 | if (req > PROG_CHUNK) |
841 | req = PROG_CHUNK; | 863 | req = PROG_CHUNK; |
842 | cnt = qib_sd7220_ram_xfer(dd, sdnum, offset + sofar, | 864 | cnt = qib_sd7220_ram_xfer(dd, sdnum, offset + sofar, |
843 | img + sofar, req, 0); | 865 | (u8 *)img + sofar, req, 0); |
844 | if (cnt < req) { | 866 | if (cnt < req) { |
845 | sofar = -1; | 867 | sofar = -1; |
846 | break; | 868 | break; |
@@ -853,8 +875,8 @@ int qib_sd7220_prog_ld(struct qib_devdata *dd, int sdnum, | |||
853 | #define VFY_CHUNK 64 | 875 | #define VFY_CHUNK 64 |
854 | #define SD_PRAM_ERROR_LIMIT 42 | 876 | #define SD_PRAM_ERROR_LIMIT 42 |
855 | 877 | ||
856 | int qib_sd7220_prog_vfy(struct qib_devdata *dd, int sdnum, | 878 | static int qib_sd7220_prog_vfy(struct qib_devdata *dd, int sdnum, |
857 | const u8 *img, int len, int offset) | 879 | const u8 *img, int len, int offset) |
858 | { | 880 | { |
859 | int cnt, sofar, req, idx, errors; | 881 | int cnt, sofar, req, idx, errors; |
860 | unsigned char readback[VFY_CHUNK]; | 882 | unsigned char readback[VFY_CHUNK]; |
@@ -881,6 +903,18 @@ int qib_sd7220_prog_vfy(struct qib_devdata *dd, int sdnum, | |||
881 | return errors ? -errors : sofar; | 903 | return errors ? -errors : sofar; |
882 | } | 904 | } |
883 | 905 | ||
906 | static int | ||
907 | qib_sd7220_ib_load(struct qib_devdata *dd, const struct firmware *fw) | ||
908 | { | ||
909 | return qib_sd7220_prog_ld(dd, IB_7220_SERDES, fw->data, fw->size, 0); | ||
910 | } | ||
911 | |||
912 | static int | ||
913 | qib_sd7220_ib_vfy(struct qib_devdata *dd, const struct firmware *fw) | ||
914 | { | ||
915 | return qib_sd7220_prog_vfy(dd, IB_7220_SERDES, fw->data, fw->size, 0); | ||
916 | } | ||
917 | |||
884 | /* | 918 | /* |
885 | * IRQ not set up at this point in init, so we poll. | 919 | * IRQ not set up at this point in init, so we poll. |
886 | */ | 920 | */ |
diff --git a/drivers/infiniband/hw/qib/qib_sd7220_img.c b/drivers/infiniband/hw/qib/qib_sd7220_img.c deleted file mode 100644 index a1118fbd2370..000000000000 --- a/drivers/infiniband/hw/qib/qib_sd7220_img.c +++ /dev/null | |||
@@ -1,1081 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2007, 2008 QLogic Corporation. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | * This file contains the memory image from the vendor, to be copied into | ||
35 | * the IB SERDES of the IBA7220 during initialization. | ||
36 | * The file also includes the two functions which use this image. | ||
37 | */ | ||
38 | #include <linux/pci.h> | ||
39 | #include <linux/delay.h> | ||
40 | |||
41 | #include "qib.h" | ||
42 | #include "qib_7220.h" | ||
43 | |||
44 | static unsigned char qib_sd7220_ib_img[] = { | ||
45 | /*0000*/0x02, 0x0A, 0x29, 0x02, 0x0A, 0x87, 0xE5, 0xE6, | ||
46 | 0x30, 0xE6, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, | ||
47 | /*0010*/0x00, 0xE5, 0xE2, 0x30, 0xE4, 0x04, 0x7E, 0x01, | ||
48 | 0x80, 0x02, 0x7E, 0x00, 0xEE, 0x5F, 0x60, 0x08, | ||
49 | /*0020*/0x53, 0xF9, 0xF7, 0xE4, 0xF5, 0xFE, 0x80, 0x08, | ||
50 | 0x7F, 0x0A, 0x12, 0x17, 0x31, 0x12, 0x0E, 0xA2, | ||
51 | /*0030*/0x75, 0xFC, 0x08, 0xE4, 0xF5, 0xFD, 0xE5, 0xE7, | ||
52 | 0x20, 0xE7, 0x03, 0x43, 0xF9, 0x08, 0x22, 0x00, | ||
53 | /*0040*/0x01, 0x20, 0x11, 0x00, 0x04, 0x20, 0x00, 0x75, | ||
54 | 0x51, 0x01, 0xE4, 0xF5, 0x52, 0xF5, 0x53, 0xF5, | ||
55 | /*0050*/0x52, 0xF5, 0x7E, 0x7F, 0x04, 0x02, 0x04, 0x38, | ||
56 | 0xC2, 0x36, 0x05, 0x52, 0xE5, 0x52, 0xD3, 0x94, | ||
57 | /*0060*/0x0C, 0x40, 0x05, 0x75, 0x52, 0x01, 0xD2, 0x36, | ||
58 | 0x90, 0x07, 0x0C, 0x74, 0x07, 0xF0, 0xA3, 0x74, | ||
59 | /*0070*/0xFF, 0xF0, 0xE4, 0xF5, 0x0C, 0xA3, 0xF0, 0x90, | ||
60 | 0x07, 0x14, 0xF0, 0xA3, 0xF0, 0x75, 0x0B, 0x20, | ||
61 | /*0080*/0xF5, 0x09, 0xE4, 0xF5, 0x08, 0xE5, 0x08, 0xD3, | ||
62 | 0x94, 0x30, 0x40, 0x03, 0x02, 0x04, 0x04, 0x12, | ||
63 | /*0090*/0x00, 0x06, 0x15, 0x0B, 0xE5, 0x08, 0x70, 0x04, | ||
64 | 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xE5, 0x09, | ||
65 | /*00A0*/0x70, 0x04, 0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, | ||
66 | 0xEE, 0x5F, 0x60, 0x05, 0x12, 0x18, 0x71, 0xD2, | ||
67 | /*00B0*/0x35, 0x53, 0xE1, 0xF7, 0xE5, 0x08, 0x45, 0x09, | ||
68 | 0xFF, 0xE5, 0x0B, 0x25, 0xE0, 0x25, 0xE0, 0x24, | ||
69 | /*00C0*/0x83, 0xF5, 0x82, 0xE4, 0x34, 0x07, 0xF5, 0x83, | ||
70 | 0xEF, 0xF0, 0x85, 0xE2, 0x20, 0xE5, 0x52, 0xD3, | ||
71 | /*00D0*/0x94, 0x01, 0x40, 0x0D, 0x12, 0x19, 0xF3, 0xE0, | ||
72 | 0x54, 0xA0, 0x64, 0x40, 0x70, 0x03, 0x02, 0x03, | ||
73 | /*00E0*/0xFB, 0x53, 0xF9, 0xF8, 0x90, 0x94, 0x70, 0xE4, | ||
74 | 0xF0, 0xE0, 0xF5, 0x10, 0xAF, 0x09, 0x12, 0x1E, | ||
75 | /*00F0*/0xB3, 0xAF, 0x08, 0xEF, 0x44, 0x08, 0xF5, 0x82, | ||
76 | 0x75, 0x83, 0x80, 0xE0, 0xF5, 0x29, 0xEF, 0x44, | ||
77 | /*0100*/0x07, 0x12, 0x1A, 0x3C, 0xF5, 0x22, 0x54, 0x40, | ||
78 | 0xD3, 0x94, 0x00, 0x40, 0x1E, 0xE5, 0x29, 0x54, | ||
79 | /*0110*/0xF0, 0x70, 0x21, 0x12, 0x19, 0xF3, 0xE0, 0x44, | ||
80 | 0x80, 0xF0, 0xE5, 0x22, 0x54, 0x30, 0x65, 0x08, | ||
81 | /*0120*/0x70, 0x09, 0x12, 0x19, 0xF3, 0xE0, 0x54, 0xBF, | ||
82 | 0xF0, 0x80, 0x09, 0x12, 0x19, 0xF3, 0x74, 0x40, | ||
83 | /*0130*/0xF0, 0x02, 0x03, 0xFB, 0x12, 0x1A, 0x12, 0x75, | ||
84 | 0x83, 0xAE, 0x74, 0xFF, 0xF0, 0xAF, 0x08, 0x7E, | ||
85 | /*0140*/0x00, 0xEF, 0x44, 0x07, 0xF5, 0x82, 0xE0, 0xFD, | ||
86 | 0xE5, 0x0B, 0x25, 0xE0, 0x25, 0xE0, 0x24, 0x81, | ||
87 | /*0150*/0xF5, 0x82, 0xE4, 0x34, 0x07, 0xF5, 0x83, 0xED, | ||
88 | 0xF0, 0x90, 0x07, 0x0E, 0xE0, 0x04, 0xF0, 0xEF, | ||
89 | /*0160*/0x44, 0x07, 0xF5, 0x82, 0x75, 0x83, 0x98, 0xE0, | ||
90 | 0xF5, 0x28, 0x12, 0x1A, 0x23, 0x40, 0x0C, 0x12, | ||
91 | /*0170*/0x19, 0xF3, 0xE0, 0x44, 0x01, 0x12, 0x1A, 0x32, | ||
92 | 0x02, 0x03, 0xF6, 0xAF, 0x08, 0x7E, 0x00, 0x74, | ||
93 | /*0180*/0x80, 0xCD, 0xEF, 0xCD, 0x8D, 0x82, 0xF5, 0x83, | ||
94 | 0xE0, 0x30, 0xE0, 0x0A, 0x12, 0x19, 0xF3, 0xE0, | ||
95 | /*0190*/0x44, 0x20, 0xF0, 0x02, 0x03, 0xFB, 0x12, 0x19, | ||
96 | 0xF3, 0xE0, 0x54, 0xDF, 0xF0, 0xEE, 0x44, 0xAE, | ||
97 | /*01A0*/0x12, 0x1A, 0x43, 0x30, 0xE4, 0x03, 0x02, 0x03, | ||
98 | 0xFB, 0x74, 0x9E, 0x12, 0x1A, 0x05, 0x20, 0xE0, | ||
99 | /*01B0*/0x03, 0x02, 0x03, 0xFB, 0x8F, 0x82, 0x8E, 0x83, | ||
100 | 0xE0, 0x20, 0xE0, 0x03, 0x02, 0x03, 0xFB, 0x12, | ||
101 | /*01C0*/0x19, 0xF3, 0xE0, 0x44, 0x10, 0xF0, 0xE5, 0xE3, | ||
102 | 0x20, 0xE7, 0x08, 0xE5, 0x08, 0x12, 0x1A, 0x3A, | ||
103 | /*01D0*/0x44, 0x04, 0xF0, 0xAF, 0x08, 0x7E, 0x00, 0xEF, | ||
104 | 0x12, 0x1A, 0x3A, 0x20, 0xE2, 0x34, 0x12, 0x19, | ||
105 | /*01E0*/0xF3, 0xE0, 0x44, 0x08, 0xF0, 0xE5, 0xE4, 0x30, | ||
106 | 0xE6, 0x04, 0x7D, 0x01, 0x80, 0x02, 0x7D, 0x00, | ||
107 | /*01F0*/0xE5, 0x7E, 0xC3, 0x94, 0x04, 0x50, 0x04, 0x7C, | ||
108 | 0x01, 0x80, 0x02, 0x7C, 0x00, 0xEC, 0x4D, 0x60, | ||
109 | /*0200*/0x05, 0xC2, 0x35, 0x02, 0x03, 0xFB, 0xEE, 0x44, | ||
110 | 0xD2, 0x12, 0x1A, 0x43, 0x44, 0x40, 0xF0, 0x02, | ||
111 | /*0210*/0x03, 0xFB, 0x12, 0x19, 0xF3, 0xE0, 0x54, 0xF7, | ||
112 | 0xF0, 0x12, 0x1A, 0x12, 0x75, 0x83, 0xD2, 0xE0, | ||
113 | /*0220*/0x54, 0xBF, 0xF0, 0x90, 0x07, 0x14, 0xE0, 0x04, | ||
114 | 0xF0, 0xE5, 0x7E, 0x70, 0x03, 0x75, 0x7E, 0x01, | ||
115 | /*0230*/0xAF, 0x08, 0x7E, 0x00, 0x12, 0x1A, 0x23, 0x40, | ||
116 | 0x12, 0x12, 0x19, 0xF3, 0xE0, 0x44, 0x01, 0x12, | ||
117 | /*0240*/0x19, 0xF2, 0xE0, 0x54, 0x02, 0x12, 0x1A, 0x32, | ||
118 | 0x02, 0x03, 0xFB, 0x12, 0x19, 0xF3, 0xE0, 0x44, | ||
119 | /*0250*/0x02, 0x12, 0x19, 0xF2, 0xE0, 0x54, 0xFE, 0xF0, | ||
120 | 0xC2, 0x35, 0xEE, 0x44, 0x8A, 0x8F, 0x82, 0xF5, | ||
121 | /*0260*/0x83, 0xE0, 0xF5, 0x17, 0x54, 0x8F, 0x44, 0x40, | ||
122 | 0xF0, 0x74, 0x90, 0xFC, 0xE5, 0x08, 0x44, 0x07, | ||
123 | /*0270*/0xFD, 0xF5, 0x82, 0x8C, 0x83, 0xE0, 0x54, 0x3F, | ||
124 | 0x90, 0x07, 0x02, 0xF0, 0xE0, 0x54, 0xC0, 0x8D, | ||
125 | /*0280*/0x82, 0x8C, 0x83, 0xF0, 0x74, 0x92, 0x12, 0x1A, | ||
126 | 0x05, 0x90, 0x07, 0x03, 0x12, 0x1A, 0x19, 0x74, | ||
127 | /*0290*/0x82, 0x12, 0x1A, 0x05, 0x90, 0x07, 0x04, 0x12, | ||
128 | 0x1A, 0x19, 0x74, 0xB4, 0x12, 0x1A, 0x05, 0x90, | ||
129 | /*02A0*/0x07, 0x05, 0x12, 0x1A, 0x19, 0x74, 0x94, 0xFE, | ||
130 | 0xE5, 0x08, 0x44, 0x06, 0x12, 0x1A, 0x0A, 0xF5, | ||
131 | /*02B0*/0x10, 0x30, 0xE0, 0x04, 0xD2, 0x37, 0x80, 0x02, | ||
132 | 0xC2, 0x37, 0xE5, 0x10, 0x54, 0x7F, 0x8F, 0x82, | ||
133 | /*02C0*/0x8E, 0x83, 0xF0, 0x30, 0x44, 0x30, 0x12, 0x1A, | ||
134 | 0x03, 0x54, 0x80, 0xD3, 0x94, 0x00, 0x40, 0x04, | ||
135 | /*02D0*/0xD2, 0x39, 0x80, 0x02, 0xC2, 0x39, 0x8F, 0x82, | ||
136 | 0x8E, 0x83, 0xE0, 0x44, 0x80, 0xF0, 0x12, 0x1A, | ||
137 | /*02E0*/0x03, 0x54, 0x40, 0xD3, 0x94, 0x00, 0x40, 0x04, | ||
138 | 0xD2, 0x3A, 0x80, 0x02, 0xC2, 0x3A, 0x8F, 0x82, | ||
139 | /*02F0*/0x8E, 0x83, 0xE0, 0x44, 0x40, 0xF0, 0x74, 0x92, | ||
140 | 0xFE, 0xE5, 0x08, 0x44, 0x06, 0x12, 0x1A, 0x0A, | ||
141 | /*0300*/0x30, 0xE7, 0x04, 0xD2, 0x38, 0x80, 0x02, 0xC2, | ||
142 | 0x38, 0x8F, 0x82, 0x8E, 0x83, 0xE0, 0x54, 0x7F, | ||
143 | /*0310*/0xF0, 0x12, 0x1E, 0x46, 0xE4, 0xF5, 0x0A, 0x20, | ||
144 | 0x03, 0x02, 0x80, 0x03, 0x30, 0x43, 0x03, 0x12, | ||
145 | /*0320*/0x19, 0x95, 0x20, 0x02, 0x02, 0x80, 0x03, 0x30, | ||
146 | 0x42, 0x03, 0x12, 0x0C, 0x8F, 0x30, 0x30, 0x06, | ||
147 | /*0330*/0x12, 0x19, 0x95, 0x12, 0x0C, 0x8F, 0x12, 0x0D, | ||
148 | 0x47, 0x12, 0x19, 0xF3, 0xE0, 0x54, 0xFB, 0xF0, | ||
149 | /*0340*/0xE5, 0x0A, 0xC3, 0x94, 0x01, 0x40, 0x46, 0x43, | ||
150 | 0xE1, 0x08, 0x12, 0x19, 0xF3, 0xE0, 0x44, 0x04, | ||
151 | /*0350*/0xF0, 0xE5, 0xE4, 0x20, 0xE7, 0x2A, 0x12, 0x1A, | ||
152 | 0x12, 0x75, 0x83, 0xD2, 0xE0, 0x54, 0x08, 0xD3, | ||
153 | /*0360*/0x94, 0x00, 0x40, 0x04, 0x7F, 0x01, 0x80, 0x02, | ||
154 | 0x7F, 0x00, 0xE5, 0x0A, 0xC3, 0x94, 0x01, 0x40, | ||
155 | /*0370*/0x04, 0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEF, | ||
156 | 0x5E, 0x60, 0x05, 0x12, 0x1D, 0xD7, 0x80, 0x17, | ||
157 | /*0380*/0x12, 0x1A, 0x12, 0x75, 0x83, 0xD2, 0xE0, 0x44, | ||
158 | 0x08, 0xF0, 0x02, 0x03, 0xFB, 0x12, 0x1A, 0x12, | ||
159 | /*0390*/0x75, 0x83, 0xD2, 0xE0, 0x54, 0xF7, 0xF0, 0x12, | ||
160 | 0x1E, 0x46, 0x7F, 0x08, 0x12, 0x17, 0x31, 0x74, | ||
161 | /*03A0*/0x8E, 0xFE, 0x12, 0x1A, 0x12, 0x8E, 0x83, 0xE0, | ||
162 | 0xF5, 0x10, 0x54, 0xFE, 0xF0, 0xE5, 0x10, 0x44, | ||
163 | /*03B0*/0x01, 0xFF, 0xE5, 0x08, 0xFD, 0xED, 0x44, 0x07, | ||
164 | 0xF5, 0x82, 0xEF, 0xF0, 0xE5, 0x10, 0x54, 0xFE, | ||
165 | /*03C0*/0xFF, 0xED, 0x44, 0x07, 0xF5, 0x82, 0xEF, 0x12, | ||
166 | 0x1A, 0x11, 0x75, 0x83, 0x86, 0xE0, 0x44, 0x10, | ||
167 | /*03D0*/0x12, 0x1A, 0x11, 0xE0, 0x44, 0x10, 0xF0, 0x12, | ||
168 | 0x19, 0xF3, 0xE0, 0x54, 0xFD, 0x44, 0x01, 0xFF, | ||
169 | /*03E0*/0x12, 0x19, 0xF3, 0xEF, 0x12, 0x1A, 0x32, 0x30, | ||
170 | 0x32, 0x0C, 0xE5, 0x08, 0x44, 0x08, 0xF5, 0x82, | ||
171 | /*03F0*/0x75, 0x83, 0x82, 0x74, 0x05, 0xF0, 0xAF, 0x0B, | ||
172 | 0x12, 0x18, 0xD7, 0x74, 0x10, 0x25, 0x08, 0xF5, | ||
173 | /*0400*/0x08, 0x02, 0x00, 0x85, 0x05, 0x09, 0xE5, 0x09, | ||
174 | 0xD3, 0x94, 0x07, 0x50, 0x03, 0x02, 0x00, 0x82, | ||
175 | /*0410*/0xE5, 0x7E, 0xD3, 0x94, 0x00, 0x40, 0x04, 0x7F, | ||
176 | 0x01, 0x80, 0x02, 0x7F, 0x00, 0xE5, 0x7E, 0xC3, | ||
177 | /*0420*/0x94, 0xFA, 0x50, 0x04, 0x7E, 0x01, 0x80, 0x02, | ||
178 | 0x7E, 0x00, 0xEE, 0x5F, 0x60, 0x02, 0x05, 0x7E, | ||
179 | /*0430*/0x30, 0x35, 0x0B, 0x43, 0xE1, 0x01, 0x7F, 0x09, | ||
180 | 0x12, 0x17, 0x31, 0x02, 0x00, 0x58, 0x53, 0xE1, | ||
181 | /*0440*/0xFE, 0x02, 0x00, 0x58, 0x8E, 0x6A, 0x8F, 0x6B, | ||
182 | 0x8C, 0x6C, 0x8D, 0x6D, 0x75, 0x6E, 0x01, 0x75, | ||
183 | /*0450*/0x6F, 0x01, 0x75, 0x70, 0x01, 0xE4, 0xF5, 0x73, | ||
184 | 0xF5, 0x74, 0xF5, 0x75, 0x90, 0x07, 0x2F, 0xF0, | ||
185 | /*0460*/0xF5, 0x3C, 0xF5, 0x3E, 0xF5, 0x46, 0xF5, 0x47, | ||
186 | 0xF5, 0x3D, 0xF5, 0x3F, 0xF5, 0x6F, 0xE5, 0x6F, | ||
187 | /*0470*/0x70, 0x0F, 0xE5, 0x6B, 0x45, 0x6A, 0x12, 0x07, | ||
188 | 0x2A, 0x75, 0x83, 0x80, 0x74, 0x3A, 0xF0, 0x80, | ||
189 | /*0480*/0x09, 0x12, 0x07, 0x2A, 0x75, 0x83, 0x80, 0x74, | ||
190 | 0x1A, 0xF0, 0xE4, 0xF5, 0x6E, 0xC3, 0x74, 0x3F, | ||
191 | /*0490*/0x95, 0x6E, 0xFF, 0x12, 0x08, 0x65, 0x75, 0x83, | ||
192 | 0x82, 0xEF, 0xF0, 0x12, 0x1A, 0x4D, 0x12, 0x08, | ||
193 | /*04A0*/0xC6, 0xE5, 0x33, 0xF0, 0x12, 0x08, 0xFA, 0x12, | ||
194 | 0x08, 0xB1, 0x40, 0xE1, 0xE5, 0x6F, 0x70, 0x0B, | ||
195 | /*04B0*/0x12, 0x07, 0x2A, 0x75, 0x83, 0x80, 0x74, 0x36, | ||
196 | 0xF0, 0x80, 0x09, 0x12, 0x07, 0x2A, 0x75, 0x83, | ||
197 | /*04C0*/0x80, 0x74, 0x16, 0xF0, 0x75, 0x6E, 0x01, 0x12, | ||
198 | 0x07, 0x2A, 0x75, 0x83, 0xB4, 0xE5, 0x6E, 0xF0, | ||
199 | /*04D0*/0x12, 0x1A, 0x4D, 0x74, 0x3F, 0x25, 0x6E, 0xF5, | ||
200 | 0x82, 0xE4, 0x34, 0x00, 0xF5, 0x83, 0xE5, 0x33, | ||
201 | /*04E0*/0xF0, 0x74, 0xBF, 0x25, 0x6E, 0xF5, 0x82, 0xE4, | ||
202 | 0x34, 0x00, 0x12, 0x08, 0xB1, 0x40, 0xD8, 0xE4, | ||
203 | /*04F0*/0xF5, 0x70, 0xF5, 0x46, 0xF5, 0x47, 0xF5, 0x6E, | ||
204 | 0x12, 0x08, 0xFA, 0xF5, 0x83, 0xE0, 0xFE, 0x12, | ||
205 | /*0500*/0x08, 0xC6, 0xE0, 0x7C, 0x00, 0x24, 0x00, 0xFF, | ||
206 | 0xEC, 0x3E, 0xFE, 0xAD, 0x3B, 0xD3, 0xEF, 0x9D, | ||
207 | /*0510*/0xEE, 0x9C, 0x50, 0x04, 0x7B, 0x01, 0x80, 0x02, | ||
208 | 0x7B, 0x00, 0xE5, 0x70, 0x70, 0x04, 0x7A, 0x01, | ||
209 | /*0520*/0x80, 0x02, 0x7A, 0x00, 0xEB, 0x5A, 0x60, 0x06, | ||
210 | 0x85, 0x6E, 0x46, 0x75, 0x70, 0x01, 0xD3, 0xEF, | ||
211 | /*0530*/0x9D, 0xEE, 0x9C, 0x50, 0x04, 0x7F, 0x01, 0x80, | ||
212 | 0x02, 0x7F, 0x00, 0xE5, 0x70, 0xB4, 0x01, 0x04, | ||
213 | /*0540*/0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEF, 0x5E, | ||
214 | 0x60, 0x03, 0x85, 0x6E, 0x47, 0x05, 0x6E, 0xE5, | ||
215 | /*0550*/0x6E, 0x64, 0x7F, 0x70, 0xA3, 0xE5, 0x46, 0x60, | ||
216 | 0x05, 0xE5, 0x47, 0xB4, 0x7E, 0x03, 0x85, 0x46, | ||
217 | /*0560*/0x47, 0xE5, 0x6F, 0x70, 0x08, 0x85, 0x46, 0x76, | ||
218 | 0x85, 0x47, 0x77, 0x80, 0x0E, 0xC3, 0x74, 0x7F, | ||
219 | /*0570*/0x95, 0x46, 0xF5, 0x78, 0xC3, 0x74, 0x7F, 0x95, | ||
220 | 0x47, 0xF5, 0x79, 0xE5, 0x6F, 0x70, 0x37, 0xE5, | ||
221 | /*0580*/0x46, 0x65, 0x47, 0x70, 0x0C, 0x75, 0x73, 0x01, | ||
222 | 0x75, 0x74, 0x01, 0xF5, 0x3C, 0xF5, 0x3D, 0x80, | ||
223 | /*0590*/0x35, 0xE4, 0xF5, 0x4E, 0xC3, 0xE5, 0x47, 0x95, | ||
224 | 0x46, 0xF5, 0x3C, 0xC3, 0x13, 0xF5, 0x71, 0x25, | ||
225 | /*05A0*/0x46, 0xF5, 0x72, 0xC3, 0x94, 0x3F, 0x40, 0x05, | ||
226 | 0xE4, 0xF5, 0x3D, 0x80, 0x40, 0xC3, 0x74, 0x3F, | ||
227 | /*05B0*/0x95, 0x72, 0xF5, 0x3D, 0x80, 0x37, 0xE5, 0x46, | ||
228 | 0x65, 0x47, 0x70, 0x0F, 0x75, 0x73, 0x01, 0x75, | ||
229 | /*05C0*/0x75, 0x01, 0xF5, 0x3E, 0xF5, 0x3F, 0x75, 0x4E, | ||
230 | 0x01, 0x80, 0x22, 0xE4, 0xF5, 0x4E, 0xC3, 0xE5, | ||
231 | /*05D0*/0x47, 0x95, 0x46, 0xF5, 0x3E, 0xC3, 0x13, 0xF5, | ||
232 | 0x71, 0x25, 0x46, 0xF5, 0x72, 0xD3, 0x94, 0x3F, | ||
233 | /*05E0*/0x50, 0x05, 0xE4, 0xF5, 0x3F, 0x80, 0x06, 0xE5, | ||
234 | 0x72, 0x24, 0xC1, 0xF5, 0x3F, 0x05, 0x6F, 0xE5, | ||
235 | /*05F0*/0x6F, 0xC3, 0x94, 0x02, 0x50, 0x03, 0x02, 0x04, | ||
236 | 0x6E, 0xE5, 0x6D, 0x45, 0x6C, 0x70, 0x02, 0x80, | ||
237 | /*0600*/0x04, 0xE5, 0x74, 0x45, 0x75, 0x90, 0x07, 0x2F, | ||
238 | 0xF0, 0x7F, 0x01, 0xE5, 0x3E, 0x60, 0x04, 0xE5, | ||
239 | /*0610*/0x3C, 0x70, 0x14, 0xE4, 0xF5, 0x3C, 0xF5, 0x3D, | ||
240 | 0xF5, 0x3E, 0xF5, 0x3F, 0x12, 0x08, 0xD2, 0x70, | ||
241 | /*0620*/0x04, 0xF0, 0x02, 0x06, 0xA4, 0x80, 0x7A, 0xE5, | ||
242 | 0x3C, 0xC3, 0x95, 0x3E, 0x40, 0x07, 0xE5, 0x3C, | ||
243 | /*0630*/0x95, 0x3E, 0xFF, 0x80, 0x06, 0xC3, 0xE5, 0x3E, | ||
244 | 0x95, 0x3C, 0xFF, 0xE5, 0x76, 0xD3, 0x95, 0x79, | ||
245 | /*0640*/0x40, 0x05, 0x85, 0x76, 0x7A, 0x80, 0x03, 0x85, | ||
246 | 0x79, 0x7A, 0xE5, 0x77, 0xC3, 0x95, 0x78, 0x50, | ||
247 | /*0650*/0x05, 0x85, 0x77, 0x7B, 0x80, 0x03, 0x85, 0x78, | ||
248 | 0x7B, 0xE5, 0x7B, 0xD3, 0x95, 0x7A, 0x40, 0x30, | ||
249 | /*0660*/0xE5, 0x7B, 0x95, 0x7A, 0xF5, 0x3C, 0xF5, 0x3E, | ||
250 | 0xC3, 0xE5, 0x7B, 0x95, 0x7A, 0x90, 0x07, 0x19, | ||
251 | /*0670*/0xF0, 0xE5, 0x3C, 0xC3, 0x13, 0xF5, 0x71, 0x25, | ||
252 | 0x7A, 0xF5, 0x72, 0xC3, 0x94, 0x3F, 0x40, 0x05, | ||
253 | /*0680*/0xE4, 0xF5, 0x3D, 0x80, 0x1F, 0xC3, 0x74, 0x3F, | ||
254 | 0x95, 0x72, 0xF5, 0x3D, 0xF5, 0x3F, 0x80, 0x14, | ||
255 | /*0690*/0xE4, 0xF5, 0x3C, 0xF5, 0x3E, 0x90, 0x07, 0x19, | ||
256 | 0xF0, 0x12, 0x08, 0xD2, 0x70, 0x03, 0xF0, 0x80, | ||
257 | /*06A0*/0x03, 0x74, 0x01, 0xF0, 0x12, 0x08, 0x65, 0x75, | ||
258 | 0x83, 0xD0, 0xE0, 0x54, 0x0F, 0xFE, 0xAD, 0x3C, | ||
259 | /*06B0*/0x70, 0x02, 0x7E, 0x07, 0xBE, 0x0F, 0x02, 0x7E, | ||
260 | 0x80, 0xEE, 0xFB, 0xEF, 0xD3, 0x9B, 0x74, 0x80, | ||
261 | /*06C0*/0xF8, 0x98, 0x40, 0x1F, 0xE4, 0xF5, 0x3C, 0xF5, | ||
262 | 0x3E, 0x12, 0x08, 0xD2, 0x70, 0x03, 0xF0, 0x80, | ||
263 | /*06D0*/0x12, 0x74, 0x01, 0xF0, 0xE5, 0x08, 0xFB, 0xEB, | ||
264 | 0x44, 0x07, 0xF5, 0x82, 0x75, 0x83, 0xD2, 0xE0, | ||
265 | /*06E0*/0x44, 0x10, 0xF0, 0xE5, 0x08, 0xFB, 0xEB, 0x44, | ||
266 | 0x09, 0xF5, 0x82, 0x75, 0x83, 0x9E, 0xED, 0xF0, | ||
267 | /*06F0*/0xEB, 0x44, 0x07, 0xF5, 0x82, 0x75, 0x83, 0xCA, | ||
268 | 0xED, 0xF0, 0x12, 0x08, 0x65, 0x75, 0x83, 0xCC, | ||
269 | /*0700*/0xEF, 0xF0, 0x22, 0xE5, 0x08, 0x44, 0x07, 0xF5, | ||
270 | 0x82, 0x75, 0x83, 0xBC, 0xE0, 0x54, 0xF0, 0xF0, | ||
271 | /*0710*/0xE5, 0x08, 0x44, 0x07, 0xF5, 0x82, 0x75, 0x83, | ||
272 | 0xBE, 0xE0, 0x54, 0xF0, 0xF0, 0xE5, 0x08, 0x44, | ||
273 | /*0720*/0x07, 0xF5, 0x82, 0x75, 0x83, 0xC0, 0xE0, 0x54, | ||
274 | 0xF0, 0xF0, 0xE5, 0x08, 0x44, 0x07, 0xF5, 0x82, | ||
275 | /*0730*/0x22, 0xF0, 0x90, 0x07, 0x28, 0xE0, 0xFE, 0xA3, | ||
276 | 0xE0, 0xF5, 0x82, 0x8E, 0x83, 0x22, 0x85, 0x42, | ||
277 | /*0740*/0x42, 0x85, 0x41, 0x41, 0x85, 0x40, 0x40, 0x74, | ||
278 | 0xC0, 0x2F, 0xF5, 0x82, 0x74, 0x02, 0x3E, 0xF5, | ||
279 | /*0750*/0x83, 0xE5, 0x42, 0xF0, 0x74, 0xE0, 0x2F, 0xF5, | ||
280 | 0x82, 0x74, 0x02, 0x3E, 0xF5, 0x83, 0x22, 0xE5, | ||
281 | /*0760*/0x42, 0x29, 0xFD, 0xE4, 0x33, 0xFC, 0xE5, 0x3C, | ||
282 | 0xC3, 0x9D, 0xEC, 0x64, 0x80, 0xF8, 0x74, 0x80, | ||
283 | /*0770*/0x98, 0x22, 0xF5, 0x83, 0xE0, 0x90, 0x07, 0x22, | ||
284 | 0x54, 0x1F, 0xFD, 0xE0, 0xFA, 0xA3, 0xE0, 0xF5, | ||
285 | /*0780*/0x82, 0x8A, 0x83, 0xED, 0xF0, 0x22, 0x90, 0x07, | ||
286 | 0x22, 0xE0, 0xFC, 0xA3, 0xE0, 0xF5, 0x82, 0x8C, | ||
287 | /*0790*/0x83, 0x22, 0x90, 0x07, 0x24, 0xFF, 0xED, 0x44, | ||
288 | 0x07, 0xCF, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, 0x85, | ||
289 | /*07A0*/0x38, 0x38, 0x85, 0x39, 0x39, 0x85, 0x3A, 0x3A, | ||
290 | 0x74, 0xC0, 0x2F, 0xF5, 0x82, 0x74, 0x02, 0x3E, | ||
291 | /*07B0*/0xF5, 0x83, 0x22, 0x90, 0x07, 0x26, 0xFF, 0xED, | ||
292 | 0x44, 0x07, 0xCF, 0xF0, 0xA3, 0xEF, 0xF0, 0x22, | ||
293 | /*07C0*/0xF0, 0x74, 0xA0, 0x2F, 0xF5, 0x82, 0x74, 0x02, | ||
294 | 0x3E, 0xF5, 0x83, 0x22, 0x74, 0xC0, 0x25, 0x11, | ||
295 | /*07D0*/0xF5, 0x82, 0xE4, 0x34, 0x01, 0xF5, 0x83, 0x22, | ||
296 | 0x74, 0x00, 0x25, 0x11, 0xF5, 0x82, 0xE4, 0x34, | ||
297 | /*07E0*/0x02, 0xF5, 0x83, 0x22, 0x74, 0x60, 0x25, 0x11, | ||
298 | 0xF5, 0x82, 0xE4, 0x34, 0x03, 0xF5, 0x83, 0x22, | ||
299 | /*07F0*/0x74, 0x80, 0x25, 0x11, 0xF5, 0x82, 0xE4, 0x34, | ||
300 | 0x03, 0xF5, 0x83, 0x22, 0x74, 0xE0, 0x25, 0x11, | ||
301 | /*0800*/0xF5, 0x82, 0xE4, 0x34, 0x03, 0xF5, 0x83, 0x22, | ||
302 | 0x74, 0x40, 0x25, 0x11, 0xF5, 0x82, 0xE4, 0x34, | ||
303 | /*0810*/0x06, 0xF5, 0x83, 0x22, 0x74, 0x80, 0x2F, 0xF5, | ||
304 | 0x82, 0x74, 0x02, 0x3E, 0xF5, 0x83, 0x22, 0xAF, | ||
305 | /*0820*/0x08, 0x7E, 0x00, 0xEF, 0x44, 0x07, 0xF5, 0x82, | ||
306 | 0x22, 0xF5, 0x83, 0xE5, 0x82, 0x44, 0x07, 0xF5, | ||
307 | /*0830*/0x82, 0xE5, 0x40, 0xF0, 0x22, 0x74, 0x40, 0x25, | ||
308 | 0x11, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, | ||
309 | /*0840*/0x22, 0x74, 0xC0, 0x25, 0x11, 0xF5, 0x82, 0xE4, | ||
310 | 0x34, 0x03, 0xF5, 0x83, 0x22, 0x74, 0x00, 0x25, | ||
311 | /*0850*/0x11, 0xF5, 0x82, 0xE4, 0x34, 0x06, 0xF5, 0x83, | ||
312 | 0x22, 0x74, 0x20, 0x25, 0x11, 0xF5, 0x82, 0xE4, | ||
313 | /*0860*/0x34, 0x06, 0xF5, 0x83, 0x22, 0xE5, 0x08, 0xFD, | ||
314 | 0xED, 0x44, 0x07, 0xF5, 0x82, 0x22, 0xE5, 0x41, | ||
315 | /*0870*/0xF0, 0xE5, 0x65, 0x64, 0x01, 0x45, 0x64, 0x22, | ||
316 | 0x7E, 0x00, 0xFB, 0x7A, 0x00, 0xFD, 0x7C, 0x00, | ||
317 | /*0880*/0x22, 0x74, 0x20, 0x25, 0x11, 0xF5, 0x82, 0xE4, | ||
318 | 0x34, 0x02, 0x22, 0x74, 0xA0, 0x25, 0x11, 0xF5, | ||
319 | /*0890*/0x82, 0xE4, 0x34, 0x03, 0x22, 0x85, 0x3E, 0x42, | ||
320 | 0x85, 0x3F, 0x41, 0x8F, 0x40, 0x22, 0x85, 0x3C, | ||
321 | /*08A0*/0x42, 0x85, 0x3D, 0x41, 0x8F, 0x40, 0x22, 0x75, | ||
322 | 0x45, 0x3F, 0x90, 0x07, 0x20, 0xE4, 0xF0, 0xA3, | ||
323 | /*08B0*/0x22, 0xF5, 0x83, 0xE5, 0x32, 0xF0, 0x05, 0x6E, | ||
324 | 0xE5, 0x6E, 0xC3, 0x94, 0x40, 0x22, 0xF0, 0xE5, | ||
325 | /*08C0*/0x08, 0x44, 0x06, 0xF5, 0x82, 0x22, 0x74, 0x00, | ||
326 | 0x25, 0x6E, 0xF5, 0x82, 0xE4, 0x34, 0x00, 0xF5, | ||
327 | /*08D0*/0x83, 0x22, 0xE5, 0x6D, 0x45, 0x6C, 0x90, 0x07, | ||
328 | 0x2F, 0x22, 0xE4, 0xF9, 0xE5, 0x3C, 0xD3, 0x95, | ||
329 | /*08E0*/0x3E, 0x22, 0x74, 0x80, 0x2E, 0xF5, 0x82, 0xE4, | ||
330 | 0x34, 0x02, 0xF5, 0x83, 0xE0, 0x22, 0x74, 0xA0, | ||
331 | /*08F0*/0x2E, 0xF5, 0x82, 0xE4, 0x34, 0x02, 0xF5, 0x83, | ||
332 | 0xE0, 0x22, 0x74, 0x80, 0x25, 0x6E, 0xF5, 0x82, | ||
333 | /*0900*/0xE4, 0x34, 0x00, 0x22, 0x25, 0x42, 0xFD, 0xE4, | ||
334 | 0x33, 0xFC, 0x22, 0x85, 0x42, 0x42, 0x85, 0x41, | ||
335 | /*0910*/0x41, 0x85, 0x40, 0x40, 0x22, 0xED, 0x4C, 0x60, | ||
336 | 0x03, 0x02, 0x09, 0xE5, 0xEF, 0x4E, 0x70, 0x37, | ||
337 | /*0920*/0x90, 0x07, 0x26, 0x12, 0x07, 0x89, 0xE0, 0xFD, | ||
338 | 0x12, 0x07, 0xCC, 0xED, 0xF0, 0x90, 0x07, 0x28, | ||
339 | /*0930*/0x12, 0x07, 0x89, 0xE0, 0xFD, 0x12, 0x07, 0xD8, | ||
340 | 0xED, 0xF0, 0x12, 0x07, 0x86, 0xE0, 0x54, 0x1F, | ||
341 | /*0940*/0xFD, 0x12, 0x08, 0x81, 0xF5, 0x83, 0xED, 0xF0, | ||
342 | 0x90, 0x07, 0x24, 0x12, 0x07, 0x89, 0xE0, 0x54, | ||
343 | /*0950*/0x1F, 0xFD, 0x12, 0x08, 0x35, 0xED, 0xF0, 0xEF, | ||
344 | 0x64, 0x04, 0x4E, 0x70, 0x37, 0x90, 0x07, 0x26, | ||
345 | /*0960*/0x12, 0x07, 0x89, 0xE0, 0xFD, 0x12, 0x07, 0xE4, | ||
346 | 0xED, 0xF0, 0x90, 0x07, 0x28, 0x12, 0x07, 0x89, | ||
347 | /*0970*/0xE0, 0xFD, 0x12, 0x07, 0xF0, 0xED, 0xF0, 0x12, | ||
348 | 0x07, 0x86, 0xE0, 0x54, 0x1F, 0xFD, 0x12, 0x08, | ||
349 | /*0980*/0x8B, 0xF5, 0x83, 0xED, 0xF0, 0x90, 0x07, 0x24, | ||
350 | 0x12, 0x07, 0x89, 0xE0, 0x54, 0x1F, 0xFD, 0x12, | ||
351 | /*0990*/0x08, 0x41, 0xED, 0xF0, 0xEF, 0x64, 0x01, 0x4E, | ||
352 | 0x70, 0x04, 0x7D, 0x01, 0x80, 0x02, 0x7D, 0x00, | ||
353 | /*09A0*/0xEF, 0x64, 0x02, 0x4E, 0x70, 0x04, 0x7F, 0x01, | ||
354 | 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x4D, 0x60, 0x78, | ||
355 | /*09B0*/0x90, 0x07, 0x26, 0x12, 0x07, 0x35, 0xE0, 0xFF, | ||
356 | 0x12, 0x07, 0xFC, 0xEF, 0x12, 0x07, 0x31, 0xE0, | ||
357 | /*09C0*/0xFF, 0x12, 0x08, 0x08, 0xEF, 0xF0, 0x90, 0x07, | ||
358 | 0x22, 0x12, 0x07, 0x35, 0xE0, 0x54, 0x1F, 0xFF, | ||
359 | /*09D0*/0x12, 0x08, 0x4D, 0xEF, 0xF0, 0x90, 0x07, 0x24, | ||
360 | 0x12, 0x07, 0x35, 0xE0, 0x54, 0x1F, 0xFF, 0x12, | ||
361 | /*09E0*/0x08, 0x59, 0xEF, 0xF0, 0x22, 0x12, 0x07, 0xCC, | ||
362 | 0xE4, 0xF0, 0x12, 0x07, 0xD8, 0xE4, 0xF0, 0x12, | ||
363 | /*09F0*/0x08, 0x81, 0xF5, 0x83, 0xE4, 0xF0, 0x12, 0x08, | ||
364 | 0x35, 0x74, 0x14, 0xF0, 0x12, 0x07, 0xE4, 0xE4, | ||
365 | /*0A00*/0xF0, 0x12, 0x07, 0xF0, 0xE4, 0xF0, 0x12, 0x08, | ||
366 | 0x8B, 0xF5, 0x83, 0xE4, 0xF0, 0x12, 0x08, 0x41, | ||
367 | /*0A10*/0x74, 0x14, 0xF0, 0x12, 0x07, 0xFC, 0xE4, 0xF0, | ||
368 | 0x12, 0x08, 0x08, 0xE4, 0xF0, 0x12, 0x08, 0x4D, | ||
369 | /*0A20*/0xE4, 0xF0, 0x12, 0x08, 0x59, 0x74, 0x14, 0xF0, | ||
370 | 0x22, 0x53, 0xF9, 0xF7, 0x75, 0xFC, 0x10, 0xE4, | ||
371 | /*0A30*/0xF5, 0xFD, 0x75, 0xFE, 0x30, 0xF5, 0xFF, 0xE5, | ||
372 | 0xE7, 0x20, 0xE7, 0x03, 0x43, 0xF9, 0x08, 0xE5, | ||
373 | /*0A40*/0xE6, 0x20, 0xE7, 0x0B, 0x78, 0xFF, 0xE4, 0xF6, | ||
374 | 0xD8, 0xFD, 0x53, 0xE6, 0xFE, 0x80, 0x09, 0x78, | ||
375 | /*0A50*/0x08, 0xE4, 0xF6, 0xD8, 0xFD, 0x53, 0xE6, 0xFE, | ||
376 | 0x75, 0x81, 0x80, 0xE4, 0xF5, 0xA8, 0xD2, 0xA8, | ||
377 | /*0A60*/0xC2, 0xA9, 0xD2, 0xAF, 0xE5, 0xE2, 0x20, 0xE5, | ||
378 | 0x05, 0x20, 0xE6, 0x02, 0x80, 0x03, 0x43, 0xE1, | ||
379 | /*0A70*/0x02, 0xE5, 0xE2, 0x20, 0xE0, 0x0E, 0x90, 0x00, | ||
380 | 0x00, 0x7F, 0x00, 0x7E, 0x08, 0xE4, 0xF0, 0xA3, | ||
381 | /*0A80*/0xDF, 0xFC, 0xDE, 0xFA, 0x02, 0x0A, 0xDB, 0x43, | ||
382 | 0xFA, 0x01, 0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, | ||
383 | /*0A90*/0xC0, 0x82, 0xC0, 0xD0, 0x12, 0x1C, 0xE7, 0xD0, | ||
384 | 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, | ||
385 | /*0AA0*/0xE0, 0x53, 0xFA, 0xFE, 0x32, 0x02, 0x1B, 0x55, | ||
386 | 0xE4, 0x93, 0xA3, 0xF8, 0xE4, 0x93, 0xA3, 0xF6, | ||
387 | /*0AB0*/0x08, 0xDF, 0xF9, 0x80, 0x29, 0xE4, 0x93, 0xA3, | ||
388 | 0xF8, 0x54, 0x07, 0x24, 0x0C, 0xC8, 0xC3, 0x33, | ||
389 | /*0AC0*/0xC4, 0x54, 0x0F, 0x44, 0x20, 0xC8, 0x83, 0x40, | ||
390 | 0x04, 0xF4, 0x56, 0x80, 0x01, 0x46, 0xF6, 0xDF, | ||
391 | /*0AD0*/0xE4, 0x80, 0x0B, 0x01, 0x02, 0x04, 0x08, 0x10, | ||
392 | 0x20, 0x40, 0x80, 0x90, 0x00, 0x3F, 0xE4, 0x7E, | ||
393 | /*0AE0*/0x01, 0x93, 0x60, 0xC1, 0xA3, 0xFF, 0x54, 0x3F, | ||
394 | 0x30, 0xE5, 0x09, 0x54, 0x1F, 0xFE, 0xE4, 0x93, | ||
395 | /*0AF0*/0xA3, 0x60, 0x01, 0x0E, 0xCF, 0x54, 0xC0, 0x25, | ||
396 | 0xE0, 0x60, 0xAD, 0x40, 0xB8, 0x80, 0xFE, 0x8C, | ||
397 | /*0B00*/0x64, 0x8D, 0x65, 0x8A, 0x66, 0x8B, 0x67, 0xE4, | ||
398 | 0xF5, 0x69, 0xEF, 0x4E, 0x70, 0x03, 0x02, 0x1D, | ||
399 | /*0B10*/0x55, 0xE4, 0xF5, 0x68, 0xE5, 0x67, 0x45, 0x66, | ||
400 | 0x70, 0x32, 0x12, 0x07, 0x2A, 0x75, 0x83, 0x90, | ||
401 | /*0B20*/0xE4, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC2, 0xE4, | ||
402 | 0x12, 0x07, 0x29, 0x75, 0x83, 0xC4, 0xE4, 0x12, | ||
403 | /*0B30*/0x08, 0x70, 0x70, 0x29, 0x12, 0x07, 0x2A, 0x75, | ||
404 | 0x83, 0x92, 0xE4, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
405 | /*0B40*/0xC6, 0xE4, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC8, | ||
406 | 0xE4, 0xF0, 0x80, 0x11, 0x90, 0x07, 0x26, 0x12, | ||
407 | /*0B50*/0x07, 0x35, 0xE4, 0x12, 0x08, 0x70, 0x70, 0x05, | ||
408 | 0x12, 0x07, 0x32, 0xE4, 0xF0, 0x12, 0x1D, 0x55, | ||
409 | /*0B60*/0x12, 0x1E, 0xBF, 0xE5, 0x67, 0x45, 0x66, 0x70, | ||
410 | 0x33, 0x12, 0x07, 0x2A, 0x75, 0x83, 0x90, 0xE5, | ||
411 | /*0B70*/0x41, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC2, 0xE5, | ||
412 | 0x41, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC4, 0x12, | ||
413 | /*0B80*/0x08, 0x6E, 0x70, 0x29, 0x12, 0x07, 0x2A, 0x75, | ||
414 | 0x83, 0x92, 0xE5, 0x40, 0x12, 0x07, 0x29, 0x75, | ||
415 | /*0B90*/0x83, 0xC6, 0xE5, 0x40, 0x12, 0x07, 0x29, 0x75, | ||
416 | 0x83, 0xC8, 0x80, 0x0E, 0x90, 0x07, 0x26, 0x12, | ||
417 | /*0BA0*/0x07, 0x35, 0x12, 0x08, 0x6E, 0x70, 0x06, 0x12, | ||
418 | 0x07, 0x32, 0xE5, 0x40, 0xF0, 0xAF, 0x69, 0x7E, | ||
419 | /*0BB0*/0x00, 0xAD, 0x67, 0xAC, 0x66, 0x12, 0x04, 0x44, | ||
420 | 0x12, 0x07, 0x2A, 0x75, 0x83, 0xCA, 0xE0, 0xD3, | ||
421 | /*0BC0*/0x94, 0x00, 0x50, 0x0C, 0x05, 0x68, 0xE5, 0x68, | ||
422 | 0xC3, 0x94, 0x05, 0x50, 0x03, 0x02, 0x0B, 0x14, | ||
423 | /*0BD0*/0x22, 0x8C, 0x60, 0x8D, 0x61, 0x12, 0x08, 0xDA, | ||
424 | 0x74, 0x20, 0x40, 0x0D, 0x2F, 0xF5, 0x82, 0x74, | ||
425 | /*0BE0*/0x03, 0x3E, 0xF5, 0x83, 0xE5, 0x3E, 0xF0, 0x80, | ||
426 | 0x0B, 0x2F, 0xF5, 0x82, 0x74, 0x03, 0x3E, 0xF5, | ||
427 | /*0BF0*/0x83, 0xE5, 0x3C, 0xF0, 0xE5, 0x3C, 0xD3, 0x95, | ||
428 | 0x3E, 0x40, 0x3C, 0xE5, 0x61, 0x45, 0x60, 0x70, | ||
429 | /*0C00*/0x10, 0xE9, 0x12, 0x09, 0x04, 0xE5, 0x3E, 0x12, | ||
430 | 0x07, 0x68, 0x40, 0x3B, 0x12, 0x08, 0x95, 0x80, | ||
431 | /*0C10*/0x18, 0xE5, 0x3E, 0xC3, 0x95, 0x38, 0x40, 0x1D, | ||
432 | 0x85, 0x3E, 0x38, 0xE5, 0x3E, 0x60, 0x05, 0x85, | ||
433 | /*0C20*/0x3F, 0x39, 0x80, 0x03, 0x85, 0x39, 0x39, 0x8F, | ||
434 | 0x3A, 0x12, 0x08, 0x14, 0xE5, 0x3E, 0x12, 0x07, | ||
435 | /*0C30*/0xC0, 0xE5, 0x3F, 0xF0, 0x22, 0x80, 0x43, 0xE5, | ||
436 | 0x61, 0x45, 0x60, 0x70, 0x19, 0x12, 0x07, 0x5F, | ||
437 | /*0C40*/0x40, 0x05, 0x12, 0x08, 0x9E, 0x80, 0x27, 0x12, | ||
438 | 0x09, 0x0B, 0x12, 0x08, 0x14, 0xE5, 0x42, 0x12, | ||
439 | /*0C50*/0x07, 0xC0, 0xE5, 0x41, 0xF0, 0x22, 0xE5, 0x3C, | ||
440 | 0xC3, 0x95, 0x38, 0x40, 0x1D, 0x85, 0x3C, 0x38, | ||
441 | /*0C60*/0xE5, 0x3C, 0x60, 0x05, 0x85, 0x3D, 0x39, 0x80, | ||
442 | 0x03, 0x85, 0x39, 0x39, 0x8F, 0x3A, 0x12, 0x08, | ||
443 | /*0C70*/0x14, 0xE5, 0x3C, 0x12, 0x07, 0xC0, 0xE5, 0x3D, | ||
444 | 0xF0, 0x22, 0x85, 0x38, 0x38, 0x85, 0x39, 0x39, | ||
445 | /*0C80*/0x85, 0x3A, 0x3A, 0x12, 0x08, 0x14, 0xE5, 0x38, | ||
446 | 0x12, 0x07, 0xC0, 0xE5, 0x39, 0xF0, 0x22, 0x7F, | ||
447 | /*0C90*/0x06, 0x12, 0x17, 0x31, 0x12, 0x1D, 0x23, 0x12, | ||
448 | 0x0E, 0x04, 0x12, 0x0E, 0x33, 0xE0, 0x44, 0x0A, | ||
449 | /*0CA0*/0xF0, 0x74, 0x8E, 0xFE, 0x12, 0x0E, 0x04, 0x12, | ||
450 | 0x0E, 0x0B, 0xEF, 0xF0, 0xE5, 0x28, 0x30, 0xE5, | ||
451 | /*0CB0*/0x03, 0xD3, 0x80, 0x01, 0xC3, 0x40, 0x05, 0x75, | ||
452 | 0x14, 0x20, 0x80, 0x03, 0x75, 0x14, 0x08, 0x12, | ||
453 | /*0CC0*/0x0E, 0x04, 0x75, 0x83, 0x8A, 0xE5, 0x14, 0xF0, | ||
454 | 0xB4, 0xFF, 0x05, 0x75, 0x12, 0x80, 0x80, 0x06, | ||
455 | /*0CD0*/0xE5, 0x14, 0xC3, 0x13, 0xF5, 0x12, 0xE4, 0xF5, | ||
456 | 0x16, 0xF5, 0x7F, 0x12, 0x19, 0x36, 0x12, 0x13, | ||
457 | /*0CE0*/0xA3, 0xE5, 0x0A, 0xC3, 0x94, 0x01, 0x50, 0x09, | ||
458 | 0x05, 0x16, 0xE5, 0x16, 0xC3, 0x94, 0x14, 0x40, | ||
459 | /*0CF0*/0xEA, 0xE5, 0xE4, 0x20, 0xE7, 0x28, 0x12, 0x0E, | ||
460 | 0x04, 0x75, 0x83, 0xD2, 0xE0, 0x54, 0x08, 0xD3, | ||
461 | /*0D00*/0x94, 0x00, 0x40, 0x04, 0x7F, 0x01, 0x80, 0x02, | ||
462 | 0x7F, 0x00, 0xE5, 0x0A, 0xC3, 0x94, 0x01, 0x40, | ||
463 | /*0D10*/0x04, 0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEF, | ||
464 | 0x5E, 0x60, 0x03, 0x12, 0x1D, 0xD7, 0xE5, 0x7F, | ||
465 | /*0D20*/0xC3, 0x94, 0x11, 0x40, 0x14, 0x12, 0x0E, 0x04, | ||
466 | 0x75, 0x83, 0xD2, 0xE0, 0x44, 0x80, 0xF0, 0xE5, | ||
467 | /*0D30*/0xE4, 0x20, 0xE7, 0x0F, 0x12, 0x1D, 0xD7, 0x80, | ||
468 | 0x0A, 0x12, 0x0E, 0x04, 0x75, 0x83, 0xD2, 0xE0, | ||
469 | /*0D40*/0x54, 0x7F, 0xF0, 0x12, 0x1D, 0x23, 0x22, 0x74, | ||
470 | 0x8A, 0x85, 0x08, 0x82, 0xF5, 0x83, 0xE5, 0x17, | ||
471 | /*0D50*/0xF0, 0x12, 0x0E, 0x3A, 0xE4, 0xF0, 0x90, 0x07, | ||
472 | 0x02, 0xE0, 0x12, 0x0E, 0x17, 0x75, 0x83, 0x90, | ||
473 | /*0D60*/0xEF, 0xF0, 0x74, 0x92, 0xFE, 0xE5, 0x08, 0x44, | ||
474 | 0x07, 0xFF, 0xF5, 0x82, 0x8E, 0x83, 0xE0, 0x54, | ||
475 | /*0D70*/0xC0, 0xFD, 0x90, 0x07, 0x03, 0xE0, 0x54, 0x3F, | ||
476 | 0x4D, 0x8F, 0x82, 0x8E, 0x83, 0xF0, 0x90, 0x07, | ||
477 | /*0D80*/0x04, 0xE0, 0x12, 0x0E, 0x17, 0x75, 0x83, 0x82, | ||
478 | 0xEF, 0xF0, 0x90, 0x07, 0x05, 0xE0, 0xFF, 0xED, | ||
479 | /*0D90*/0x44, 0x07, 0xF5, 0x82, 0x75, 0x83, 0xB4, 0xEF, | ||
480 | 0x12, 0x0E, 0x03, 0x75, 0x83, 0x80, 0xE0, 0x54, | ||
481 | /*0DA0*/0xBF, 0xF0, 0x30, 0x37, 0x0A, 0x12, 0x0E, 0x91, | ||
482 | 0x75, 0x83, 0x94, 0xE0, 0x44, 0x80, 0xF0, 0x30, | ||
483 | /*0DB0*/0x38, 0x0A, 0x12, 0x0E, 0x91, 0x75, 0x83, 0x92, | ||
484 | 0xE0, 0x44, 0x80, 0xF0, 0xE5, 0x28, 0x30, 0xE4, | ||
485 | /*0DC0*/0x1A, 0x20, 0x39, 0x0A, 0x12, 0x0E, 0x04, 0x75, | ||
486 | 0x83, 0x88, 0xE0, 0x54, 0x7F, 0xF0, 0x20, 0x3A, | ||
487 | /*0DD0*/0x0A, 0x12, 0x0E, 0x04, 0x75, 0x83, 0x88, 0xE0, | ||
488 | 0x54, 0xBF, 0xF0, 0x74, 0x8C, 0xFE, 0x12, 0x0E, | ||
489 | /*0DE0*/0x04, 0x8E, 0x83, 0xE0, 0x54, 0x0F, 0x12, 0x0E, | ||
490 | 0x03, 0x75, 0x83, 0x86, 0xE0, 0x54, 0xBF, 0xF0, | ||
491 | /*0DF0*/0xE5, 0x08, 0x44, 0x06, 0x12, 0x0D, 0xFD, 0x75, | ||
492 | 0x83, 0x8A, 0xE4, 0xF0, 0x22, 0xF5, 0x82, 0x75, | ||
493 | /*0E00*/0x83, 0x82, 0xE4, 0xF0, 0xE5, 0x08, 0x44, 0x07, | ||
494 | 0xF5, 0x82, 0x22, 0x8E, 0x83, 0xE0, 0xF5, 0x10, | ||
495 | /*0E10*/0x54, 0xFE, 0xF0, 0xE5, 0x10, 0x44, 0x01, 0xFF, | ||
496 | 0xE5, 0x08, 0xFD, 0xED, 0x44, 0x07, 0xF5, 0x82, | ||
497 | /*0E20*/0x22, 0xE5, 0x15, 0xC4, 0x54, 0x07, 0xFF, 0xE5, | ||
498 | 0x08, 0xFD, 0xED, 0x44, 0x08, 0xF5, 0x82, 0x75, | ||
499 | /*0E30*/0x83, 0x82, 0x22, 0x75, 0x83, 0x80, 0xE0, 0x44, | ||
500 | 0x40, 0xF0, 0xE5, 0x08, 0x44, 0x08, 0xF5, 0x82, | ||
501 | /*0E40*/0x75, 0x83, 0x8A, 0x22, 0xE5, 0x16, 0x25, 0xE0, | ||
502 | 0x25, 0xE0, 0x24, 0xAF, 0xF5, 0x82, 0xE4, 0x34, | ||
503 | /*0E50*/0x1A, 0xF5, 0x83, 0xE4, 0x93, 0xF5, 0x0D, 0x22, | ||
504 | 0x43, 0xE1, 0x10, 0x43, 0xE1, 0x80, 0x53, 0xE1, | ||
505 | /*0E60*/0xFD, 0x85, 0xE1, 0x10, 0x22, 0xE5, 0x16, 0x25, | ||
506 | 0xE0, 0x25, 0xE0, 0x24, 0xB2, 0xF5, 0x82, 0xE4, | ||
507 | /*0E70*/0x34, 0x1A, 0xF5, 0x83, 0xE4, 0x93, 0x22, 0x85, | ||
508 | 0x55, 0x82, 0x85, 0x54, 0x83, 0xE5, 0x15, 0xF0, | ||
509 | /*0E80*/0x22, 0xE5, 0xE2, 0x54, 0x20, 0xD3, 0x94, 0x00, | ||
510 | 0x22, 0xE5, 0xE2, 0x54, 0x40, 0xD3, 0x94, 0x00, | ||
511 | /*0E90*/0x22, 0xE5, 0x08, 0x44, 0x06, 0xF5, 0x82, 0x22, | ||
512 | 0xFD, 0xE5, 0x08, 0xFB, 0xEB, 0x44, 0x07, 0xF5, | ||
513 | /*0EA0*/0x82, 0x22, 0x53, 0xF9, 0xF7, 0x75, 0xFE, 0x30, | ||
514 | 0x22, 0xEF, 0x4E, 0x70, 0x26, 0x12, 0x07, 0xCC, | ||
515 | /*0EB0*/0xE0, 0xFD, 0x90, 0x07, 0x26, 0x12, 0x07, 0x7B, | ||
516 | 0x12, 0x07, 0xD8, 0xE0, 0xFD, 0x90, 0x07, 0x28, | ||
517 | /*0EC0*/0x12, 0x07, 0x7B, 0x12, 0x08, 0x81, 0x12, 0x07, | ||
518 | 0x72, 0x12, 0x08, 0x35, 0xE0, 0x90, 0x07, 0x24, | ||
519 | /*0ED0*/0x12, 0x07, 0x78, 0xEF, 0x64, 0x04, 0x4E, 0x70, | ||
520 | 0x29, 0x12, 0x07, 0xE4, 0xE0, 0xFD, 0x90, 0x07, | ||
521 | /*0EE0*/0x26, 0x12, 0x07, 0x7B, 0x12, 0x07, 0xF0, 0xE0, | ||
522 | 0xFD, 0x90, 0x07, 0x28, 0x12, 0x07, 0x7B, 0x12, | ||
523 | /*0EF0*/0x08, 0x8B, 0x12, 0x07, 0x72, 0x12, 0x08, 0x41, | ||
524 | 0xE0, 0x54, 0x1F, 0xFD, 0x90, 0x07, 0x24, 0x12, | ||
525 | /*0F00*/0x07, 0x7B, 0xEF, 0x64, 0x01, 0x4E, 0x70, 0x04, | ||
526 | 0x7D, 0x01, 0x80, 0x02, 0x7D, 0x00, 0xEF, 0x64, | ||
527 | /*0F10*/0x02, 0x4E, 0x70, 0x04, 0x7F, 0x01, 0x80, 0x02, | ||
528 | 0x7F, 0x00, 0xEF, 0x4D, 0x60, 0x35, 0x12, 0x07, | ||
529 | /*0F20*/0xFC, 0xE0, 0xFF, 0x90, 0x07, 0x26, 0x12, 0x07, | ||
530 | 0x89, 0xEF, 0xF0, 0x12, 0x08, 0x08, 0xE0, 0xFF, | ||
531 | /*0F30*/0x90, 0x07, 0x28, 0x12, 0x07, 0x89, 0xEF, 0xF0, | ||
532 | 0x12, 0x08, 0x4D, 0xE0, 0x54, 0x1F, 0xFF, 0x12, | ||
533 | /*0F40*/0x07, 0x86, 0xEF, 0xF0, 0x12, 0x08, 0x59, 0xE0, | ||
534 | 0x54, 0x1F, 0xFF, 0x90, 0x07, 0x24, 0x12, 0x07, | ||
535 | /*0F50*/0x89, 0xEF, 0xF0, 0x22, 0xE4, 0xF5, 0x53, 0x12, | ||
536 | 0x0E, 0x81, 0x40, 0x04, 0x7F, 0x01, 0x80, 0x02, | ||
537 | /*0F60*/0x7F, 0x00, 0x12, 0x0E, 0x89, 0x40, 0x04, 0x7E, | ||
538 | 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEE, 0x4F, 0x70, | ||
539 | /*0F70*/0x03, 0x02, 0x0F, 0xF6, 0x85, 0xE1, 0x10, 0x43, | ||
540 | 0xE1, 0x02, 0x53, 0xE1, 0x0F, 0x85, 0xE1, 0x10, | ||
541 | /*0F80*/0xE4, 0xF5, 0x51, 0xE5, 0xE3, 0x54, 0x3F, 0xF5, | ||
542 | 0x52, 0x12, 0x0E, 0x89, 0x40, 0x1D, 0xAD, 0x52, | ||
543 | /*0F90*/0xAF, 0x51, 0x12, 0x11, 0x18, 0xEF, 0x60, 0x08, | ||
544 | 0x85, 0xE1, 0x10, 0x43, 0xE1, 0x40, 0x80, 0x0B, | ||
545 | /*0FA0*/0x53, 0xE1, 0xBF, 0x12, 0x0E, 0x58, 0x12, 0x00, | ||
546 | 0x06, 0x80, 0xFB, 0xE5, 0xE3, 0x54, 0x3F, 0xF5, | ||
547 | /*0FB0*/0x51, 0xE5, 0xE4, 0x54, 0x3F, 0xF5, 0x52, 0x12, | ||
548 | 0x0E, 0x81, 0x40, 0x1D, 0xAD, 0x52, 0xAF, 0x51, | ||
549 | /*0FC0*/0x12, 0x11, 0x18, 0xEF, 0x60, 0x08, 0x85, 0xE1, | ||
550 | 0x10, 0x43, 0xE1, 0x20, 0x80, 0x0B, 0x53, 0xE1, | ||
551 | /*0FD0*/0xDF, 0x12, 0x0E, 0x58, 0x12, 0x00, 0x06, 0x80, | ||
552 | 0xFB, 0x12, 0x0E, 0x81, 0x40, 0x04, 0x7F, 0x01, | ||
553 | /*0FE0*/0x80, 0x02, 0x7F, 0x00, 0x12, 0x0E, 0x89, 0x40, | ||
554 | 0x04, 0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEE, | ||
555 | /*0FF0*/0x4F, 0x60, 0x03, 0x12, 0x0E, 0x5B, 0x22, 0x12, | ||
556 | 0x0E, 0x21, 0xEF, 0xF0, 0x12, 0x10, 0x91, 0x22, | ||
557 | /*1000*/0x02, 0x11, 0x00, 0x02, 0x10, 0x40, 0x02, 0x10, | ||
558 | 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
559 | /*1010*/0x01, 0x20, 0x01, 0x20, 0xE4, 0xF5, 0x57, 0x12, | ||
560 | 0x16, 0xBD, 0x12, 0x16, 0x44, 0xE4, 0x12, 0x10, | ||
561 | /*1020*/0x56, 0x12, 0x14, 0xB7, 0x90, 0x07, 0x26, 0x12, | ||
562 | 0x07, 0x35, 0xE4, 0x12, 0x07, 0x31, 0xE4, 0xF0, | ||
563 | /*1030*/0x12, 0x10, 0x56, 0x12, 0x14, 0xB7, 0x90, 0x07, | ||
564 | 0x26, 0x12, 0x07, 0x35, 0xE5, 0x41, 0x12, 0x07, | ||
565 | /*1040*/0x31, 0xE5, 0x40, 0xF0, 0xAF, 0x57, 0x7E, 0x00, | ||
566 | 0xAD, 0x56, 0x7C, 0x00, 0x12, 0x04, 0x44, 0xAF, | ||
567 | /*1050*/0x56, 0x7E, 0x00, 0x02, 0x11, 0xEE, 0xFF, 0x90, | ||
568 | 0x07, 0x20, 0xA3, 0xE0, 0xFD, 0xE4, 0xF5, 0x56, | ||
569 | /*1060*/0xF5, 0x40, 0xFE, 0xFC, 0xAB, 0x56, 0xFA, 0x12, | ||
570 | 0x11, 0x51, 0x7F, 0x0F, 0x7D, 0x18, 0xE4, 0xF5, | ||
571 | /*1070*/0x56, 0xF5, 0x40, 0xFE, 0xFC, 0xAB, 0x56, 0xFA, | ||
572 | 0x12, 0x15, 0x41, 0xAF, 0x56, 0x7E, 0x00, 0x12, | ||
573 | /*1080*/0x1A, 0xFF, 0xE4, 0xFF, 0xF5, 0x56, 0x7D, 0x1F, | ||
574 | 0xF5, 0x40, 0xFE, 0xFC, 0xAB, 0x56, 0xFA, 0x22, | ||
575 | /*1090*/0x22, 0xE4, 0xF5, 0x55, 0xE5, 0x08, 0xFD, 0x74, | ||
576 | 0xA0, 0xF5, 0x56, 0xED, 0x44, 0x07, 0xF5, 0x57, | ||
577 | /*10A0*/0xE5, 0x28, 0x30, 0xE5, 0x03, 0xD3, 0x80, 0x01, | ||
578 | 0xC3, 0x40, 0x05, 0x7F, 0x28, 0xEF, 0x80, 0x04, | ||
579 | /*10B0*/0x7F, 0x14, 0xEF, 0xC3, 0x13, 0xF5, 0x54, 0xE4, | ||
580 | 0xF9, 0x12, 0x0E, 0x18, 0x75, 0x83, 0x8E, 0xE0, | ||
581 | /*10C0*/0xF5, 0x10, 0xCE, 0xEF, 0xCE, 0xEE, 0xD3, 0x94, | ||
582 | 0x00, 0x40, 0x26, 0xE5, 0x10, 0x54, 0xFE, 0x12, | ||
583 | /*10D0*/0x0E, 0x98, 0x75, 0x83, 0x8E, 0xED, 0xF0, 0xE5, | ||
584 | 0x10, 0x44, 0x01, 0xFD, 0xEB, 0x44, 0x07, 0xF5, | ||
585 | /*10E0*/0x82, 0xED, 0xF0, 0x85, 0x57, 0x82, 0x85, 0x56, | ||
586 | 0x83, 0xE0, 0x30, 0xE3, 0x01, 0x09, 0x1E, 0x80, | ||
587 | /*10F0*/0xD4, 0xC2, 0x34, 0xE9, 0xC3, 0x95, 0x54, 0x40, | ||
588 | 0x02, 0xD2, 0x34, 0x22, 0x02, 0x00, 0x06, 0x22, | ||
589 | /*1100*/0x30, 0x30, 0x11, 0x90, 0x10, 0x00, 0xE4, 0x93, | ||
590 | 0xF5, 0x10, 0x90, 0x10, 0x10, 0xE4, 0x93, 0xF5, | ||
591 | /*1110*/0x10, 0x12, 0x10, 0x90, 0x12, 0x11, 0x50, 0x22, | ||
592 | 0xE4, 0xFC, 0xC3, 0xED, 0x9F, 0xFA, 0xEF, 0xF5, | ||
593 | /*1120*/0x83, 0x75, 0x82, 0x00, 0x79, 0xFF, 0xE4, 0x93, | ||
594 | 0xCC, 0x6C, 0xCC, 0xA3, 0xD9, 0xF8, 0xDA, 0xF6, | ||
595 | /*1130*/0xE5, 0xE2, 0x30, 0xE4, 0x02, 0x8C, 0xE5, 0xED, | ||
596 | 0x24, 0xFF, 0xFF, 0xEF, 0x75, 0x82, 0xFF, 0xF5, | ||
597 | /*1140*/0x83, 0xE4, 0x93, 0x6C, 0x70, 0x03, 0x7F, 0x01, | ||
598 | 0x22, 0x7F, 0x00, 0x22, 0x22, 0x11, 0x00, 0x00, | ||
599 | /*1150*/0x22, 0x8E, 0x58, 0x8F, 0x59, 0x8C, 0x5A, 0x8D, | ||
600 | 0x5B, 0x8A, 0x5C, 0x8B, 0x5D, 0x75, 0x5E, 0x01, | ||
601 | /*1160*/0xE4, 0xF5, 0x5F, 0xF5, 0x60, 0xF5, 0x62, 0x12, | ||
602 | 0x07, 0x2A, 0x75, 0x83, 0xD0, 0xE0, 0xFF, 0xC4, | ||
603 | /*1170*/0x54, 0x0F, 0xF5, 0x61, 0x12, 0x1E, 0xA5, 0x85, | ||
604 | 0x59, 0x5E, 0xD3, 0xE5, 0x5E, 0x95, 0x5B, 0xE5, | ||
605 | /*1180*/0x5A, 0x12, 0x07, 0x6B, 0x50, 0x4B, 0x12, 0x07, | ||
606 | 0x03, 0x75, 0x83, 0xBC, 0xE0, 0x45, 0x5E, 0x12, | ||
607 | /*1190*/0x07, 0x29, 0x75, 0x83, 0xBE, 0xE0, 0x45, 0x5E, | ||
608 | 0x12, 0x07, 0x29, 0x75, 0x83, 0xC0, 0xE0, 0x45, | ||
609 | /*11A0*/0x5E, 0xF0, 0xAF, 0x5F, 0xE5, 0x60, 0x12, 0x08, | ||
610 | 0x78, 0x12, 0x0A, 0xFF, 0xAF, 0x62, 0x7E, 0x00, | ||
611 | /*11B0*/0xAD, 0x5D, 0xAC, 0x5C, 0x12, 0x04, 0x44, 0xE5, | ||
612 | 0x61, 0xAF, 0x5E, 0x7E, 0x00, 0xB4, 0x03, 0x05, | ||
613 | /*11C0*/0x12, 0x1E, 0x21, 0x80, 0x07, 0xAD, 0x5D, 0xAC, | ||
614 | 0x5C, 0x12, 0x13, 0x17, 0x05, 0x5E, 0x02, 0x11, | ||
615 | /*11D0*/0x7A, 0x12, 0x07, 0x03, 0x75, 0x83, 0xBC, 0xE0, | ||
616 | 0x45, 0x40, 0x12, 0x07, 0x29, 0x75, 0x83, 0xBE, | ||
617 | /*11E0*/0xE0, 0x45, 0x40, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
618 | 0xC0, 0xE0, 0x45, 0x40, 0xF0, 0x22, 0x8E, 0x58, | ||
619 | /*11F0*/0x8F, 0x59, 0x75, 0x5A, 0x01, 0x79, 0x01, 0x75, | ||
620 | 0x5B, 0x01, 0xE4, 0xFB, 0x12, 0x07, 0x2A, 0x75, | ||
621 | /*1200*/0x83, 0xAE, 0xE0, 0x54, 0x1A, 0xFF, 0x12, 0x08, | ||
622 | 0x65, 0xE0, 0xC4, 0x13, 0x54, 0x07, 0xFE, 0xEF, | ||
623 | /*1210*/0x70, 0x0C, 0xEE, 0x65, 0x35, 0x70, 0x07, 0x90, | ||
624 | 0x07, 0x2F, 0xE0, 0xB4, 0x01, 0x0D, 0xAF, 0x35, | ||
625 | /*1220*/0x7E, 0x00, 0x12, 0x0E, 0xA9, 0xCF, 0xEB, 0xCF, | ||
626 | 0x02, 0x1E, 0x60, 0xE5, 0x59, 0x64, 0x02, 0x45, | ||
627 | /*1230*/0x58, 0x70, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, | ||
628 | 0x00, 0xE5, 0x59, 0x45, 0x58, 0x70, 0x04, 0x7E, | ||
629 | /*1240*/0x01, 0x80, 0x02, 0x7E, 0x00, 0xEE, 0x4F, 0x60, | ||
630 | 0x23, 0x85, 0x41, 0x49, 0x85, 0x40, 0x4B, 0xE5, | ||
631 | /*1250*/0x59, 0x45, 0x58, 0x70, 0x2C, 0xAF, 0x5A, 0xFE, | ||
632 | 0xCD, 0xE9, 0xCD, 0xFC, 0xAB, 0x59, 0xAA, 0x58, | ||
633 | /*1260*/0x12, 0x0A, 0xFF, 0xAF, 0x5B, 0x7E, 0x00, 0x12, | ||
634 | 0x1E, 0x60, 0x80, 0x15, 0xAF, 0x5B, 0x7E, 0x00, | ||
635 | /*1270*/0x12, 0x1E, 0x60, 0x90, 0x07, 0x26, 0x12, 0x07, | ||
636 | 0x35, 0xE5, 0x49, 0x12, 0x07, 0x31, 0xE5, 0x4B, | ||
637 | /*1280*/0xF0, 0xE4, 0xFD, 0xAF, 0x35, 0xFE, 0xFC, 0x12, | ||
638 | 0x09, 0x15, 0x22, 0x8C, 0x64, 0x8D, 0x65, 0x12, | ||
639 | /*1290*/0x08, 0xDA, 0x40, 0x3C, 0xE5, 0x65, 0x45, 0x64, | ||
640 | 0x70, 0x10, 0x12, 0x09, 0x04, 0xC3, 0xE5, 0x3E, | ||
641 | /*12A0*/0x12, 0x07, 0x69, 0x40, 0x3B, 0x12, 0x08, 0x95, | ||
642 | 0x80, 0x18, 0xE5, 0x3E, 0xC3, 0x95, 0x38, 0x40, | ||
643 | /*12B0*/0x1D, 0x85, 0x3E, 0x38, 0xE5, 0x3E, 0x60, 0x05, | ||
644 | 0x85, 0x3F, 0x39, 0x80, 0x03, 0x85, 0x39, 0x39, | ||
645 | /*12C0*/0x8F, 0x3A, 0x12, 0x07, 0xA8, 0xE5, 0x3E, 0x12, | ||
646 | 0x07, 0x53, 0xE5, 0x3F, 0xF0, 0x22, 0x80, 0x3B, | ||
647 | /*12D0*/0xE5, 0x65, 0x45, 0x64, 0x70, 0x11, 0x12, 0x07, | ||
648 | 0x5F, 0x40, 0x05, 0x12, 0x08, 0x9E, 0x80, 0x1F, | ||
649 | /*12E0*/0x12, 0x07, 0x3E, 0xE5, 0x41, 0xF0, 0x22, 0xE5, | ||
650 | 0x3C, 0xC3, 0x95, 0x38, 0x40, 0x1D, 0x85, 0x3C, | ||
651 | /*12F0*/0x38, 0xE5, 0x3C, 0x60, 0x05, 0x85, 0x3D, 0x39, | ||
652 | 0x80, 0x03, 0x85, 0x39, 0x39, 0x8F, 0x3A, 0x12, | ||
653 | /*1300*/0x07, 0xA8, 0xE5, 0x3C, 0x12, 0x07, 0x53, 0xE5, | ||
654 | 0x3D, 0xF0, 0x22, 0x12, 0x07, 0x9F, 0xE5, 0x38, | ||
655 | /*1310*/0x12, 0x07, 0x53, 0xE5, 0x39, 0xF0, 0x22, 0x8C, | ||
656 | 0x63, 0x8D, 0x64, 0x12, 0x08, 0xDA, 0x40, 0x3C, | ||
657 | /*1320*/0xE5, 0x64, 0x45, 0x63, 0x70, 0x10, 0x12, 0x09, | ||
658 | 0x04, 0xC3, 0xE5, 0x3E, 0x12, 0x07, 0x69, 0x40, | ||
659 | /*1330*/0x3B, 0x12, 0x08, 0x95, 0x80, 0x18, 0xE5, 0x3E, | ||
660 | 0xC3, 0x95, 0x38, 0x40, 0x1D, 0x85, 0x3E, 0x38, | ||
661 | /*1340*/0xE5, 0x3E, 0x60, 0x05, 0x85, 0x3F, 0x39, 0x80, | ||
662 | 0x03, 0x85, 0x39, 0x39, 0x8F, 0x3A, 0x12, 0x07, | ||
663 | /*1350*/0xA8, 0xE5, 0x3E, 0x12, 0x07, 0x53, 0xE5, 0x3F, | ||
664 | 0xF0, 0x22, 0x80, 0x3B, 0xE5, 0x64, 0x45, 0x63, | ||
665 | /*1360*/0x70, 0x11, 0x12, 0x07, 0x5F, 0x40, 0x05, 0x12, | ||
666 | 0x08, 0x9E, 0x80, 0x1F, 0x12, 0x07, 0x3E, 0xE5, | ||
667 | /*1370*/0x41, 0xF0, 0x22, 0xE5, 0x3C, 0xC3, 0x95, 0x38, | ||
668 | 0x40, 0x1D, 0x85, 0x3C, 0x38, 0xE5, 0x3C, 0x60, | ||
669 | /*1380*/0x05, 0x85, 0x3D, 0x39, 0x80, 0x03, 0x85, 0x39, | ||
670 | 0x39, 0x8F, 0x3A, 0x12, 0x07, 0xA8, 0xE5, 0x3C, | ||
671 | /*1390*/0x12, 0x07, 0x53, 0xE5, 0x3D, 0xF0, 0x22, 0x12, | ||
672 | 0x07, 0x9F, 0xE5, 0x38, 0x12, 0x07, 0x53, 0xE5, | ||
673 | /*13A0*/0x39, 0xF0, 0x22, 0xE5, 0x0D, 0xFE, 0xE5, 0x08, | ||
674 | 0x8E, 0x54, 0x44, 0x05, 0xF5, 0x55, 0x75, 0x15, | ||
675 | /*13B0*/0x0F, 0xF5, 0x82, 0x12, 0x0E, 0x7A, 0x12, 0x17, | ||
676 | 0xA3, 0x20, 0x31, 0x05, 0x75, 0x15, 0x03, 0x80, | ||
677 | /*13C0*/0x03, 0x75, 0x15, 0x0B, 0xE5, 0x0A, 0xC3, 0x94, | ||
678 | 0x01, 0x50, 0x38, 0x12, 0x14, 0x20, 0x20, 0x31, | ||
679 | /*13D0*/0x06, 0x05, 0x15, 0x05, 0x15, 0x80, 0x04, 0x15, | ||
680 | 0x15, 0x15, 0x15, 0xE5, 0x0A, 0xC3, 0x94, 0x01, | ||
681 | /*13E0*/0x50, 0x21, 0x12, 0x14, 0x20, 0x20, 0x31, 0x04, | ||
682 | 0x05, 0x15, 0x80, 0x02, 0x15, 0x15, 0xE5, 0x0A, | ||
683 | /*13F0*/0xC3, 0x94, 0x01, 0x50, 0x0E, 0x12, 0x0E, 0x77, | ||
684 | 0x12, 0x17, 0xA3, 0x20, 0x31, 0x05, 0x05, 0x15, | ||
685 | /*1400*/0x12, 0x0E, 0x77, 0xE5, 0x15, 0xB4, 0x08, 0x04, | ||
686 | 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xE5, 0x15, | ||
687 | /*1410*/0xB4, 0x07, 0x04, 0x7E, 0x01, 0x80, 0x02, 0x7E, | ||
688 | 0x00, 0xEE, 0x4F, 0x60, 0x02, 0x05, 0x7F, 0x22, | ||
689 | /*1420*/0x85, 0x55, 0x82, 0x85, 0x54, 0x83, 0xE5, 0x15, | ||
690 | 0xF0, 0x12, 0x17, 0xA3, 0x22, 0x12, 0x07, 0x2A, | ||
691 | /*1430*/0x75, 0x83, 0xAE, 0x74, 0xFF, 0x12, 0x07, 0x29, | ||
692 | 0xE0, 0x54, 0x1A, 0xF5, 0x34, 0xE0, 0xC4, 0x13, | ||
693 | /*1440*/0x54, 0x07, 0xF5, 0x35, 0x24, 0xFE, 0x60, 0x24, | ||
694 | 0x24, 0xFE, 0x60, 0x3C, 0x24, 0x04, 0x70, 0x63, | ||
695 | /*1450*/0x75, 0x31, 0x2D, 0xE5, 0x08, 0xFD, 0x74, 0xB6, | ||
696 | 0x12, 0x07, 0x92, 0x74, 0xBC, 0x90, 0x07, 0x22, | ||
697 | /*1460*/0x12, 0x07, 0x95, 0x74, 0x90, 0x12, 0x07, 0xB3, | ||
698 | 0x74, 0x92, 0x80, 0x3C, 0x75, 0x31, 0x3A, 0xE5, | ||
699 | /*1470*/0x08, 0xFD, 0x74, 0xBA, 0x12, 0x07, 0x92, 0x74, | ||
700 | 0xC0, 0x90, 0x07, 0x22, 0x12, 0x07, 0xB6, 0x74, | ||
701 | /*1480*/0xC4, 0x12, 0x07, 0xB3, 0x74, 0xC8, 0x80, 0x20, | ||
702 | 0x75, 0x31, 0x35, 0xE5, 0x08, 0xFD, 0x74, 0xB8, | ||
703 | /*1490*/0x12, 0x07, 0x92, 0x74, 0xBE, 0xFF, 0xED, 0x44, | ||
704 | 0x07, 0x90, 0x07, 0x22, 0xCF, 0xF0, 0xA3, 0xEF, | ||
705 | /*14A0*/0xF0, 0x74, 0xC2, 0x12, 0x07, 0xB3, 0x74, 0xC6, | ||
706 | 0xFF, 0xED, 0x44, 0x07, 0xA3, 0xCF, 0xF0, 0xA3, | ||
707 | /*14B0*/0xEF, 0xF0, 0x22, 0x75, 0x34, 0x01, 0x22, 0x8E, | ||
708 | 0x58, 0x8F, 0x59, 0x8C, 0x5A, 0x8D, 0x5B, 0x8A, | ||
709 | /*14C0*/0x5C, 0x8B, 0x5D, 0x75, 0x5E, 0x01, 0xE4, 0xF5, | ||
710 | 0x5F, 0x12, 0x1E, 0xA5, 0x85, 0x59, 0x5E, 0xD3, | ||
711 | /*14D0*/0xE5, 0x5E, 0x95, 0x5B, 0xE5, 0x5A, 0x12, 0x07, | ||
712 | 0x6B, 0x50, 0x57, 0xE5, 0x5D, 0x45, 0x5C, 0x70, | ||
713 | /*14E0*/0x30, 0x12, 0x07, 0x2A, 0x75, 0x83, 0x92, 0xE5, | ||
714 | 0x5E, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC6, 0xE5, | ||
715 | /*14F0*/0x5E, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC8, 0xE5, | ||
716 | 0x5E, 0x12, 0x07, 0x29, 0x75, 0x83, 0x90, 0xE5, | ||
717 | /*1500*/0x5E, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC2, 0xE5, | ||
718 | 0x5E, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC4, 0x80, | ||
719 | /*1510*/0x03, 0x12, 0x07, 0x32, 0xE5, 0x5E, 0xF0, 0xAF, | ||
720 | 0x5F, 0x7E, 0x00, 0xAD, 0x5D, 0xAC, 0x5C, 0x12, | ||
721 | /*1520*/0x04, 0x44, 0xAF, 0x5E, 0x7E, 0x00, 0xAD, 0x5D, | ||
722 | 0xAC, 0x5C, 0x12, 0x0B, 0xD1, 0x05, 0x5E, 0x02, | ||
723 | /*1530*/0x14, 0xCF, 0xAB, 0x5D, 0xAA, 0x5C, 0xAD, 0x5B, | ||
724 | 0xAC, 0x5A, 0xAF, 0x59, 0xAE, 0x58, 0x02, 0x1B, | ||
725 | /*1540*/0xFB, 0x8C, 0x5C, 0x8D, 0x5D, 0x8A, 0x5E, 0x8B, | ||
726 | 0x5F, 0x75, 0x60, 0x01, 0xE4, 0xF5, 0x61, 0xF5, | ||
727 | /*1550*/0x62, 0xF5, 0x63, 0x12, 0x1E, 0xA5, 0x8F, 0x60, | ||
728 | 0xD3, 0xE5, 0x60, 0x95, 0x5D, 0xE5, 0x5C, 0x12, | ||
729 | /*1560*/0x07, 0x6B, 0x50, 0x61, 0xE5, 0x5F, 0x45, 0x5E, | ||
730 | 0x70, 0x27, 0x12, 0x07, 0x2A, 0x75, 0x83, 0xB6, | ||
731 | /*1570*/0xE5, 0x60, 0x12, 0x07, 0x29, 0x75, 0x83, 0xB8, | ||
732 | 0xE5, 0x60, 0x12, 0x07, 0x29, 0x75, 0x83, 0xBA, | ||
733 | /*1580*/0xE5, 0x60, 0xF0, 0xAF, 0x61, 0x7E, 0x00, 0xE5, | ||
734 | 0x62, 0x12, 0x08, 0x7A, 0x12, 0x0A, 0xFF, 0x80, | ||
735 | /*1590*/0x19, 0x90, 0x07, 0x24, 0x12, 0x07, 0x35, 0xE5, | ||
736 | 0x60, 0x12, 0x07, 0x29, 0x75, 0x83, 0x8E, 0xE4, | ||
737 | /*15A0*/0x12, 0x07, 0x29, 0x74, 0x01, 0x12, 0x07, 0x29, | ||
738 | 0xE4, 0xF0, 0xAF, 0x63, 0x7E, 0x00, 0xAD, 0x5F, | ||
739 | /*15B0*/0xAC, 0x5E, 0x12, 0x04, 0x44, 0xAF, 0x60, 0x7E, | ||
740 | 0x00, 0xAD, 0x5F, 0xAC, 0x5E, 0x12, 0x12, 0x8B, | ||
741 | /*15C0*/0x05, 0x60, 0x02, 0x15, 0x58, 0x22, 0x90, 0x11, | ||
742 | 0x4D, 0xE4, 0x93, 0x90, 0x07, 0x2E, 0xF0, 0x12, | ||
743 | /*15D0*/0x08, 0x1F, 0x75, 0x83, 0xAE, 0xE0, 0x54, 0x1A, | ||
744 | 0xF5, 0x34, 0x70, 0x67, 0xEF, 0x44, 0x07, 0xF5, | ||
745 | /*15E0*/0x82, 0x75, 0x83, 0xCE, 0xE0, 0xFF, 0x13, 0x13, | ||
746 | 0x13, 0x54, 0x07, 0xF5, 0x36, 0x54, 0x0F, 0xD3, | ||
747 | /*15F0*/0x94, 0x00, 0x40, 0x06, 0x12, 0x14, 0x2D, 0x12, | ||
748 | 0x1B, 0xA9, 0xE5, 0x36, 0x54, 0x0F, 0x24, 0xFE, | ||
749 | /*1600*/0x60, 0x0C, 0x14, 0x60, 0x0C, 0x14, 0x60, 0x19, | ||
750 | 0x24, 0x03, 0x70, 0x37, 0x80, 0x10, 0x02, 0x1E, | ||
751 | /*1610*/0x91, 0x12, 0x1E, 0x91, 0x12, 0x07, 0x2A, 0x75, | ||
752 | 0x83, 0xCE, 0xE0, 0x54, 0xEF, 0xF0, 0x02, 0x1D, | ||
753 | /*1620*/0xAE, 0x12, 0x10, 0x14, 0xE4, 0xF5, 0x55, 0x12, | ||
754 | 0x1D, 0x85, 0x05, 0x55, 0xE5, 0x55, 0xC3, 0x94, | ||
755 | /*1630*/0x05, 0x40, 0xF4, 0x12, 0x07, 0x2A, 0x75, 0x83, | ||
756 | 0xCE, 0xE0, 0x54, 0xC7, 0x12, 0x07, 0x29, 0xE0, | ||
757 | /*1640*/0x44, 0x08, 0xF0, 0x22, 0xE4, 0xF5, 0x58, 0xF5, | ||
758 | 0x59, 0xAF, 0x08, 0xEF, 0x44, 0x07, 0xF5, 0x82, | ||
759 | /*1650*/0x75, 0x83, 0xD0, 0xE0, 0xFD, 0xC4, 0x54, 0x0F, | ||
760 | 0xF5, 0x5A, 0xEF, 0x44, 0x07, 0xF5, 0x82, 0x75, | ||
761 | /*1660*/0x83, 0x80, 0x74, 0x01, 0xF0, 0x12, 0x08, 0x21, | ||
762 | 0x75, 0x83, 0x82, 0xE5, 0x45, 0xF0, 0xEF, 0x44, | ||
763 | /*1670*/0x07, 0xF5, 0x82, 0x75, 0x83, 0x8A, 0x74, 0xFF, | ||
764 | 0xF0, 0x12, 0x1A, 0x4D, 0x12, 0x07, 0x2A, 0x75, | ||
765 | /*1680*/0x83, 0xBC, 0xE0, 0x54, 0xEF, 0x12, 0x07, 0x29, | ||
766 | 0x75, 0x83, 0xBE, 0xE0, 0x54, 0xEF, 0x12, 0x07, | ||
767 | /*1690*/0x29, 0x75, 0x83, 0xC0, 0xE0, 0x54, 0xEF, 0x12, | ||
768 | 0x07, 0x29, 0x75, 0x83, 0xBC, 0xE0, 0x44, 0x10, | ||
769 | /*16A0*/0x12, 0x07, 0x29, 0x75, 0x83, 0xBE, 0xE0, 0x44, | ||
770 | 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC0, 0xE0, | ||
771 | /*16B0*/0x44, 0x10, 0xF0, 0xAF, 0x58, 0xE5, 0x59, 0x12, | ||
772 | 0x08, 0x78, 0x02, 0x0A, 0xFF, 0xE4, 0xF5, 0x58, | ||
773 | /*16C0*/0x7D, 0x01, 0xF5, 0x59, 0xAF, 0x35, 0xFE, 0xFC, | ||
774 | 0x12, 0x09, 0x15, 0x12, 0x07, 0x2A, 0x75, 0x83, | ||
775 | /*16D0*/0xB6, 0x74, 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
776 | 0xB8, 0x74, 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
777 | /*16E0*/0xBA, 0x74, 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
778 | 0xBC, 0x74, 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
779 | /*16F0*/0xBE, 0x74, 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
780 | 0xC0, 0x74, 0x10, 0x12, 0x07, 0x29, 0x75, 0x83, | ||
781 | /*1700*/0x90, 0xE4, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC2, | ||
782 | 0xE4, 0x12, 0x07, 0x29, 0x75, 0x83, 0xC4, 0xE4, | ||
783 | /*1710*/0x12, 0x07, 0x29, 0x75, 0x83, 0x92, 0xE4, 0x12, | ||
784 | 0x07, 0x29, 0x75, 0x83, 0xC6, 0xE4, 0x12, 0x07, | ||
785 | /*1720*/0x29, 0x75, 0x83, 0xC8, 0xE4, 0xF0, 0xAF, 0x58, | ||
786 | 0xFE, 0xE5, 0x59, 0x12, 0x08, 0x7A, 0x02, 0x0A, | ||
787 | /*1730*/0xFF, 0xE5, 0xE2, 0x30, 0xE4, 0x6C, 0xE5, 0xE7, | ||
788 | 0x54, 0xC0, 0x64, 0x40, 0x70, 0x64, 0xE5, 0x09, | ||
789 | /*1740*/0xC4, 0x54, 0x30, 0xFE, 0xE5, 0x08, 0x25, 0xE0, | ||
790 | 0x25, 0xE0, 0x54, 0xC0, 0x4E, 0xFE, 0xEF, 0x54, | ||
791 | /*1750*/0x3F, 0x4E, 0xFD, 0xE5, 0x2B, 0xAE, 0x2A, 0x78, | ||
792 | 0x02, 0xC3, 0x33, 0xCE, 0x33, 0xCE, 0xD8, 0xF9, | ||
793 | /*1760*/0xF5, 0x82, 0x8E, 0x83, 0xED, 0xF0, 0xE5, 0x2B, | ||
794 | 0xAE, 0x2A, 0x78, 0x02, 0xC3, 0x33, 0xCE, 0x33, | ||
795 | /*1770*/0xCE, 0xD8, 0xF9, 0xFF, 0xF5, 0x82, 0x8E, 0x83, | ||
796 | 0xA3, 0xE5, 0xFE, 0xF0, 0x8F, 0x82, 0x8E, 0x83, | ||
797 | /*1780*/0xA3, 0xA3, 0xE5, 0xFD, 0xF0, 0x8F, 0x82, 0x8E, | ||
798 | 0x83, 0xA3, 0xA3, 0xA3, 0xE5, 0xFC, 0xF0, 0xC3, | ||
799 | /*1790*/0xE5, 0x2B, 0x94, 0xFA, 0xE5, 0x2A, 0x94, 0x00, | ||
800 | 0x50, 0x08, 0x05, 0x2B, 0xE5, 0x2B, 0x70, 0x02, | ||
801 | /*17A0*/0x05, 0x2A, 0x22, 0xE4, 0xFF, 0xE4, 0xF5, 0x58, | ||
802 | 0xF5, 0x56, 0xF5, 0x57, 0x74, 0x82, 0xFC, 0x12, | ||
803 | /*17B0*/0x0E, 0x04, 0x8C, 0x83, 0xE0, 0xF5, 0x10, 0x54, | ||
804 | 0x7F, 0xF0, 0xE5, 0x10, 0x44, 0x80, 0x12, 0x0E, | ||
805 | /*17C0*/0x98, 0xED, 0xF0, 0x7E, 0x0A, 0x12, 0x0E, 0x04, | ||
806 | 0x75, 0x83, 0xA0, 0xE0, 0x20, 0xE0, 0x26, 0xDE, | ||
807 | /*17D0*/0xF4, 0x05, 0x57, 0xE5, 0x57, 0x70, 0x02, 0x05, | ||
808 | 0x56, 0xE5, 0x14, 0x24, 0x01, 0xFD, 0xE4, 0x33, | ||
809 | /*17E0*/0xFC, 0xD3, 0xE5, 0x57, 0x9D, 0xE5, 0x56, 0x9C, | ||
810 | 0x40, 0xD9, 0xE5, 0x0A, 0x94, 0x20, 0x50, 0x02, | ||
811 | /*17F0*/0x05, 0x0A, 0x43, 0xE1, 0x08, 0xC2, 0x31, 0x12, | ||
812 | 0x0E, 0x04, 0x75, 0x83, 0xA6, 0xE0, 0x55, 0x12, | ||
813 | /*1800*/0x65, 0x12, 0x70, 0x03, 0xD2, 0x31, 0x22, 0xC2, | ||
814 | 0x31, 0x22, 0x90, 0x07, 0x26, 0xE0, 0xFA, 0xA3, | ||
815 | /*1810*/0xE0, 0xF5, 0x82, 0x8A, 0x83, 0xE0, 0xF5, 0x41, | ||
816 | 0xE5, 0x39, 0xC3, 0x95, 0x41, 0x40, 0x26, 0xE5, | ||
817 | /*1820*/0x39, 0x95, 0x41, 0xC3, 0x9F, 0xEE, 0x12, 0x07, | ||
818 | 0x6B, 0x40, 0x04, 0x7C, 0x01, 0x80, 0x02, 0x7C, | ||
819 | /*1830*/0x00, 0xE5, 0x41, 0x64, 0x3F, 0x60, 0x04, 0x7B, | ||
820 | 0x01, 0x80, 0x02, 0x7B, 0x00, 0xEC, 0x5B, 0x60, | ||
821 | /*1840*/0x29, 0x05, 0x41, 0x80, 0x28, 0xC3, 0xE5, 0x41, | ||
822 | 0x95, 0x39, 0xC3, 0x9F, 0xEE, 0x12, 0x07, 0x6B, | ||
823 | /*1850*/0x40, 0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, | ||
824 | 0xE5, 0x41, 0x60, 0x04, 0x7E, 0x01, 0x80, 0x02, | ||
825 | /*1860*/0x7E, 0x00, 0xEF, 0x5E, 0x60, 0x04, 0x15, 0x41, | ||
826 | 0x80, 0x03, 0x85, 0x39, 0x41, 0x85, 0x3A, 0x40, | ||
827 | /*1870*/0x22, 0xE5, 0xE2, 0x30, 0xE4, 0x60, 0xE5, 0xE1, | ||
828 | 0x30, 0xE2, 0x5B, 0xE5, 0x09, 0x70, 0x04, 0x7F, | ||
829 | /*1880*/0x01, 0x80, 0x02, 0x7F, 0x00, 0xE5, 0x08, 0x70, | ||
830 | 0x04, 0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEE, | ||
831 | /*1890*/0x5F, 0x60, 0x43, 0x53, 0xF9, 0xF8, 0xE5, 0xE2, | ||
832 | 0x30, 0xE4, 0x3B, 0xE5, 0xE1, 0x30, 0xE2, 0x2E, | ||
833 | /*18A0*/0x43, 0xFA, 0x02, 0x53, 0xFA, 0xFB, 0xE4, 0xF5, | ||
834 | 0x10, 0x90, 0x94, 0x70, 0xE5, 0x10, 0xF0, 0xE5, | ||
835 | /*18B0*/0xE1, 0x30, 0xE2, 0xE7, 0x90, 0x94, 0x70, 0xE0, | ||
836 | 0x65, 0x10, 0x60, 0x03, 0x43, 0xFA, 0x04, 0x05, | ||
837 | /*18C0*/0x10, 0x90, 0x94, 0x70, 0xE5, 0x10, 0xF0, 0x70, | ||
838 | 0xE6, 0x12, 0x00, 0x06, 0x80, 0xE1, 0x53, 0xFA, | ||
839 | /*18D0*/0xFD, 0x53, 0xFA, 0xFB, 0x80, 0xC0, 0x22, 0x8F, | ||
840 | 0x54, 0x12, 0x00, 0x06, 0xE5, 0xE1, 0x30, 0xE0, | ||
841 | /*18E0*/0x04, 0x7F, 0x01, 0x80, 0x02, 0x7F, 0x00, 0xE5, | ||
842 | 0x7E, 0xD3, 0x94, 0x05, 0x40, 0x04, 0x7E, 0x01, | ||
843 | /*18F0*/0x80, 0x02, 0x7E, 0x00, 0xEE, 0x4F, 0x60, 0x3D, | ||
844 | 0x85, 0x54, 0x11, 0xE5, 0xE2, 0x20, 0xE1, 0x32, | ||
845 | /*1900*/0x74, 0xCE, 0x12, 0x1A, 0x05, 0x30, 0xE7, 0x04, | ||
846 | 0x7D, 0x01, 0x80, 0x02, 0x7D, 0x00, 0x8F, 0x82, | ||
847 | /*1910*/0x8E, 0x83, 0xE0, 0x30, 0xE6, 0x04, 0x7F, 0x01, | ||
848 | 0x80, 0x02, 0x7F, 0x00, 0xEF, 0x5D, 0x70, 0x15, | ||
849 | /*1920*/0x12, 0x15, 0xC6, 0x74, 0xCE, 0x12, 0x1A, 0x05, | ||
850 | 0x30, 0xE6, 0x07, 0xE0, 0x44, 0x80, 0xF0, 0x43, | ||
851 | /*1930*/0xF9, 0x80, 0x12, 0x18, 0x71, 0x22, 0x12, 0x0E, | ||
852 | 0x44, 0xE5, 0x16, 0x25, 0xE0, 0x25, 0xE0, 0x24, | ||
853 | /*1940*/0xB0, 0xF5, 0x82, 0xE4, 0x34, 0x1A, 0xF5, 0x83, | ||
854 | 0xE4, 0x93, 0xF5, 0x0F, 0xE5, 0x16, 0x25, 0xE0, | ||
855 | /*1950*/0x25, 0xE0, 0x24, 0xB1, 0xF5, 0x82, 0xE4, 0x34, | ||
856 | 0x1A, 0xF5, 0x83, 0xE4, 0x93, 0xF5, 0x0E, 0x12, | ||
857 | /*1960*/0x0E, 0x65, 0xF5, 0x10, 0xE5, 0x0F, 0x54, 0xF0, | ||
858 | 0x12, 0x0E, 0x17, 0x75, 0x83, 0x8C, 0xEF, 0xF0, | ||
859 | /*1970*/0xE5, 0x0F, 0x30, 0xE0, 0x0C, 0x12, 0x0E, 0x04, | ||
860 | 0x75, 0x83, 0x86, 0xE0, 0x44, 0x40, 0xF0, 0x80, | ||
861 | /*1980*/0x0A, 0x12, 0x0E, 0x04, 0x75, 0x83, 0x86, 0xE0, | ||
862 | 0x54, 0xBF, 0xF0, 0x12, 0x0E, 0x91, 0x75, 0x83, | ||
863 | /*1990*/0x82, 0xE5, 0x0E, 0xF0, 0x22, 0x7F, 0x05, 0x12, | ||
864 | 0x17, 0x31, 0x12, 0x0E, 0x04, 0x12, 0x0E, 0x33, | ||
865 | /*19A0*/0x74, 0x02, 0xF0, 0x74, 0x8E, 0xFE, 0x12, 0x0E, | ||
866 | 0x04, 0x12, 0x0E, 0x0B, 0xEF, 0xF0, 0x75, 0x15, | ||
867 | /*19B0*/0x70, 0x12, 0x0F, 0xF7, 0x20, 0x34, 0x05, 0x75, | ||
868 | 0x15, 0x10, 0x80, 0x03, 0x75, 0x15, 0x50, 0x12, | ||
869 | /*19C0*/0x0F, 0xF7, 0x20, 0x34, 0x04, 0x74, 0x10, 0x80, | ||
870 | 0x02, 0x74, 0xF0, 0x25, 0x15, 0xF5, 0x15, 0x12, | ||
871 | /*19D0*/0x0E, 0x21, 0xEF, 0xF0, 0x12, 0x10, 0x91, 0x20, | ||
872 | 0x34, 0x17, 0xE5, 0x15, 0x64, 0x30, 0x60, 0x0C, | ||
873 | /*19E0*/0x74, 0x10, 0x25, 0x15, 0xF5, 0x15, 0xB4, 0x80, | ||
874 | 0x03, 0xE4, 0xF5, 0x15, 0x12, 0x0E, 0x21, 0xEF, | ||
875 | /*19F0*/0xF0, 0x22, 0xF0, 0xE5, 0x0B, 0x25, 0xE0, 0x25, | ||
876 | 0xE0, 0x24, 0x82, 0xF5, 0x82, 0xE4, 0x34, 0x07, | ||
877 | /*1A00*/0xF5, 0x83, 0x22, 0x74, 0x88, 0xFE, 0xE5, 0x08, | ||
878 | 0x44, 0x07, 0xFF, 0xF5, 0x82, 0x8E, 0x83, 0xE0, | ||
879 | /*1A10*/0x22, 0xF0, 0xE5, 0x08, 0x44, 0x07, 0xF5, 0x82, | ||
880 | 0x22, 0xF0, 0xE0, 0x54, 0xC0, 0x8F, 0x82, 0x8E, | ||
881 | /*1A20*/0x83, 0xF0, 0x22, 0xEF, 0x44, 0x07, 0xF5, 0x82, | ||
882 | 0x75, 0x83, 0x86, 0xE0, 0x54, 0x10, 0xD3, 0x94, | ||
883 | /*1A30*/0x00, 0x22, 0xF0, 0x90, 0x07, 0x15, 0xE0, 0x04, | ||
884 | 0xF0, 0x22, 0x44, 0x06, 0xF5, 0x82, 0x75, 0x83, | ||
885 | /*1A40*/0x9E, 0xE0, 0x22, 0xFE, 0xEF, 0x44, 0x07, 0xF5, | ||
886 | 0x82, 0x8E, 0x83, 0xE0, 0x22, 0xE4, 0x90, 0x07, | ||
887 | /*1A50*/0x2A, 0xF0, 0xA3, 0xF0, 0x12, 0x07, 0x2A, 0x75, | ||
888 | 0x83, 0x82, 0xE0, 0x54, 0x7F, 0x12, 0x07, 0x29, | ||
889 | /*1A60*/0xE0, 0x44, 0x80, 0xF0, 0x12, 0x10, 0xFC, 0x12, | ||
890 | 0x08, 0x1F, 0x75, 0x83, 0xA0, 0xE0, 0x20, 0xE0, | ||
891 | /*1A70*/0x1A, 0x90, 0x07, 0x2B, 0xE0, 0x04, 0xF0, 0x70, | ||
892 | 0x06, 0x90, 0x07, 0x2A, 0xE0, 0x04, 0xF0, 0x90, | ||
893 | /*1A80*/0x07, 0x2A, 0xE0, 0xB4, 0x10, 0xE1, 0xA3, 0xE0, | ||
894 | 0xB4, 0x00, 0xDC, 0xEE, 0x44, 0xA6, 0xFC, 0xEF, | ||
895 | /*1A90*/0x44, 0x07, 0xF5, 0x82, 0x8C, 0x83, 0xE0, 0xF5, | ||
896 | 0x32, 0xEE, 0x44, 0xA8, 0xFE, 0xEF, 0x44, 0x07, | ||
897 | /*1AA0*/0xF5, 0x82, 0x8E, 0x83, 0xE0, 0xF5, 0x33, 0x22, | ||
898 | 0x01, 0x20, 0x11, 0x00, 0x04, 0x20, 0x00, 0x90, | ||
899 | /*1AB0*/0x00, 0x20, 0x0F, 0x92, 0x00, 0x21, 0x0F, 0x94, | ||
900 | 0x00, 0x22, 0x0F, 0x96, 0x00, 0x23, 0x0F, 0x98, | ||
901 | /*1AC0*/0x00, 0x24, 0x0F, 0x9A, 0x00, 0x25, 0x0F, 0x9C, | ||
902 | 0x00, 0x26, 0x0F, 0x9E, 0x00, 0x27, 0x0F, 0xA0, | ||
903 | /*1AD0*/0x01, 0x20, 0x01, 0xA2, 0x01, 0x21, 0x01, 0xA4, | ||
904 | 0x01, 0x22, 0x01, 0xA6, 0x01, 0x23, 0x01, 0xA8, | ||
905 | /*1AE0*/0x01, 0x24, 0x01, 0xAA, 0x01, 0x25, 0x01, 0xAC, | ||
906 | 0x01, 0x26, 0x01, 0xAE, 0x01, 0x27, 0x01, 0xB0, | ||
907 | /*1AF0*/0x01, 0x28, 0x01, 0xB4, 0x00, 0x28, 0x0F, 0xB6, | ||
908 | 0x40, 0x28, 0x0F, 0xB8, 0x61, 0x28, 0x01, 0xCB, | ||
909 | /*1B00*/0xEF, 0xCB, 0xCA, 0xEE, 0xCA, 0x7F, 0x01, 0xE4, | ||
910 | 0xFD, 0xEB, 0x4A, 0x70, 0x24, 0xE5, 0x08, 0xF5, | ||
911 | /*1B10*/0x82, 0x74, 0xB6, 0x12, 0x08, 0x29, 0xE5, 0x08, | ||
912 | 0xF5, 0x82, 0x74, 0xB8, 0x12, 0x08, 0x29, 0xE5, | ||
913 | /*1B20*/0x08, 0xF5, 0x82, 0x74, 0xBA, 0x12, 0x08, 0x29, | ||
914 | 0x7E, 0x00, 0x7C, 0x00, 0x12, 0x0A, 0xFF, 0x80, | ||
915 | /*1B30*/0x12, 0x90, 0x07, 0x26, 0x12, 0x07, 0x35, 0xE5, | ||
916 | 0x41, 0xF0, 0x90, 0x07, 0x24, 0x12, 0x07, 0x35, | ||
917 | /*1B40*/0xE5, 0x40, 0xF0, 0x12, 0x07, 0x2A, 0x75, 0x83, | ||
918 | 0x8E, 0xE4, 0x12, 0x07, 0x29, 0x74, 0x01, 0x12, | ||
919 | /*1B50*/0x07, 0x29, 0xE4, 0xF0, 0x22, 0xE4, 0xF5, 0x26, | ||
920 | 0xF5, 0x27, 0x53, 0xE1, 0xFE, 0xF5, 0x2A, 0x75, | ||
921 | /*1B60*/0x2B, 0x01, 0xF5, 0x08, 0x7F, 0x01, 0x12, 0x17, | ||
922 | 0x31, 0x30, 0x30, 0x1C, 0x90, 0x1A, 0xA9, 0xE4, | ||
923 | /*1B70*/0x93, 0xF5, 0x10, 0x90, 0x1F, 0xF9, 0xE4, 0x93, | ||
924 | 0xF5, 0x10, 0x90, 0x00, 0x41, 0xE4, 0x93, 0xF5, | ||
925 | /*1B80*/0x10, 0x90, 0x1E, 0xCA, 0xE4, 0x93, 0xF5, 0x10, | ||
926 | 0x7F, 0x02, 0x12, 0x17, 0x31, 0x12, 0x0F, 0x54, | ||
927 | /*1B90*/0x7F, 0x03, 0x12, 0x17, 0x31, 0x12, 0x00, 0x06, | ||
928 | 0xE5, 0xE2, 0x30, 0xE7, 0x09, 0x12, 0x10, 0x00, | ||
929 | /*1BA0*/0x30, 0x30, 0x03, 0x12, 0x11, 0x00, 0x02, 0x00, | ||
930 | 0x47, 0x12, 0x08, 0x1F, 0x75, 0x83, 0xD0, 0xE0, | ||
931 | /*1BB0*/0xC4, 0x54, 0x0F, 0xFD, 0x75, 0x43, 0x01, 0x75, | ||
932 | 0x44, 0xFF, 0x12, 0x08, 0xAA, 0x74, 0x04, 0xF0, | ||
933 | /*1BC0*/0x75, 0x3B, 0x01, 0xED, 0x14, 0x60, 0x0C, 0x14, | ||
934 | 0x60, 0x0B, 0x14, 0x60, 0x0F, 0x24, 0x03, 0x70, | ||
935 | /*1BD0*/0x0B, 0x80, 0x09, 0x80, 0x00, 0x12, 0x08, 0xA7, | ||
936 | 0x04, 0xF0, 0x80, 0x06, 0x12, 0x08, 0xA7, 0x74, | ||
937 | /*1BE0*/0x04, 0xF0, 0xEE, 0x44, 0x82, 0xFE, 0xEF, 0x44, | ||
938 | 0x07, 0xF5, 0x82, 0x8E, 0x83, 0xE5, 0x45, 0x12, | ||
939 | /*1BF0*/0x08, 0xBE, 0x75, 0x83, 0x82, 0xE5, 0x31, 0xF0, | ||
940 | 0x02, 0x11, 0x4C, 0x8E, 0x60, 0x8F, 0x61, 0x12, | ||
941 | /*1C00*/0x1E, 0xA5, 0xE4, 0xFF, 0xCE, 0xED, 0xCE, 0xEE, | ||
942 | 0xD3, 0x95, 0x61, 0xE5, 0x60, 0x12, 0x07, 0x6B, | ||
943 | /*1C10*/0x40, 0x39, 0x74, 0x20, 0x2E, 0xF5, 0x82, 0xE4, | ||
944 | 0x34, 0x03, 0xF5, 0x83, 0xE0, 0x70, 0x03, 0xFF, | ||
945 | /*1C20*/0x80, 0x26, 0x12, 0x08, 0xE2, 0xFD, 0xC3, 0x9F, | ||
946 | 0x40, 0x1E, 0xCF, 0xED, 0xCF, 0xEB, 0x4A, 0x70, | ||
947 | /*1C30*/0x0B, 0x8D, 0x42, 0x12, 0x08, 0xEE, 0xF5, 0x41, | ||
948 | 0x8E, 0x40, 0x80, 0x0C, 0x12, 0x08, 0xE2, 0xF5, | ||
949 | /*1C40*/0x38, 0x12, 0x08, 0xEE, 0xF5, 0x39, 0x8E, 0x3A, | ||
950 | 0x1E, 0x80, 0xBC, 0x22, 0x75, 0x58, 0x01, 0xE5, | ||
951 | /*1C50*/0x35, 0x70, 0x0C, 0x12, 0x07, 0xCC, 0xE0, 0xF5, | ||
952 | 0x4A, 0x12, 0x07, 0xD8, 0xE0, 0xF5, 0x4C, 0xE5, | ||
953 | /*1C60*/0x35, 0xB4, 0x04, 0x0C, 0x12, 0x07, 0xE4, 0xE0, | ||
954 | 0xF5, 0x4A, 0x12, 0x07, 0xF0, 0xE0, 0xF5, 0x4C, | ||
955 | /*1C70*/0xE5, 0x35, 0xB4, 0x01, 0x04, 0x7F, 0x01, 0x80, | ||
956 | 0x02, 0x7F, 0x00, 0xE5, 0x35, 0xB4, 0x02, 0x04, | ||
957 | /*1C80*/0x7E, 0x01, 0x80, 0x02, 0x7E, 0x00, 0xEE, 0x4F, | ||
958 | 0x60, 0x0C, 0x12, 0x07, 0xFC, 0xE0, 0xF5, 0x4A, | ||
959 | /*1C90*/0x12, 0x08, 0x08, 0xE0, 0xF5, 0x4C, 0x85, 0x41, | ||
960 | 0x49, 0x85, 0x40, 0x4B, 0x22, 0x75, 0x5B, 0x01, | ||
961 | /*1CA0*/0x90, 0x07, 0x24, 0x12, 0x07, 0x35, 0xE0, 0x54, | ||
962 | 0x1F, 0xFF, 0xD3, 0x94, 0x02, 0x50, 0x04, 0x8F, | ||
963 | /*1CB0*/0x58, 0x80, 0x05, 0xEF, 0x24, 0xFE, 0xF5, 0x58, | ||
964 | 0xEF, 0xC3, 0x94, 0x18, 0x40, 0x05, 0x75, 0x59, | ||
965 | /*1CC0*/0x18, 0x80, 0x04, 0xEF, 0x04, 0xF5, 0x59, 0x85, | ||
966 | 0x43, 0x5A, 0xAF, 0x58, 0x7E, 0x00, 0xAD, 0x59, | ||
967 | /*1CD0*/0x7C, 0x00, 0xAB, 0x5B, 0x7A, 0x00, 0x12, 0x15, | ||
968 | 0x41, 0xAF, 0x5A, 0x7E, 0x00, 0x12, 0x18, 0x0A, | ||
969 | /*1CE0*/0xAF, 0x5B, 0x7E, 0x00, 0x02, 0x1A, 0xFF, 0xE5, | ||
970 | 0xE2, 0x30, 0xE7, 0x0E, 0x12, 0x10, 0x03, 0xC2, | ||
971 | /*1CF0*/0x30, 0x30, 0x30, 0x03, 0x12, 0x10, 0xFF, 0x20, | ||
972 | 0x33, 0x28, 0xE5, 0xE7, 0x30, 0xE7, 0x05, 0x12, | ||
973 | /*1D00*/0x0E, 0xA2, 0x80, 0x0D, 0xE5, 0xFE, 0xC3, 0x94, | ||
974 | 0x20, 0x50, 0x06, 0x12, 0x0E, 0xA2, 0x43, 0xF9, | ||
975 | /*1D10*/0x08, 0xE5, 0xF2, 0x30, 0xE7, 0x03, 0x53, 0xF9, | ||
976 | 0x7F, 0xE5, 0xF1, 0x54, 0x70, 0xD3, 0x94, 0x00, | ||
977 | /*1D20*/0x50, 0xD8, 0x22, 0x12, 0x0E, 0x04, 0x75, 0x83, | ||
978 | 0x80, 0xE4, 0xF0, 0xE5, 0x08, 0x44, 0x07, 0x12, | ||
979 | /*1D30*/0x0D, 0xFD, 0x75, 0x83, 0x84, 0x12, 0x0E, 0x02, | ||
980 | 0x75, 0x83, 0x86, 0x12, 0x0E, 0x02, 0x75, 0x83, | ||
981 | /*1D40*/0x8C, 0xE0, 0x54, 0xF3, 0x12, 0x0E, 0x03, 0x75, | ||
982 | 0x83, 0x8E, 0x12, 0x0E, 0x02, 0x75, 0x83, 0x94, | ||
983 | /*1D50*/0xE0, 0x54, 0xFB, 0xF0, 0x22, 0x12, 0x07, 0x2A, | ||
984 | 0x75, 0x83, 0x8E, 0xE4, 0x12, 0x07, 0x29, 0x74, | ||
985 | /*1D60*/0x01, 0x12, 0x07, 0x29, 0xE4, 0x12, 0x08, 0xBE, | ||
986 | 0x75, 0x83, 0x8C, 0xE0, 0x44, 0x20, 0x12, 0x08, | ||
987 | /*1D70*/0xBE, 0xE0, 0x54, 0xDF, 0xF0, 0x74, 0x84, 0x85, | ||
988 | 0x08, 0x82, 0xF5, 0x83, 0xE0, 0x54, 0x7F, 0xF0, | ||
989 | /*1D80*/0xE0, 0x44, 0x80, 0xF0, 0x22, 0x75, 0x56, 0x01, | ||
990 | 0xE4, 0xFD, 0xF5, 0x57, 0xAF, 0x35, 0xFE, 0xFC, | ||
991 | /*1D90*/0x12, 0x09, 0x15, 0x12, 0x1C, 0x9D, 0x12, 0x1E, | ||
992 | 0x7A, 0x12, 0x1C, 0x4C, 0xAF, 0x57, 0x7E, 0x00, | ||
993 | /*1DA0*/0xAD, 0x56, 0x7C, 0x00, 0x12, 0x04, 0x44, 0xAF, | ||
994 | 0x56, 0x7E, 0x00, 0x02, 0x11, 0xEE, 0x75, 0x56, | ||
995 | /*1DB0*/0x01, 0xE4, 0xFD, 0xF5, 0x57, 0xAF, 0x35, 0xFE, | ||
996 | 0xFC, 0x12, 0x09, 0x15, 0x12, 0x1C, 0x9D, 0x12, | ||
997 | /*1DC0*/0x1E, 0x7A, 0x12, 0x1C, 0x4C, 0xAF, 0x57, 0x7E, | ||
998 | 0x00, 0xAD, 0x56, 0x7C, 0x00, 0x12, 0x04, 0x44, | ||
999 | /*1DD0*/0xAF, 0x56, 0x7E, 0x00, 0x02, 0x11, 0xEE, 0xE4, | ||
1000 | 0xF5, 0x16, 0x12, 0x0E, 0x44, 0xFE, 0xE5, 0x08, | ||
1001 | /*1DE0*/0x44, 0x05, 0xFF, 0x12, 0x0E, 0x65, 0x8F, 0x82, | ||
1002 | 0x8E, 0x83, 0xF0, 0x05, 0x16, 0xE5, 0x16, 0xC3, | ||
1003 | /*1DF0*/0x94, 0x14, 0x40, 0xE6, 0xE5, 0x08, 0x12, 0x0E, | ||
1004 | 0x2B, 0xE4, 0xF0, 0x22, 0xE4, 0xF5, 0x58, 0xF5, | ||
1005 | /*1E00*/0x59, 0xF5, 0x5A, 0xFF, 0xFE, 0xAD, 0x58, 0xFC, | ||
1006 | 0x12, 0x09, 0x15, 0x7F, 0x04, 0x7E, 0x00, 0xAD, | ||
1007 | /*1E10*/0x58, 0x7C, 0x00, 0x12, 0x09, 0x15, 0x7F, 0x02, | ||
1008 | 0x7E, 0x00, 0xAD, 0x58, 0x7C, 0x00, 0x02, 0x09, | ||
1009 | /*1E20*/0x15, 0xE5, 0x3C, 0x25, 0x3E, 0xFC, 0xE5, 0x42, | ||
1010 | 0x24, 0x00, 0xFB, 0xE4, 0x33, 0xFA, 0xEC, 0xC3, | ||
1011 | /*1E30*/0x9B, 0xEA, 0x12, 0x07, 0x6B, 0x40, 0x0B, 0x8C, | ||
1012 | 0x42, 0xE5, 0x3D, 0x25, 0x3F, 0xF5, 0x41, 0x8F, | ||
1013 | /*1E40*/0x40, 0x22, 0x12, 0x09, 0x0B, 0x22, 0x74, 0x84, | ||
1014 | 0xF5, 0x18, 0x85, 0x08, 0x19, 0x85, 0x19, 0x82, | ||
1015 | /*1E50*/0x85, 0x18, 0x83, 0xE0, 0x54, 0x7F, 0xF0, 0xE0, | ||
1016 | 0x44, 0x80, 0xF0, 0xE0, 0x44, 0x80, 0xF0, 0x22, | ||
1017 | /*1E60*/0xEF, 0x4E, 0x70, 0x0B, 0x12, 0x07, 0x2A, 0x75, | ||
1018 | 0x83, 0xD2, 0xE0, 0x54, 0xDF, 0xF0, 0x22, 0x12, | ||
1019 | /*1E70*/0x07, 0x2A, 0x75, 0x83, 0xD2, 0xE0, 0x44, 0x20, | ||
1020 | 0xF0, 0x22, 0x75, 0x58, 0x01, 0x90, 0x07, 0x26, | ||
1021 | /*1E80*/0x12, 0x07, 0x35, 0xE0, 0x54, 0x3F, 0xF5, 0x41, | ||
1022 | 0x12, 0x07, 0x32, 0xE0, 0x54, 0x3F, 0xF5, 0x40, | ||
1023 | /*1E90*/0x22, 0x75, 0x56, 0x02, 0xE4, 0xF5, 0x57, 0x12, | ||
1024 | 0x1D, 0xFC, 0xAF, 0x57, 0x7E, 0x00, 0xAD, 0x56, | ||
1025 | /*1EA0*/0x7C, 0x00, 0x02, 0x04, 0x44, 0xE4, 0xF5, 0x42, | ||
1026 | 0xF5, 0x41, 0xF5, 0x40, 0xF5, 0x38, 0xF5, 0x39, | ||
1027 | /*1EB0*/0xF5, 0x3A, 0x22, 0xEF, 0x54, 0x07, 0xFF, 0xE5, | ||
1028 | 0xF9, 0x54, 0xF8, 0x4F, 0xF5, 0xF9, 0x22, 0x7F, | ||
1029 | /*1EC0*/0x01, 0xE4, 0xFE, 0x0F, 0x0E, 0xBE, 0xFF, 0xFB, | ||
1030 | 0x22, 0x01, 0x20, 0x00, 0x01, 0x04, 0x20, 0x00, | ||
1031 | /*1ED0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1032 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1033 | /*1EE0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1034 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1035 | /*1EF0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1036 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1037 | /*1F00*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1038 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1039 | /*1F10*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1040 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1041 | /*1F20*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1042 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1043 | /*1F30*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1044 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1045 | /*1F40*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1046 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1047 | /*1F50*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1048 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1049 | /*1F60*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1050 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1051 | /*1F70*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1052 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1053 | /*1F80*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1054 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1055 | /*1F90*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1056 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1057 | /*1FA0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1058 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1059 | /*1FB0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1060 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1061 | /*1FC0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1062 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1063 | /*1FD0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1064 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1065 | /*1FE0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1066 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1067 | /*1FF0*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
1068 | 0x01, 0x20, 0x11, 0x00, 0x04, 0x20, 0x00, 0x81 | ||
1069 | }; | ||
1070 | |||
1071 | int qib_sd7220_ib_load(struct qib_devdata *dd) | ||
1072 | { | ||
1073 | return qib_sd7220_prog_ld(dd, IB_7220_SERDES, qib_sd7220_ib_img, | ||
1074 | sizeof(qib_sd7220_ib_img), 0); | ||
1075 | } | ||
1076 | |||
1077 | int qib_sd7220_ib_vfy(struct qib_devdata *dd) | ||
1078 | { | ||
1079 | return qib_sd7220_prog_vfy(dd, IB_7220_SERDES, qib_sd7220_ib_img, | ||
1080 | sizeof(qib_sd7220_ib_img), 0); | ||
1081 | } | ||
diff --git a/drivers/infiniband/hw/qib/qib_tx.c b/drivers/infiniband/hw/qib/qib_tx.c index f7eb1ddff5f3..af30232b6831 100644 --- a/drivers/infiniband/hw/qib/qib_tx.c +++ b/drivers/infiniband/hw/qib/qib_tx.c | |||
@@ -340,9 +340,13 @@ rescan: | |||
340 | if (i < dd->piobcnt2k) | 340 | if (i < dd->piobcnt2k) |
341 | buf = (u32 __iomem *)(dd->pio2kbase + | 341 | buf = (u32 __iomem *)(dd->pio2kbase + |
342 | i * dd->palign); | 342 | i * dd->palign); |
343 | else | 343 | else if (i < dd->piobcnt2k + dd->piobcnt4k || !dd->piovl15base) |
344 | buf = (u32 __iomem *)(dd->pio4kbase + | 344 | buf = (u32 __iomem *)(dd->pio4kbase + |
345 | (i - dd->piobcnt2k) * dd->align4k); | 345 | (i - dd->piobcnt2k) * dd->align4k); |
346 | else | ||
347 | buf = (u32 __iomem *)(dd->piovl15base + | ||
348 | (i - (dd->piobcnt2k + dd->piobcnt4k)) * | ||
349 | dd->align4k); | ||
346 | if (pbufnum) | 350 | if (pbufnum) |
347 | *pbufnum = i; | 351 | *pbufnum = i; |
348 | dd->upd_pio_shadow = 0; | 352 | dd->upd_pio_shadow = 0; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index df3eb8c9fd96..b4b22576f12a 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -1163,7 +1163,7 @@ static ssize_t create_child(struct device *dev, | |||
1163 | 1163 | ||
1164 | return ret ? ret : count; | 1164 | return ret ? ret : count; |
1165 | } | 1165 | } |
1166 | static DEVICE_ATTR(create_child, S_IWUGO, NULL, create_child); | 1166 | static DEVICE_ATTR(create_child, S_IWUSR, NULL, create_child); |
1167 | 1167 | ||
1168 | static ssize_t delete_child(struct device *dev, | 1168 | static ssize_t delete_child(struct device *dev, |
1169 | struct device_attribute *attr, | 1169 | struct device_attribute *attr, |
@@ -1183,7 +1183,7 @@ static ssize_t delete_child(struct device *dev, | |||
1183 | return ret ? ret : count; | 1183 | return ret ? ret : count; |
1184 | 1184 | ||
1185 | } | 1185 | } |
1186 | static DEVICE_ATTR(delete_child, S_IWUGO, NULL, delete_child); | 1186 | static DEVICE_ATTR(delete_child, S_IWUSR, NULL, delete_child); |
1187 | 1187 | ||
1188 | int ipoib_add_pkey_attr(struct net_device *dev) | 1188 | int ipoib_add_pkey_attr(struct net_device *dev) |
1189 | { | 1189 | { |
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index fbd62abb66f9..0ffaf2c77a19 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c | |||
@@ -89,7 +89,6 @@ struct gc_pad { | |||
89 | struct gc { | 89 | struct gc { |
90 | struct pardevice *pd; | 90 | struct pardevice *pd; |
91 | struct gc_pad pads[GC_MAX_DEVICES]; | 91 | struct gc_pad pads[GC_MAX_DEVICES]; |
92 | struct input_dev *dev[GC_MAX_DEVICES]; | ||
93 | struct timer_list timer; | 92 | struct timer_list timer; |
94 | int pad_count[GC_MAX]; | 93 | int pad_count[GC_MAX]; |
95 | int used; | 94 | int used; |
@@ -387,7 +386,7 @@ static void gc_nes_process_packet(struct gc *gc) | |||
387 | for (i = 0; i < GC_MAX_DEVICES; i++) { | 386 | for (i = 0; i < GC_MAX_DEVICES; i++) { |
388 | 387 | ||
389 | pad = &gc->pads[i]; | 388 | pad = &gc->pads[i]; |
390 | dev = gc->dev[i]; | 389 | dev = pad->dev; |
391 | s = gc_status_bit[i]; | 390 | s = gc_status_bit[i]; |
392 | 391 | ||
393 | switch (pad->type) { | 392 | switch (pad->type) { |
@@ -579,7 +578,7 @@ static void gc_psx_command(struct gc *gc, int b, unsigned char *data) | |||
579 | read = parport_read_status(port) ^ 0x80; | 578 | read = parport_read_status(port) ^ 0x80; |
580 | 579 | ||
581 | for (j = 0; j < GC_MAX_DEVICES; j++) { | 580 | for (j = 0; j < GC_MAX_DEVICES; j++) { |
582 | struct gc_pad *pad = &gc->pads[i]; | 581 | struct gc_pad *pad = &gc->pads[j]; |
583 | 582 | ||
584 | if (pad->type == GC_PSX || pad->type == GC_DDR) | 583 | if (pad->type == GC_PSX || pad->type == GC_DDR) |
585 | data[j] |= (read & gc_status_bit[j]) ? (1 << i) : 0; | 584 | data[j] |= (read & gc_status_bit[j]) ? (1 << i) : 0; |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 0f9a4785d798..1ba25145b333 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -69,11 +69,11 @@ config KEYBOARD_ATARI | |||
69 | module will be called atakbd. | 69 | module will be called atakbd. |
70 | 70 | ||
71 | config KEYBOARD_ATKBD | 71 | config KEYBOARD_ATKBD |
72 | tristate "AT keyboard" if EMBEDDED || !X86 || X86_MRST | 72 | tristate "AT keyboard" if EMBEDDED || !X86 |
73 | default y | 73 | default y |
74 | select SERIO | 74 | select SERIO |
75 | select SERIO_LIBPS2 | 75 | select SERIO_LIBPS2 |
76 | select SERIO_I8042 if X86 && !X86_MRST | 76 | select SERIO_I8042 if X86 |
77 | select SERIO_GSCPS2 if GSC | 77 | select SERIO_GSCPS2 if GSC |
78 | help | 78 | help |
79 | Say Y here if you want to use a standard AT or PS/2 keyboard. Usually | 79 | Say Y here if you want to use a standard AT or PS/2 keyboard. Usually |
@@ -124,7 +124,7 @@ config KEYBOARD_ATKBD_RDI_KEYCODES | |||
124 | right-hand column will be interpreted as the key shown in the | 124 | right-hand column will be interpreted as the key shown in the |
125 | left-hand column. | 125 | left-hand column. |
126 | 126 | ||
127 | config QT2160 | 127 | config KEYBOARD_QT2160 |
128 | tristate "Atmel AT42QT2160 Touch Sensor Chip" | 128 | tristate "Atmel AT42QT2160 Touch Sensor Chip" |
129 | depends on I2C && EXPERIMENTAL | 129 | depends on I2C && EXPERIMENTAL |
130 | help | 130 | help |
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index 7aa59e07b689..fb16b5e5ea13 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c | |||
@@ -51,8 +51,12 @@ | |||
51 | */ | 51 | */ |
52 | #define TWL4030_MAX_ROWS 8 /* TWL4030 hard limit */ | 52 | #define TWL4030_MAX_ROWS 8 /* TWL4030 hard limit */ |
53 | #define TWL4030_MAX_COLS 8 | 53 | #define TWL4030_MAX_COLS 8 |
54 | #define TWL4030_ROW_SHIFT 3 | 54 | /* |
55 | #define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS * TWL4030_MAX_COLS) | 55 | * Note that we add space for an extra column so that we can handle |
56 | * row lines connected to the gnd (see twl4030_col_xlate()). | ||
57 | */ | ||
58 | #define TWL4030_ROW_SHIFT 4 | ||
59 | #define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS << TWL4030_ROW_SHIFT) | ||
56 | 60 | ||
57 | struct twl4030_keypad { | 61 | struct twl4030_keypad { |
58 | unsigned short keymap[TWL4030_KEYMAP_SIZE]; | 62 | unsigned short keymap[TWL4030_KEYMAP_SIZE]; |
@@ -182,7 +186,7 @@ static int twl4030_read_kp_matrix_state(struct twl4030_keypad *kp, u16 *state) | |||
182 | return ret; | 186 | return ret; |
183 | } | 187 | } |
184 | 188 | ||
185 | static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state) | 189 | static bool twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state) |
186 | { | 190 | { |
187 | int i; | 191 | int i; |
188 | u16 check = 0; | 192 | u16 check = 0; |
@@ -191,12 +195,12 @@ static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state) | |||
191 | u16 col = key_state[i]; | 195 | u16 col = key_state[i]; |
192 | 196 | ||
193 | if ((col & check) && hweight16(col) > 1) | 197 | if ((col & check) && hweight16(col) > 1) |
194 | return 1; | 198 | return true; |
195 | 199 | ||
196 | check |= col; | 200 | check |= col; |
197 | } | 201 | } |
198 | 202 | ||
199 | return 0; | 203 | return false; |
200 | } | 204 | } |
201 | 205 | ||
202 | static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all) | 206 | static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all) |
@@ -225,7 +229,8 @@ static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all) | |||
225 | if (!changed) | 229 | if (!changed) |
226 | continue; | 230 | continue; |
227 | 231 | ||
228 | for (col = 0; col < kp->n_cols; col++) { | 232 | /* Extra column handles "all gnd" rows */ |
233 | for (col = 0; col < kp->n_cols + 1; col++) { | ||
229 | int code; | 234 | int code; |
230 | 235 | ||
231 | if (!(changed & (1 << col))) | 236 | if (!(changed & (1 << col))) |
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c index 4ef764cc493c..ee2bf6bcf291 100644 --- a/drivers/input/keyboard/w90p910_keypad.c +++ b/drivers/input/keyboard/w90p910_keypad.c | |||
@@ -258,7 +258,7 @@ static struct platform_driver w90p910_keypad_driver = { | |||
258 | .probe = w90p910_keypad_probe, | 258 | .probe = w90p910_keypad_probe, |
259 | .remove = __devexit_p(w90p910_keypad_remove), | 259 | .remove = __devexit_p(w90p910_keypad_remove), |
260 | .driver = { | 260 | .driver = { |
261 | .name = "nuc900-keypad", | 261 | .name = "nuc900-kpi", |
262 | .owner = THIS_MODULE, | 262 | .owner = THIS_MODULE, |
263 | }, | 263 | }, |
264 | }; | 264 | }; |
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index eeb58c1cac16..c714ca2407f8 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig | |||
@@ -17,7 +17,7 @@ config MOUSE_PS2 | |||
17 | default y | 17 | default y |
18 | select SERIO | 18 | select SERIO |
19 | select SERIO_LIBPS2 | 19 | select SERIO_LIBPS2 |
20 | select SERIO_I8042 if X86 && !X86_MRST | 20 | select SERIO_I8042 if X86 |
21 | select SERIO_GSCPS2 if GSC | 21 | select SERIO_GSCPS2 if GSC |
22 | help | 22 | help |
23 | Say Y here if you have a PS/2 mouse connected to your system. This | 23 | Say Y here if you have a PS/2 mouse connected to your system. This |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 40cea334ad13..705589dc9ac5 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -141,8 +141,13 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
141 | priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | 141 | priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2]; |
142 | priv->ext_cap = priv->ext_cap_0c = 0; | 142 | priv->ext_cap = priv->ext_cap_0c = 0; |
143 | 143 | ||
144 | if (!SYN_CAP_VALID(priv->capabilities)) | 144 | /* |
145 | * Older firmwares had submodel ID fixed to 0x47 | ||
146 | */ | ||
147 | if (SYN_ID_FULL(priv->identity) < 0x705 && | ||
148 | SYN_CAP_SUBMODEL_ID(priv->capabilities) != 0x47) { | ||
145 | return -1; | 149 | return -1; |
150 | } | ||
146 | 151 | ||
147 | /* | 152 | /* |
148 | * Unless capExtended is set the rest of the flags should be ignored | 153 | * Unless capExtended is set the rest of the flags should be ignored |
@@ -206,6 +211,7 @@ static int synaptics_resolution(struct psmouse *psmouse) | |||
206 | unsigned char max[3]; | 211 | unsigned char max[3]; |
207 | 212 | ||
208 | if (SYN_ID_MAJOR(priv->identity) < 4) | 213 | if (SYN_ID_MAJOR(priv->identity) < 4) |
214 | return 0; | ||
209 | 215 | ||
210 | if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res) == 0) { | 216 | if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res) == 0) { |
211 | if (res[0] != 0 && (res[1] & 0x80) && res[2] != 0) { | 217 | if (res[0] != 0 && (res[1] & 0x80) && res[2] != 0) { |
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 7d4d5e12c0df..b6aa7d20d8a3 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -47,7 +47,7 @@ | |||
47 | #define SYN_CAP_FOUR_BUTTON(c) ((c) & (1 << 3)) | 47 | #define SYN_CAP_FOUR_BUTTON(c) ((c) & (1 << 3)) |
48 | #define SYN_CAP_MULTIFINGER(c) ((c) & (1 << 1)) | 48 | #define SYN_CAP_MULTIFINGER(c) ((c) & (1 << 1)) |
49 | #define SYN_CAP_PALMDETECT(c) ((c) & (1 << 0)) | 49 | #define SYN_CAP_PALMDETECT(c) ((c) & (1 << 0)) |
50 | #define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47) | 50 | #define SYN_CAP_SUBMODEL_ID(c) (((c) & 0x00ff00) >> 8) |
51 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) | 51 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) |
52 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) | 52 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) |
53 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) | 53 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) |
@@ -66,6 +66,7 @@ | |||
66 | #define SYN_ID_MODEL(i) (((i) >> 4) & 0x0f) | 66 | #define SYN_ID_MODEL(i) (((i) >> 4) & 0x0f) |
67 | #define SYN_ID_MAJOR(i) ((i) & 0x0f) | 67 | #define SYN_ID_MAJOR(i) ((i) & 0x0f) |
68 | #define SYN_ID_MINOR(i) (((i) >> 16) & 0xff) | 68 | #define SYN_ID_MINOR(i) (((i) >> 16) & 0xff) |
69 | #define SYN_ID_FULL(i) ((SYN_ID_MAJOR(i) << 8) | SYN_ID_MINOR(i)) | ||
69 | #define SYN_ID_IS_SYNAPTICS(i) ((((i) >> 8) & 0xff) == 0x47) | 70 | #define SYN_ID_IS_SYNAPTICS(i) ((((i) >> 8) & 0xff) == 0x47) |
70 | 71 | ||
71 | /* synaptics special commands */ | 72 | /* synaptics special commands */ |
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index 256b9e9394dc..3bfe8fafc6ad 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig | |||
@@ -22,7 +22,7 @@ config SERIO_I8042 | |||
22 | tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 | 22 | tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 |
23 | default y | 23 | default y |
24 | depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \ | 24 | depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \ |
25 | (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !X86_MRST | 25 | (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN |
26 | help | 26 | help |
27 | i8042 is the chip over which the standard AT keyboard and PS/2 | 27 | i8042 is the chip over which the standard AT keyboard and PS/2 |
28 | mouse are connected to the computer. If you use these devices, | 28 | mouse are connected to the computer. If you use these devices, |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 6168469ad1a6..ed7ad7416b24 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -7,6 +7,10 @@ | |||
7 | * the Free Software Foundation. | 7 | * the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifdef CONFIG_X86 | ||
11 | #include <asm/x86_init.h> | ||
12 | #endif | ||
13 | |||
10 | /* | 14 | /* |
11 | * Names. | 15 | * Names. |
12 | */ | 16 | */ |
@@ -166,6 +170,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { | |||
166 | }, | 170 | }, |
167 | }, | 171 | }, |
168 | { | 172 | { |
173 | /* Gigabyte Spring Peak - defines wrong chassis type */ | ||
174 | .matches = { | ||
175 | DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), | ||
176 | DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"), | ||
177 | }, | ||
178 | }, | ||
179 | { | ||
169 | .matches = { | 180 | .matches = { |
170 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | 181 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), |
171 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"), | 182 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"), |
@@ -840,6 +851,12 @@ static int __init i8042_platform_init(void) | |||
840 | { | 851 | { |
841 | int retval; | 852 | int retval; |
842 | 853 | ||
854 | #ifdef CONFIG_X86 | ||
855 | /* Just return if pre-detection shows no i8042 controller exist */ | ||
856 | if (!x86_platform.i8042_detect()) | ||
857 | return -ENODEV; | ||
858 | #endif | ||
859 | |||
843 | /* | 860 | /* |
844 | * On ix86 platforms touching the i8042 data register region can do really | 861 | * On ix86 platforms touching the i8042 data register region can do really |
845 | * bad things. Because of this the region is always reserved on ix86 boxes. | 862 | * bad things. Because of this the region is always reserved on ix86 boxes. |
diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c index cc18265be1a8..7a45d68c3516 100644 --- a/drivers/input/touchscreen/w90p910_ts.c +++ b/drivers/input/touchscreen/w90p910_ts.c | |||
@@ -233,7 +233,7 @@ static int __devinit w90x900ts_probe(struct platform_device *pdev) | |||
233 | w90p910_ts->state = TS_IDLE; | 233 | w90p910_ts->state = TS_IDLE; |
234 | spin_lock_init(&w90p910_ts->lock); | 234 | spin_lock_init(&w90p910_ts->lock); |
235 | setup_timer(&w90p910_ts->timer, w90p910_check_pen_up, | 235 | setup_timer(&w90p910_ts->timer, w90p910_check_pen_up, |
236 | (unsigned long)&w90p910_ts); | 236 | (unsigned long)w90p910_ts); |
237 | 237 | ||
238 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 238 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
239 | if (!res) { | 239 | if (!res) { |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 81bf25e67ce1..e4112622e5a2 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -302,6 +302,15 @@ config LEDS_MC13783 | |||
302 | This option enable support for on-chip LED drivers found | 302 | This option enable support for on-chip LED drivers found |
303 | on Freescale Semiconductor MC13783 PMIC. | 303 | on Freescale Semiconductor MC13783 PMIC. |
304 | 304 | ||
305 | config LEDS_NS2 | ||
306 | tristate "LED support for Network Space v2 GPIO LEDs" | ||
307 | depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || MACH_NETSPACE_MAX_V2 | ||
308 | default y | ||
309 | help | ||
310 | This option enable support for the dual-GPIO LED found on the | ||
311 | Network Space v2 board (and parents). This include Internet Space v2, | ||
312 | Network Space (Max) v2 and d2 Network v2 boards. | ||
313 | |||
305 | config LEDS_TRIGGERS | 314 | config LEDS_TRIGGERS |
306 | bool "LED Trigger support" | 315 | bool "LED Trigger support" |
307 | help | 316 | help |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 2493de499374..7d6b95831f8e 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -37,6 +37,7 @@ obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o | |||
37 | obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o | 37 | obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o |
38 | obj-$(CONFIG_LEDS_DELL_NETBOOKS) += dell-led.o | 38 | obj-$(CONFIG_LEDS_DELL_NETBOOKS) += dell-led.o |
39 | obj-$(CONFIG_LEDS_MC13783) += leds-mc13783.o | 39 | obj-$(CONFIG_LEDS_MC13783) += leds-mc13783.o |
40 | obj-$(CONFIG_LEDS_NS2) += leds-ns2.o | ||
40 | 41 | ||
41 | # LED SPI Drivers | 42 | # LED SPI Drivers |
42 | obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o | 43 | obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o |
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c new file mode 100644 index 000000000000..74dce4ba0262 --- /dev/null +++ b/drivers/leds/leds-ns2.c | |||
@@ -0,0 +1,338 @@ | |||
1 | /* | ||
2 | * leds-ns2.c - Driver for the Network Space v2 (and parents) dual-GPIO LED | ||
3 | * | ||
4 | * Copyright (C) 2010 LaCie | ||
5 | * | ||
6 | * Author: Simon Guinot <sguinot@lacie.com> | ||
7 | * | ||
8 | * Based on leds-gpio.c by Raphael Assenat <raph@8d.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | ||
24 | |||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/slab.h> | ||
29 | #include <linux/gpio.h> | ||
30 | #include <linux/leds.h> | ||
31 | #include <mach/leds-ns2.h> | ||
32 | |||
33 | /* | ||
34 | * The Network Space v2 dual-GPIO LED is wired to a CPLD and can blink in | ||
35 | * relation with the SATA activity. This capability is exposed through the | ||
36 | * "sata" sysfs attribute. | ||
37 | * | ||
38 | * The following array detail the different LED registers and the combination | ||
39 | * of their possible values: | ||
40 | * | ||
41 | * cmd_led | slow_led | /SATA active | LED state | ||
42 | * | | | | ||
43 | * 1 | 0 | x | off | ||
44 | * - | 1 | x | on | ||
45 | * 0 | 0 | 1 | on | ||
46 | * 0 | 0 | 0 | blink (rate 300ms) | ||
47 | */ | ||
48 | |||
49 | enum ns2_led_modes { | ||
50 | NS_V2_LED_OFF, | ||
51 | NS_V2_LED_ON, | ||
52 | NS_V2_LED_SATA, | ||
53 | }; | ||
54 | |||
55 | struct ns2_led_mode_value { | ||
56 | enum ns2_led_modes mode; | ||
57 | int cmd_level; | ||
58 | int slow_level; | ||
59 | }; | ||
60 | |||
61 | static struct ns2_led_mode_value ns2_led_modval[] = { | ||
62 | { NS_V2_LED_OFF , 1, 0 }, | ||
63 | { NS_V2_LED_ON , 0, 1 }, | ||
64 | { NS_V2_LED_ON , 1, 1 }, | ||
65 | { NS_V2_LED_SATA, 0, 0 }, | ||
66 | }; | ||
67 | |||
68 | struct ns2_led_data { | ||
69 | struct led_classdev cdev; | ||
70 | unsigned cmd; | ||
71 | unsigned slow; | ||
72 | unsigned char sata; /* True when SATA mode active. */ | ||
73 | rwlock_t rw_lock; /* Lock GPIOs. */ | ||
74 | }; | ||
75 | |||
76 | static int ns2_led_get_mode(struct ns2_led_data *led_dat, | ||
77 | enum ns2_led_modes *mode) | ||
78 | { | ||
79 | int i; | ||
80 | int ret = -EINVAL; | ||
81 | int cmd_level; | ||
82 | int slow_level; | ||
83 | |||
84 | read_lock(&led_dat->rw_lock); | ||
85 | |||
86 | cmd_level = gpio_get_value(led_dat->cmd); | ||
87 | slow_level = gpio_get_value(led_dat->slow); | ||
88 | |||
89 | for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { | ||
90 | if (cmd_level == ns2_led_modval[i].cmd_level && | ||
91 | slow_level == ns2_led_modval[i].slow_level) { | ||
92 | *mode = ns2_led_modval[i].mode; | ||
93 | ret = 0; | ||
94 | break; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | read_unlock(&led_dat->rw_lock); | ||
99 | |||
100 | return ret; | ||
101 | } | ||
102 | |||
103 | static void ns2_led_set_mode(struct ns2_led_data *led_dat, | ||
104 | enum ns2_led_modes mode) | ||
105 | { | ||
106 | int i; | ||
107 | |||
108 | write_lock(&led_dat->rw_lock); | ||
109 | |||
110 | for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { | ||
111 | if (mode == ns2_led_modval[i].mode) { | ||
112 | gpio_set_value(led_dat->cmd, | ||
113 | ns2_led_modval[i].cmd_level); | ||
114 | gpio_set_value(led_dat->slow, | ||
115 | ns2_led_modval[i].slow_level); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | write_unlock(&led_dat->rw_lock); | ||
120 | } | ||
121 | |||
122 | static void ns2_led_set(struct led_classdev *led_cdev, | ||
123 | enum led_brightness value) | ||
124 | { | ||
125 | struct ns2_led_data *led_dat = | ||
126 | container_of(led_cdev, struct ns2_led_data, cdev); | ||
127 | enum ns2_led_modes mode; | ||
128 | |||
129 | if (value == LED_OFF) | ||
130 | mode = NS_V2_LED_OFF; | ||
131 | else if (led_dat->sata) | ||
132 | mode = NS_V2_LED_SATA; | ||
133 | else | ||
134 | mode = NS_V2_LED_ON; | ||
135 | |||
136 | ns2_led_set_mode(led_dat, mode); | ||
137 | } | ||
138 | |||
139 | static ssize_t ns2_led_sata_store(struct device *dev, | ||
140 | struct device_attribute *attr, | ||
141 | const char *buff, size_t count) | ||
142 | { | ||
143 | int ret; | ||
144 | unsigned long enable; | ||
145 | enum ns2_led_modes mode; | ||
146 | struct ns2_led_data *led_dat = dev_get_drvdata(dev); | ||
147 | |||
148 | ret = strict_strtoul(buff, 10, &enable); | ||
149 | if (ret < 0) | ||
150 | return ret; | ||
151 | |||
152 | enable = !!enable; | ||
153 | |||
154 | if (led_dat->sata == enable) | ||
155 | return count; | ||
156 | |||
157 | ret = ns2_led_get_mode(led_dat, &mode); | ||
158 | if (ret < 0) | ||
159 | return ret; | ||
160 | |||
161 | if (enable && mode == NS_V2_LED_ON) | ||
162 | ns2_led_set_mode(led_dat, NS_V2_LED_SATA); | ||
163 | if (!enable && mode == NS_V2_LED_SATA) | ||
164 | ns2_led_set_mode(led_dat, NS_V2_LED_ON); | ||
165 | |||
166 | led_dat->sata = enable; | ||
167 | |||
168 | return count; | ||
169 | } | ||
170 | |||
171 | static ssize_t ns2_led_sata_show(struct device *dev, | ||
172 | struct device_attribute *attr, char *buf) | ||
173 | { | ||
174 | struct ns2_led_data *led_dat = dev_get_drvdata(dev); | ||
175 | |||
176 | return sprintf(buf, "%d\n", led_dat->sata); | ||
177 | } | ||
178 | |||
179 | static DEVICE_ATTR(sata, 0644, ns2_led_sata_show, ns2_led_sata_store); | ||
180 | |||
181 | static int __devinit | ||
182 | create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat, | ||
183 | const struct ns2_led *template) | ||
184 | { | ||
185 | int ret; | ||
186 | enum ns2_led_modes mode; | ||
187 | |||
188 | ret = gpio_request(template->cmd, template->name); | ||
189 | if (ret == 0) { | ||
190 | ret = gpio_direction_output(template->cmd, | ||
191 | gpio_get_value(template->cmd)); | ||
192 | if (ret) | ||
193 | gpio_free(template->cmd); | ||
194 | } | ||
195 | if (ret) { | ||
196 | dev_err(&pdev->dev, "%s: failed to setup command GPIO\n", | ||
197 | template->name); | ||
198 | } | ||
199 | |||
200 | ret = gpio_request(template->slow, template->name); | ||
201 | if (ret == 0) { | ||
202 | ret = gpio_direction_output(template->slow, | ||
203 | gpio_get_value(template->slow)); | ||
204 | if (ret) | ||
205 | gpio_free(template->slow); | ||
206 | } | ||
207 | if (ret) { | ||
208 | dev_err(&pdev->dev, "%s: failed to setup slow GPIO\n", | ||
209 | template->name); | ||
210 | goto err_free_cmd; | ||
211 | } | ||
212 | |||
213 | rwlock_init(&led_dat->rw_lock); | ||
214 | |||
215 | led_dat->cdev.name = template->name; | ||
216 | led_dat->cdev.default_trigger = template->default_trigger; | ||
217 | led_dat->cdev.blink_set = NULL; | ||
218 | led_dat->cdev.brightness_set = ns2_led_set; | ||
219 | led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; | ||
220 | led_dat->cmd = template->cmd; | ||
221 | led_dat->slow = template->slow; | ||
222 | |||
223 | ret = ns2_led_get_mode(led_dat, &mode); | ||
224 | if (ret < 0) | ||
225 | goto err_free_slow; | ||
226 | |||
227 | /* Set LED initial state. */ | ||
228 | led_dat->sata = (mode == NS_V2_LED_SATA) ? 1 : 0; | ||
229 | led_dat->cdev.brightness = | ||
230 | (mode == NS_V2_LED_OFF) ? LED_OFF : LED_FULL; | ||
231 | |||
232 | ret = led_classdev_register(&pdev->dev, &led_dat->cdev); | ||
233 | if (ret < 0) | ||
234 | goto err_free_slow; | ||
235 | |||
236 | dev_set_drvdata(led_dat->cdev.dev, led_dat); | ||
237 | ret = device_create_file(led_dat->cdev.dev, &dev_attr_sata); | ||
238 | if (ret < 0) | ||
239 | goto err_free_cdev; | ||
240 | |||
241 | return 0; | ||
242 | |||
243 | err_free_cdev: | ||
244 | led_classdev_unregister(&led_dat->cdev); | ||
245 | err_free_slow: | ||
246 | gpio_free(led_dat->slow); | ||
247 | err_free_cmd: | ||
248 | gpio_free(led_dat->cmd); | ||
249 | |||
250 | return ret; | ||
251 | } | ||
252 | |||
253 | static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) | ||
254 | { | ||
255 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); | ||
256 | led_classdev_unregister(&led_dat->cdev); | ||
257 | gpio_free(led_dat->cmd); | ||
258 | gpio_free(led_dat->slow); | ||
259 | } | ||
260 | |||
261 | static int __devinit ns2_led_probe(struct platform_device *pdev) | ||
262 | { | ||
263 | struct ns2_led_platform_data *pdata = pdev->dev.platform_data; | ||
264 | struct ns2_led_data *leds_data; | ||
265 | int i; | ||
266 | int ret; | ||
267 | |||
268 | if (!pdata) | ||
269 | return -EINVAL; | ||
270 | |||
271 | leds_data = kzalloc(sizeof(struct ns2_led_data) * | ||
272 | pdata->num_leds, GFP_KERNEL); | ||
273 | if (!leds_data) | ||
274 | return -ENOMEM; | ||
275 | |||
276 | for (i = 0; i < pdata->num_leds; i++) { | ||
277 | ret = create_ns2_led(pdev, &leds_data[i], &pdata->leds[i]); | ||
278 | if (ret < 0) | ||
279 | goto err; | ||
280 | |||
281 | } | ||
282 | |||
283 | platform_set_drvdata(pdev, leds_data); | ||
284 | |||
285 | return 0; | ||
286 | |||
287 | err: | ||
288 | for (i = i - 1; i >= 0; i--) | ||
289 | delete_ns2_led(&leds_data[i]); | ||
290 | |||
291 | kfree(leds_data); | ||
292 | |||
293 | return ret; | ||
294 | } | ||
295 | |||
296 | static int __devexit ns2_led_remove(struct platform_device *pdev) | ||
297 | { | ||
298 | int i; | ||
299 | struct ns2_led_platform_data *pdata = pdev->dev.platform_data; | ||
300 | struct ns2_led_data *leds_data; | ||
301 | |||
302 | leds_data = platform_get_drvdata(pdev); | ||
303 | |||
304 | for (i = 0; i < pdata->num_leds; i++) | ||
305 | delete_ns2_led(&leds_data[i]); | ||
306 | |||
307 | kfree(leds_data); | ||
308 | platform_set_drvdata(pdev, NULL); | ||
309 | |||
310 | return 0; | ||
311 | } | ||
312 | |||
313 | static struct platform_driver ns2_led_driver = { | ||
314 | .probe = ns2_led_probe, | ||
315 | .remove = __devexit_p(ns2_led_remove), | ||
316 | .driver = { | ||
317 | .name = "leds-ns2", | ||
318 | .owner = THIS_MODULE, | ||
319 | }, | ||
320 | }; | ||
321 | MODULE_ALIAS("platform:leds-ns2"); | ||
322 | |||
323 | static int __init ns2_led_init(void) | ||
324 | { | ||
325 | return platform_driver_register(&ns2_led_driver); | ||
326 | } | ||
327 | |||
328 | static void __exit ns2_led_exit(void) | ||
329 | { | ||
330 | platform_driver_unregister(&ns2_led_driver); | ||
331 | } | ||
332 | |||
333 | module_init(ns2_led_init); | ||
334 | module_exit(ns2_led_exit); | ||
335 | |||
336 | MODULE_AUTHOR("Simon Guinot <sguinot@lacie.com>"); | ||
337 | MODULE_DESCRIPTION("Network Space v2 LED driver"); | ||
338 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c index 8abbcc5fcf95..8cf2ab609d5e 100644 --- a/drivers/media/common/tuners/tuner-simple.c +++ b/drivers/media/common/tuners/tuner-simple.c | |||
@@ -524,6 +524,7 @@ static int simple_radio_bandswitch(struct dvb_frontend *fe, u8 *buffer) | |||
524 | buffer[3] = 0x39; | 524 | buffer[3] = 0x39; |
525 | break; | 525 | break; |
526 | case TUNER_PHILIPS_FQ1216LME_MK3: | 526 | case TUNER_PHILIPS_FQ1216LME_MK3: |
527 | case TUNER_PHILIPS_FQ1236_MK5: | ||
527 | tuner_err("This tuner doesn't have FM\n"); | 528 | tuner_err("This tuner doesn't have FM\n"); |
528 | /* Set the low band for sanity, since it covers 88-108 MHz */ | 529 | /* Set the low band for sanity, since it covers 88-108 MHz */ |
529 | buffer[3] = 0x01; | 530 | buffer[3] = 0x01; |
diff --git a/drivers/media/common/tuners/tuner-types.c b/drivers/media/common/tuners/tuner-types.c index d9aaaca620c9..58a513bcd747 100644 --- a/drivers/media/common/tuners/tuner-types.c +++ b/drivers/media/common/tuners/tuner-types.c | |||
@@ -1353,6 +1353,17 @@ static struct tuner_params tuner_sony_btf_pxn01z_params[] = { | |||
1353 | }, | 1353 | }, |
1354 | }; | 1354 | }; |
1355 | 1355 | ||
1356 | /* ------------ TUNER_PHILIPS_FQ1236_MK5 - Philips NTSC ------------ */ | ||
1357 | |||
1358 | static struct tuner_params tuner_philips_fq1236_mk5_params[] = { | ||
1359 | { | ||
1360 | .type = TUNER_PARAM_TYPE_NTSC, | ||
1361 | .ranges = tuner_fm1236_mk3_ntsc_ranges, | ||
1362 | .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges), | ||
1363 | .has_tda9887 = 1, /* TDA9885, no FM radio */ | ||
1364 | }, | ||
1365 | }; | ||
1366 | |||
1356 | /* --------------------------------------------------------------------- */ | 1367 | /* --------------------------------------------------------------------- */ |
1357 | 1368 | ||
1358 | struct tunertype tuners[] = { | 1369 | struct tunertype tuners[] = { |
@@ -1826,6 +1837,11 @@ struct tunertype tuners[] = { | |||
1826 | .params = tuner_sony_btf_pxn01z_params, | 1837 | .params = tuner_sony_btf_pxn01z_params, |
1827 | .count = ARRAY_SIZE(tuner_sony_btf_pxn01z_params), | 1838 | .count = ARRAY_SIZE(tuner_sony_btf_pxn01z_params), |
1828 | }, | 1839 | }, |
1840 | [TUNER_PHILIPS_FQ1236_MK5] = { /* NTSC, TDA9885, no FM radio */ | ||
1841 | .name = "Philips FQ1236 MK5", | ||
1842 | .params = tuner_philips_fq1236_mk5_params, | ||
1843 | .count = ARRAY_SIZE(tuner_philips_fq1236_mk5_params), | ||
1844 | }, | ||
1829 | }; | 1845 | }; |
1830 | EXPORT_SYMBOL(tuners); | 1846 | EXPORT_SYMBOL(tuners); |
1831 | 1847 | ||
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index bdbc9d305419..27e2acce3c3a 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -969,6 +969,19 @@ config VIDEO_OMAP2 | |||
969 | ---help--- | 969 | ---help--- |
970 | This is a v4l2 driver for the TI OMAP2 camera capture interface | 970 | This is a v4l2 driver for the TI OMAP2 camera capture interface |
971 | 971 | ||
972 | config VIDEO_MX2_HOSTSUPPORT | ||
973 | bool | ||
974 | |||
975 | config VIDEO_MX2 | ||
976 | tristate "i.MX27/i.MX25 Camera Sensor Interface driver" | ||
977 | depends on VIDEO_DEV && SOC_CAMERA && (MACH_MX27 || ARCH_MX25) | ||
978 | select VIDEOBUF_DMA_CONTIG | ||
979 | select VIDEO_MX2_HOSTSUPPORT | ||
980 | ---help--- | ||
981 | This is a v4l2 driver for the i.MX27 and the i.MX25 Camera Sensor | ||
982 | Interface | ||
983 | |||
984 | |||
972 | # | 985 | # |
973 | # USB Multimedia device configuration | 986 | # USB Multimedia device configuration |
974 | # | 987 | # |
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index cc93859d3164..b08bd2b65cd0 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile | |||
@@ -162,6 +162,7 @@ obj-$(CONFIG_SOC_CAMERA) += soc_camera.o soc_mediabus.o | |||
162 | obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o | 162 | obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o |
163 | # soc-camera host drivers have to be linked after camera drivers | 163 | # soc-camera host drivers have to be linked after camera drivers |
164 | obj-$(CONFIG_VIDEO_MX1) += mx1_camera.o | 164 | obj-$(CONFIG_VIDEO_MX1) += mx1_camera.o |
165 | obj-$(CONFIG_VIDEO_MX2) += mx2_camera.o | ||
165 | obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o | 166 | obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o |
166 | obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o | 167 | obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o |
167 | obj-$(CONFIG_VIDEO_SH_MOBILE_CEU) += sh_mobile_ceu_camera.o | 168 | obj-$(CONFIG_VIDEO_SH_MOBILE_CEU) += sh_mobile_ceu_camera.o |
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 9ecacab4b89b..a937e2ff9b6e 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -912,6 +912,9 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts) | |||
912 | clear_bit(IVTV_F_S_STREAMING, &s->s_flags); | 912 | clear_bit(IVTV_F_S_STREAMING, &s->s_flags); |
913 | ivtv_flush_queues(s); | 913 | ivtv_flush_queues(s); |
914 | 914 | ||
915 | /* decoder needs time to settle */ | ||
916 | ivtv_msleep_timeout(40, 0); | ||
917 | |||
915 | /* decrement decoding */ | 918 | /* decrement decoding */ |
916 | atomic_dec(&itv->decoding); | 919 | atomic_dec(&itv->decoding); |
917 | 920 | ||
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index 554eaf140128..10ddeccc70eb 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c | |||
@@ -988,6 +988,9 @@ static int m2mtest_probe(struct platform_device *pdev) | |||
988 | goto err_m2m; | 988 | goto err_m2m; |
989 | } | 989 | } |
990 | 990 | ||
991 | q_data[V4L2_M2M_SRC].fmt = &formats[0]; | ||
992 | q_data[V4L2_M2M_DST].fmt = &formats[0]; | ||
993 | |||
991 | return 0; | 994 | return 0; |
992 | 995 | ||
993 | err_m2m: | 996 | err_m2m: |
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c new file mode 100644 index 000000000000..026bef0ba403 --- /dev/null +++ b/drivers/media/video/mx2_camera.c | |||
@@ -0,0 +1,1513 @@ | |||
1 | /* | ||
2 | * V4L2 Driver for i.MX27/i.MX25 camera host | ||
3 | * | ||
4 | * Copyright (C) 2008, Sascha Hauer, Pengutronix | ||
5 | * Copyright (C) 2010, Baruch Siach, Orex Computed Radiography | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/slab.h> | ||
18 | #include <linux/dma-mapping.h> | ||
19 | #include <linux/errno.h> | ||
20 | #include <linux/fs.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/mm.h> | ||
24 | #include <linux/moduleparam.h> | ||
25 | #include <linux/time.h> | ||
26 | #include <linux/version.h> | ||
27 | #include <linux/device.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/mutex.h> | ||
30 | #include <linux/clk.h> | ||
31 | |||
32 | #include <media/v4l2-common.h> | ||
33 | #include <media/v4l2-dev.h> | ||
34 | #include <media/videobuf-dma-contig.h> | ||
35 | #include <media/soc_camera.h> | ||
36 | #include <media/soc_mediabus.h> | ||
37 | |||
38 | #include <linux/videodev2.h> | ||
39 | |||
40 | #include <mach/mx2_cam.h> | ||
41 | #ifdef CONFIG_MACH_MX27 | ||
42 | #include <mach/dma-mx1-mx2.h> | ||
43 | #endif | ||
44 | #include <mach/hardware.h> | ||
45 | |||
46 | #include <asm/dma.h> | ||
47 | |||
48 | #define MX2_CAM_DRV_NAME "mx2-camera" | ||
49 | #define MX2_CAM_VERSION_CODE KERNEL_VERSION(0, 0, 5) | ||
50 | #define MX2_CAM_DRIVER_DESCRIPTION "i.MX2x_Camera" | ||
51 | |||
52 | /* reset values */ | ||
53 | #define CSICR1_RESET_VAL 0x40000800 | ||
54 | #define CSICR2_RESET_VAL 0x0 | ||
55 | #define CSICR3_RESET_VAL 0x0 | ||
56 | |||
57 | /* csi control reg 1 */ | ||
58 | #define CSICR1_SWAP16_EN (1 << 31) | ||
59 | #define CSICR1_EXT_VSYNC (1 << 30) | ||
60 | #define CSICR1_EOF_INTEN (1 << 29) | ||
61 | #define CSICR1_PRP_IF_EN (1 << 28) | ||
62 | #define CSICR1_CCIR_MODE (1 << 27) | ||
63 | #define CSICR1_COF_INTEN (1 << 26) | ||
64 | #define CSICR1_SF_OR_INTEN (1 << 25) | ||
65 | #define CSICR1_RF_OR_INTEN (1 << 24) | ||
66 | #define CSICR1_STATFF_LEVEL (3 << 22) | ||
67 | #define CSICR1_STATFF_INTEN (1 << 21) | ||
68 | #define CSICR1_RXFF_LEVEL(l) (((l) & 3) << 19) /* MX27 */ | ||
69 | #define CSICR1_FB2_DMA_INTEN (1 << 20) /* MX25 */ | ||
70 | #define CSICR1_FB1_DMA_INTEN (1 << 19) /* MX25 */ | ||
71 | #define CSICR1_RXFF_INTEN (1 << 18) | ||
72 | #define CSICR1_SOF_POL (1 << 17) | ||
73 | #define CSICR1_SOF_INTEN (1 << 16) | ||
74 | #define CSICR1_MCLKDIV(d) (((d) & 0xF) << 12) | ||
75 | #define CSICR1_HSYNC_POL (1 << 11) | ||
76 | #define CSICR1_CCIR_EN (1 << 10) | ||
77 | #define CSICR1_MCLKEN (1 << 9) | ||
78 | #define CSICR1_FCC (1 << 8) | ||
79 | #define CSICR1_PACK_DIR (1 << 7) | ||
80 | #define CSICR1_CLR_STATFIFO (1 << 6) | ||
81 | #define CSICR1_CLR_RXFIFO (1 << 5) | ||
82 | #define CSICR1_GCLK_MODE (1 << 4) | ||
83 | #define CSICR1_INV_DATA (1 << 3) | ||
84 | #define CSICR1_INV_PCLK (1 << 2) | ||
85 | #define CSICR1_REDGE (1 << 1) | ||
86 | |||
87 | #define SHIFT_STATFF_LEVEL 22 | ||
88 | #define SHIFT_RXFF_LEVEL 19 | ||
89 | #define SHIFT_MCLKDIV 12 | ||
90 | |||
91 | /* control reg 3 */ | ||
92 | #define CSICR3_FRMCNT (0xFFFF << 16) | ||
93 | #define CSICR3_FRMCNT_RST (1 << 15) | ||
94 | #define CSICR3_DMA_REFLASH_RFF (1 << 14) | ||
95 | #define CSICR3_DMA_REFLASH_SFF (1 << 13) | ||
96 | #define CSICR3_DMA_REQ_EN_RFF (1 << 12) | ||
97 | #define CSICR3_DMA_REQ_EN_SFF (1 << 11) | ||
98 | #define CSICR3_RXFF_LEVEL(l) (((l) & 7) << 4) /* MX25 */ | ||
99 | #define CSICR3_CSI_SUP (1 << 3) | ||
100 | #define CSICR3_ZERO_PACK_EN (1 << 2) | ||
101 | #define CSICR3_ECC_INT_EN (1 << 1) | ||
102 | #define CSICR3_ECC_AUTO_EN (1 << 0) | ||
103 | |||
104 | #define SHIFT_FRMCNT 16 | ||
105 | |||
106 | /* csi status reg */ | ||
107 | #define CSISR_SFF_OR_INT (1 << 25) | ||
108 | #define CSISR_RFF_OR_INT (1 << 24) | ||
109 | #define CSISR_STATFF_INT (1 << 21) | ||
110 | #define CSISR_DMA_TSF_FB2_INT (1 << 20) /* MX25 */ | ||
111 | #define CSISR_DMA_TSF_FB1_INT (1 << 19) /* MX25 */ | ||
112 | #define CSISR_RXFF_INT (1 << 18) | ||
113 | #define CSISR_EOF_INT (1 << 17) | ||
114 | #define CSISR_SOF_INT (1 << 16) | ||
115 | #define CSISR_F2_INT (1 << 15) | ||
116 | #define CSISR_F1_INT (1 << 14) | ||
117 | #define CSISR_COF_INT (1 << 13) | ||
118 | #define CSISR_ECC_INT (1 << 1) | ||
119 | #define CSISR_DRDY (1 << 0) | ||
120 | |||
121 | #define CSICR1 0x00 | ||
122 | #define CSICR2 0x04 | ||
123 | #define CSISR (cpu_is_mx27() ? 0x08 : 0x18) | ||
124 | #define CSISTATFIFO 0x0c | ||
125 | #define CSIRFIFO 0x10 | ||
126 | #define CSIRXCNT 0x14 | ||
127 | #define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08) | ||
128 | #define CSIDMASA_STATFIFO 0x20 | ||
129 | #define CSIDMATA_STATFIFO 0x24 | ||
130 | #define CSIDMASA_FB1 0x28 | ||
131 | #define CSIDMASA_FB2 0x2c | ||
132 | #define CSIFBUF_PARA 0x30 | ||
133 | #define CSIIMAG_PARA 0x34 | ||
134 | |||
135 | /* EMMA PrP */ | ||
136 | #define PRP_CNTL 0x00 | ||
137 | #define PRP_INTR_CNTL 0x04 | ||
138 | #define PRP_INTRSTATUS 0x08 | ||
139 | #define PRP_SOURCE_Y_PTR 0x0c | ||
140 | #define PRP_SOURCE_CB_PTR 0x10 | ||
141 | #define PRP_SOURCE_CR_PTR 0x14 | ||
142 | #define PRP_DEST_RGB1_PTR 0x18 | ||
143 | #define PRP_DEST_RGB2_PTR 0x1c | ||
144 | #define PRP_DEST_Y_PTR 0x20 | ||
145 | #define PRP_DEST_CB_PTR 0x24 | ||
146 | #define PRP_DEST_CR_PTR 0x28 | ||
147 | #define PRP_SRC_FRAME_SIZE 0x2c | ||
148 | #define PRP_DEST_CH1_LINE_STRIDE 0x30 | ||
149 | #define PRP_SRC_PIXEL_FORMAT_CNTL 0x34 | ||
150 | #define PRP_CH1_PIXEL_FORMAT_CNTL 0x38 | ||
151 | #define PRP_CH1_OUT_IMAGE_SIZE 0x3c | ||
152 | #define PRP_CH2_OUT_IMAGE_SIZE 0x40 | ||
153 | #define PRP_SRC_LINE_STRIDE 0x44 | ||
154 | #define PRP_CSC_COEF_012 0x48 | ||
155 | #define PRP_CSC_COEF_345 0x4c | ||
156 | #define PRP_CSC_COEF_678 0x50 | ||
157 | #define PRP_CH1_RZ_HORI_COEF1 0x54 | ||
158 | #define PRP_CH1_RZ_HORI_COEF2 0x58 | ||
159 | #define PRP_CH1_RZ_HORI_VALID 0x5c | ||
160 | #define PRP_CH1_RZ_VERT_COEF1 0x60 | ||
161 | #define PRP_CH1_RZ_VERT_COEF2 0x64 | ||
162 | #define PRP_CH1_RZ_VERT_VALID 0x68 | ||
163 | #define PRP_CH2_RZ_HORI_COEF1 0x6c | ||
164 | #define PRP_CH2_RZ_HORI_COEF2 0x70 | ||
165 | #define PRP_CH2_RZ_HORI_VALID 0x74 | ||
166 | #define PRP_CH2_RZ_VERT_COEF1 0x78 | ||
167 | #define PRP_CH2_RZ_VERT_COEF2 0x7c | ||
168 | #define PRP_CH2_RZ_VERT_VALID 0x80 | ||
169 | |||
170 | #define PRP_CNTL_CH1EN (1 << 0) | ||
171 | #define PRP_CNTL_CH2EN (1 << 1) | ||
172 | #define PRP_CNTL_CSIEN (1 << 2) | ||
173 | #define PRP_CNTL_DATA_IN_YUV420 (0 << 3) | ||
174 | #define PRP_CNTL_DATA_IN_YUV422 (1 << 3) | ||
175 | #define PRP_CNTL_DATA_IN_RGB16 (2 << 3) | ||
176 | #define PRP_CNTL_DATA_IN_RGB32 (3 << 3) | ||
177 | #define PRP_CNTL_CH1_OUT_RGB8 (0 << 5) | ||
178 | #define PRP_CNTL_CH1_OUT_RGB16 (1 << 5) | ||
179 | #define PRP_CNTL_CH1_OUT_RGB32 (2 << 5) | ||
180 | #define PRP_CNTL_CH1_OUT_YUV422 (3 << 5) | ||
181 | #define PRP_CNTL_CH2_OUT_YUV420 (0 << 7) | ||
182 | #define PRP_CNTL_CH2_OUT_YUV422 (1 << 7) | ||
183 | #define PRP_CNTL_CH2_OUT_YUV444 (2 << 7) | ||
184 | #define PRP_CNTL_CH1_LEN (1 << 9) | ||
185 | #define PRP_CNTL_CH2_LEN (1 << 10) | ||
186 | #define PRP_CNTL_SKIP_FRAME (1 << 11) | ||
187 | #define PRP_CNTL_SWRST (1 << 12) | ||
188 | #define PRP_CNTL_CLKEN (1 << 13) | ||
189 | #define PRP_CNTL_WEN (1 << 14) | ||
190 | #define PRP_CNTL_CH1BYP (1 << 15) | ||
191 | #define PRP_CNTL_IN_TSKIP(x) ((x) << 16) | ||
192 | #define PRP_CNTL_CH1_TSKIP(x) ((x) << 19) | ||
193 | #define PRP_CNTL_CH2_TSKIP(x) ((x) << 22) | ||
194 | #define PRP_CNTL_INPUT_FIFO_LEVEL(x) ((x) << 25) | ||
195 | #define PRP_CNTL_RZ_FIFO_LEVEL(x) ((x) << 27) | ||
196 | #define PRP_CNTL_CH2B1EN (1 << 29) | ||
197 | #define PRP_CNTL_CH2B2EN (1 << 30) | ||
198 | #define PRP_CNTL_CH2FEN (1 << 31) | ||
199 | |||
200 | /* IRQ Enable and status register */ | ||
201 | #define PRP_INTR_RDERR (1 << 0) | ||
202 | #define PRP_INTR_CH1WERR (1 << 1) | ||
203 | #define PRP_INTR_CH2WERR (1 << 2) | ||
204 | #define PRP_INTR_CH1FC (1 << 3) | ||
205 | #define PRP_INTR_CH2FC (1 << 5) | ||
206 | #define PRP_INTR_LBOVF (1 << 7) | ||
207 | #define PRP_INTR_CH2OVF (1 << 8) | ||
208 | |||
209 | #define mx27_camera_emma(pcdev) (cpu_is_mx27() && pcdev->use_emma) | ||
210 | |||
211 | #define MAX_VIDEO_MEM 16 | ||
212 | |||
213 | struct mx2_camera_dev { | ||
214 | struct device *dev; | ||
215 | struct soc_camera_host soc_host; | ||
216 | struct soc_camera_device *icd; | ||
217 | struct clk *clk_csi, *clk_emma; | ||
218 | |||
219 | unsigned int irq_csi, irq_emma; | ||
220 | void __iomem *base_csi, *base_emma; | ||
221 | unsigned long base_dma; | ||
222 | |||
223 | struct mx2_camera_platform_data *pdata; | ||
224 | struct resource *res_csi, *res_emma; | ||
225 | unsigned long platform_flags; | ||
226 | |||
227 | struct list_head capture; | ||
228 | struct list_head active_bufs; | ||
229 | |||
230 | spinlock_t lock; | ||
231 | |||
232 | int dma; | ||
233 | struct mx2_buffer *active; | ||
234 | struct mx2_buffer *fb1_active; | ||
235 | struct mx2_buffer *fb2_active; | ||
236 | |||
237 | int use_emma; | ||
238 | |||
239 | u32 csicr1; | ||
240 | |||
241 | void *discard_buffer; | ||
242 | dma_addr_t discard_buffer_dma; | ||
243 | size_t discard_size; | ||
244 | }; | ||
245 | |||
246 | /* buffer for one video frame */ | ||
247 | struct mx2_buffer { | ||
248 | /* common v4l buffer stuff -- must be first */ | ||
249 | struct videobuf_buffer vb; | ||
250 | |||
251 | enum v4l2_mbus_pixelcode code; | ||
252 | |||
253 | int bufnum; | ||
254 | }; | ||
255 | |||
256 | static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev) | ||
257 | { | ||
258 | unsigned long flags; | ||
259 | |||
260 | clk_disable(pcdev->clk_csi); | ||
261 | writel(0, pcdev->base_csi + CSICR1); | ||
262 | if (mx27_camera_emma(pcdev)) { | ||
263 | writel(0, pcdev->base_emma + PRP_CNTL); | ||
264 | } else if (cpu_is_mx25()) { | ||
265 | spin_lock_irqsave(&pcdev->lock, flags); | ||
266 | pcdev->fb1_active = NULL; | ||
267 | pcdev->fb2_active = NULL; | ||
268 | writel(0, pcdev->base_csi + CSIDMASA_FB1); | ||
269 | writel(0, pcdev->base_csi + CSIDMASA_FB2); | ||
270 | spin_unlock_irqrestore(&pcdev->lock, flags); | ||
271 | } | ||
272 | } | ||
273 | |||
274 | /* | ||
275 | * The following two functions absolutely depend on the fact, that | ||
276 | * there can be only one camera on mx2 camera sensor interface | ||
277 | */ | ||
278 | static int mx2_camera_add_device(struct soc_camera_device *icd) | ||
279 | { | ||
280 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
281 | struct mx2_camera_dev *pcdev = ici->priv; | ||
282 | int ret; | ||
283 | u32 csicr1; | ||
284 | |||
285 | if (pcdev->icd) | ||
286 | return -EBUSY; | ||
287 | |||
288 | ret = clk_enable(pcdev->clk_csi); | ||
289 | if (ret < 0) | ||
290 | return ret; | ||
291 | |||
292 | csicr1 = CSICR1_MCLKEN; | ||
293 | |||
294 | if (mx27_camera_emma(pcdev)) { | ||
295 | csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC | | ||
296 | CSICR1_RXFF_LEVEL(0); | ||
297 | } else if (cpu_is_mx27()) | ||
298 | csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2); | ||
299 | |||
300 | pcdev->csicr1 = csicr1; | ||
301 | writel(pcdev->csicr1, pcdev->base_csi + CSICR1); | ||
302 | |||
303 | pcdev->icd = icd; | ||
304 | |||
305 | dev_info(icd->dev.parent, "Camera driver attached to camera %d\n", | ||
306 | icd->devnum); | ||
307 | |||
308 | return 0; | ||
309 | } | ||
310 | |||
311 | static void mx2_camera_remove_device(struct soc_camera_device *icd) | ||
312 | { | ||
313 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
314 | struct mx2_camera_dev *pcdev = ici->priv; | ||
315 | |||
316 | BUG_ON(icd != pcdev->icd); | ||
317 | |||
318 | dev_info(icd->dev.parent, "Camera driver detached from camera %d\n", | ||
319 | icd->devnum); | ||
320 | |||
321 | mx2_camera_deactivate(pcdev); | ||
322 | |||
323 | if (pcdev->discard_buffer) { | ||
324 | dma_free_coherent(ici->v4l2_dev.dev, pcdev->discard_size, | ||
325 | pcdev->discard_buffer, | ||
326 | pcdev->discard_buffer_dma); | ||
327 | pcdev->discard_buffer = NULL; | ||
328 | } | ||
329 | |||
330 | pcdev->icd = NULL; | ||
331 | } | ||
332 | |||
333 | #ifdef CONFIG_MACH_MX27 | ||
334 | static void mx27_camera_dma_enable(struct mx2_camera_dev *pcdev) | ||
335 | { | ||
336 | u32 tmp; | ||
337 | |||
338 | imx_dma_enable(pcdev->dma); | ||
339 | |||
340 | tmp = readl(pcdev->base_csi + CSICR1); | ||
341 | tmp |= CSICR1_RF_OR_INTEN; | ||
342 | writel(tmp, pcdev->base_csi + CSICR1); | ||
343 | } | ||
344 | |||
345 | static irqreturn_t mx27_camera_irq(int irq_csi, void *data) | ||
346 | { | ||
347 | struct mx2_camera_dev *pcdev = data; | ||
348 | u32 status = readl(pcdev->base_csi + CSISR); | ||
349 | |||
350 | if (status & CSISR_SOF_INT && pcdev->active) { | ||
351 | u32 tmp; | ||
352 | |||
353 | tmp = readl(pcdev->base_csi + CSICR1); | ||
354 | writel(tmp | CSICR1_CLR_RXFIFO, pcdev->base_csi + CSICR1); | ||
355 | mx27_camera_dma_enable(pcdev); | ||
356 | } | ||
357 | |||
358 | writel(CSISR_SOF_INT | CSISR_RFF_OR_INT, pcdev->base_csi + CSISR); | ||
359 | |||
360 | return IRQ_HANDLED; | ||
361 | } | ||
362 | #else | ||
363 | static irqreturn_t mx27_camera_irq(int irq_csi, void *data) | ||
364 | { | ||
365 | return IRQ_NONE; | ||
366 | } | ||
367 | #endif /* CONFIG_MACH_MX27 */ | ||
368 | |||
369 | static void mx25_camera_frame_done(struct mx2_camera_dev *pcdev, int fb, | ||
370 | int state) | ||
371 | { | ||
372 | struct videobuf_buffer *vb; | ||
373 | struct mx2_buffer *buf; | ||
374 | struct mx2_buffer **fb_active = fb == 1 ? &pcdev->fb1_active : | ||
375 | &pcdev->fb2_active; | ||
376 | u32 fb_reg = fb == 1 ? CSIDMASA_FB1 : CSIDMASA_FB2; | ||
377 | unsigned long flags; | ||
378 | |||
379 | spin_lock_irqsave(&pcdev->lock, flags); | ||
380 | |||
381 | vb = &(*fb_active)->vb; | ||
382 | dev_dbg(pcdev->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | ||
383 | vb, vb->baddr, vb->bsize); | ||
384 | |||
385 | vb->state = state; | ||
386 | do_gettimeofday(&vb->ts); | ||
387 | vb->field_count++; | ||
388 | |||
389 | wake_up(&vb->done); | ||
390 | |||
391 | if (list_empty(&pcdev->capture)) { | ||
392 | buf = NULL; | ||
393 | writel(0, pcdev->base_csi + fb_reg); | ||
394 | } else { | ||
395 | buf = list_entry(pcdev->capture.next, struct mx2_buffer, | ||
396 | vb.queue); | ||
397 | vb = &buf->vb; | ||
398 | list_del(&vb->queue); | ||
399 | vb->state = VIDEOBUF_ACTIVE; | ||
400 | writel(videobuf_to_dma_contig(vb), pcdev->base_csi + fb_reg); | ||
401 | } | ||
402 | |||
403 | *fb_active = buf; | ||
404 | |||
405 | spin_unlock_irqrestore(&pcdev->lock, flags); | ||
406 | } | ||
407 | |||
408 | static irqreturn_t mx25_camera_irq(int irq_csi, void *data) | ||
409 | { | ||
410 | struct mx2_camera_dev *pcdev = data; | ||
411 | u32 status = readl(pcdev->base_csi + CSISR); | ||
412 | |||
413 | if (status & CSISR_DMA_TSF_FB1_INT) | ||
414 | mx25_camera_frame_done(pcdev, 1, VIDEOBUF_DONE); | ||
415 | else if (status & CSISR_DMA_TSF_FB2_INT) | ||
416 | mx25_camera_frame_done(pcdev, 2, VIDEOBUF_DONE); | ||
417 | |||
418 | /* FIXME: handle CSISR_RFF_OR_INT */ | ||
419 | |||
420 | writel(status, pcdev->base_csi + CSISR); | ||
421 | |||
422 | return IRQ_HANDLED; | ||
423 | } | ||
424 | |||
425 | /* | ||
426 | * Videobuf operations | ||
427 | */ | ||
428 | static int mx2_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, | ||
429 | unsigned int *size) | ||
430 | { | ||
431 | struct soc_camera_device *icd = vq->priv_data; | ||
432 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, | ||
433 | icd->current_fmt->host_fmt); | ||
434 | |||
435 | dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size); | ||
436 | |||
437 | if (bytes_per_line < 0) | ||
438 | return bytes_per_line; | ||
439 | |||
440 | *size = bytes_per_line * icd->user_height; | ||
441 | |||
442 | if (0 == *count) | ||
443 | *count = 32; | ||
444 | if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024) | ||
445 | *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size; | ||
446 | |||
447 | return 0; | ||
448 | } | ||
449 | |||
450 | static void free_buffer(struct videobuf_queue *vq, struct mx2_buffer *buf) | ||
451 | { | ||
452 | struct soc_camera_device *icd = vq->priv_data; | ||
453 | struct videobuf_buffer *vb = &buf->vb; | ||
454 | |||
455 | dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | ||
456 | vb, vb->baddr, vb->bsize); | ||
457 | |||
458 | /* | ||
459 | * This waits until this buffer is out of danger, i.e., until it is no | ||
460 | * longer in STATE_QUEUED or STATE_ACTIVE | ||
461 | */ | ||
462 | videobuf_waiton(vb, 0, 0); | ||
463 | |||
464 | videobuf_dma_contig_free(vq, vb); | ||
465 | dev_dbg(&icd->dev, "%s freed\n", __func__); | ||
466 | |||
467 | vb->state = VIDEOBUF_NEEDS_INIT; | ||
468 | } | ||
469 | |||
470 | static int mx2_videobuf_prepare(struct videobuf_queue *vq, | ||
471 | struct videobuf_buffer *vb, enum v4l2_field field) | ||
472 | { | ||
473 | struct soc_camera_device *icd = vq->priv_data; | ||
474 | struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb); | ||
475 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, | ||
476 | icd->current_fmt->host_fmt); | ||
477 | int ret = 0; | ||
478 | |||
479 | dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | ||
480 | vb, vb->baddr, vb->bsize); | ||
481 | |||
482 | if (bytes_per_line < 0) | ||
483 | return bytes_per_line; | ||
484 | |||
485 | #ifdef DEBUG | ||
486 | /* | ||
487 | * This can be useful if you want to see if we actually fill | ||
488 | * the buffer with something | ||
489 | */ | ||
490 | memset((void *)vb->baddr, 0xaa, vb->bsize); | ||
491 | #endif | ||
492 | |||
493 | if (buf->code != icd->current_fmt->code || | ||
494 | vb->width != icd->user_width || | ||
495 | vb->height != icd->user_height || | ||
496 | vb->field != field) { | ||
497 | buf->code = icd->current_fmt->code; | ||
498 | vb->width = icd->user_width; | ||
499 | vb->height = icd->user_height; | ||
500 | vb->field = field; | ||
501 | vb->state = VIDEOBUF_NEEDS_INIT; | ||
502 | } | ||
503 | |||
504 | vb->size = bytes_per_line * vb->height; | ||
505 | if (vb->baddr && vb->bsize < vb->size) { | ||
506 | ret = -EINVAL; | ||
507 | goto out; | ||
508 | } | ||
509 | |||
510 | if (vb->state == VIDEOBUF_NEEDS_INIT) { | ||
511 | ret = videobuf_iolock(vq, vb, NULL); | ||
512 | if (ret) | ||
513 | goto fail; | ||
514 | |||
515 | vb->state = VIDEOBUF_PREPARED; | ||
516 | } | ||
517 | |||
518 | return 0; | ||
519 | |||
520 | fail: | ||
521 | free_buffer(vq, buf); | ||
522 | out: | ||
523 | return ret; | ||
524 | } | ||
525 | |||
526 | static void mx2_videobuf_queue(struct videobuf_queue *vq, | ||
527 | struct videobuf_buffer *vb) | ||
528 | { | ||
529 | struct soc_camera_device *icd = vq->priv_data; | ||
530 | struct soc_camera_host *ici = | ||
531 | to_soc_camera_host(icd->dev.parent); | ||
532 | struct mx2_camera_dev *pcdev = ici->priv; | ||
533 | struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb); | ||
534 | unsigned long flags; | ||
535 | |||
536 | dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | ||
537 | vb, vb->baddr, vb->bsize); | ||
538 | |||
539 | spin_lock_irqsave(&pcdev->lock, flags); | ||
540 | |||
541 | vb->state = VIDEOBUF_QUEUED; | ||
542 | list_add_tail(&vb->queue, &pcdev->capture); | ||
543 | |||
544 | if (mx27_camera_emma(pcdev)) { | ||
545 | goto out; | ||
546 | #ifdef CONFIG_MACH_MX27 | ||
547 | } else if (cpu_is_mx27()) { | ||
548 | int ret; | ||
549 | |||
550 | if (pcdev->active == NULL) { | ||
551 | ret = imx_dma_setup_single(pcdev->dma, | ||
552 | videobuf_to_dma_contig(vb), vb->size, | ||
553 | (u32)pcdev->base_dma + 0x10, | ||
554 | DMA_MODE_READ); | ||
555 | if (ret) { | ||
556 | vb->state = VIDEOBUF_ERROR; | ||
557 | wake_up(&vb->done); | ||
558 | goto out; | ||
559 | } | ||
560 | |||
561 | vb->state = VIDEOBUF_ACTIVE; | ||
562 | pcdev->active = buf; | ||
563 | } | ||
564 | #endif | ||
565 | } else { /* cpu_is_mx25() */ | ||
566 | u32 csicr3, dma_inten = 0; | ||
567 | |||
568 | if (pcdev->fb1_active == NULL) { | ||
569 | writel(videobuf_to_dma_contig(vb), | ||
570 | pcdev->base_csi + CSIDMASA_FB1); | ||
571 | pcdev->fb1_active = buf; | ||
572 | dma_inten = CSICR1_FB1_DMA_INTEN; | ||
573 | } else if (pcdev->fb2_active == NULL) { | ||
574 | writel(videobuf_to_dma_contig(vb), | ||
575 | pcdev->base_csi + CSIDMASA_FB2); | ||
576 | pcdev->fb2_active = buf; | ||
577 | dma_inten = CSICR1_FB2_DMA_INTEN; | ||
578 | } | ||
579 | |||
580 | if (dma_inten) { | ||
581 | list_del(&vb->queue); | ||
582 | vb->state = VIDEOBUF_ACTIVE; | ||
583 | |||
584 | csicr3 = readl(pcdev->base_csi + CSICR3); | ||
585 | |||
586 | /* Reflash DMA */ | ||
587 | writel(csicr3 | CSICR3_DMA_REFLASH_RFF, | ||
588 | pcdev->base_csi + CSICR3); | ||
589 | |||
590 | /* clear & enable interrupts */ | ||
591 | writel(dma_inten, pcdev->base_csi + CSISR); | ||
592 | pcdev->csicr1 |= dma_inten; | ||
593 | writel(pcdev->csicr1, pcdev->base_csi + CSICR1); | ||
594 | |||
595 | /* enable DMA */ | ||
596 | csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1); | ||
597 | writel(csicr3, pcdev->base_csi + CSICR3); | ||
598 | } | ||
599 | } | ||
600 | |||
601 | out: | ||
602 | spin_unlock_irqrestore(&pcdev->lock, flags); | ||
603 | } | ||
604 | |||
605 | static void mx2_videobuf_release(struct videobuf_queue *vq, | ||
606 | struct videobuf_buffer *vb) | ||
607 | { | ||
608 | struct soc_camera_device *icd = vq->priv_data; | ||
609 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
610 | struct mx2_camera_dev *pcdev = ici->priv; | ||
611 | struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb); | ||
612 | unsigned long flags; | ||
613 | |||
614 | #ifdef DEBUG | ||
615 | dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | ||
616 | vb, vb->baddr, vb->bsize); | ||
617 | |||
618 | switch (vb->state) { | ||
619 | case VIDEOBUF_ACTIVE: | ||
620 | dev_info(&icd->dev, "%s (active)\n", __func__); | ||
621 | break; | ||
622 | case VIDEOBUF_QUEUED: | ||
623 | dev_info(&icd->dev, "%s (queued)\n", __func__); | ||
624 | break; | ||
625 | case VIDEOBUF_PREPARED: | ||
626 | dev_info(&icd->dev, "%s (prepared)\n", __func__); | ||
627 | break; | ||
628 | default: | ||
629 | dev_info(&icd->dev, "%s (unknown) %d\n", __func__, | ||
630 | vb->state); | ||
631 | break; | ||
632 | } | ||
633 | #endif | ||
634 | |||
635 | /* | ||
636 | * Terminate only queued but inactive buffers. Active buffers are | ||
637 | * released when they become inactive after videobuf_waiton(). | ||
638 | * | ||
639 | * FIXME: implement forced termination of active buffers, so that the | ||
640 | * user won't get stuck in an uninterruptible state. This requires a | ||
641 | * specific handling for each of the three DMA types that this driver | ||
642 | * supports. | ||
643 | */ | ||
644 | spin_lock_irqsave(&pcdev->lock, flags); | ||
645 | if (vb->state == VIDEOBUF_QUEUED) { | ||
646 | list_del(&vb->queue); | ||
647 | vb->state = VIDEOBUF_ERROR; | ||
648 | } | ||
649 | spin_unlock_irqrestore(&pcdev->lock, flags); | ||
650 | |||
651 | free_buffer(vq, buf); | ||
652 | } | ||
653 | |||
654 | static struct videobuf_queue_ops mx2_videobuf_ops = { | ||
655 | .buf_setup = mx2_videobuf_setup, | ||
656 | .buf_prepare = mx2_videobuf_prepare, | ||
657 | .buf_queue = mx2_videobuf_queue, | ||
658 | .buf_release = mx2_videobuf_release, | ||
659 | }; | ||
660 | |||
661 | static void mx2_camera_init_videobuf(struct videobuf_queue *q, | ||
662 | struct soc_camera_device *icd) | ||
663 | { | ||
664 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
665 | struct mx2_camera_dev *pcdev = ici->priv; | ||
666 | |||
667 | videobuf_queue_dma_contig_init(q, &mx2_videobuf_ops, pcdev->dev, | ||
668 | &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, | ||
669 | V4L2_FIELD_NONE, sizeof(struct mx2_buffer), icd); | ||
670 | } | ||
671 | |||
672 | #define MX2_BUS_FLAGS (SOCAM_DATAWIDTH_8 | \ | ||
673 | SOCAM_MASTER | \ | ||
674 | SOCAM_VSYNC_ACTIVE_HIGH | \ | ||
675 | SOCAM_VSYNC_ACTIVE_LOW | \ | ||
676 | SOCAM_HSYNC_ACTIVE_HIGH | \ | ||
677 | SOCAM_HSYNC_ACTIVE_LOW | \ | ||
678 | SOCAM_PCLK_SAMPLE_RISING | \ | ||
679 | SOCAM_PCLK_SAMPLE_FALLING | \ | ||
680 | SOCAM_DATA_ACTIVE_HIGH | \ | ||
681 | SOCAM_DATA_ACTIVE_LOW) | ||
682 | |||
683 | static int mx27_camera_emma_prp_reset(struct mx2_camera_dev *pcdev) | ||
684 | { | ||
685 | u32 cntl; | ||
686 | int count = 0; | ||
687 | |||
688 | cntl = readl(pcdev->base_emma + PRP_CNTL); | ||
689 | writel(PRP_CNTL_SWRST, pcdev->base_emma + PRP_CNTL); | ||
690 | while (count++ < 100) { | ||
691 | if (!(readl(pcdev->base_emma + PRP_CNTL) & PRP_CNTL_SWRST)) | ||
692 | return 0; | ||
693 | barrier(); | ||
694 | udelay(1); | ||
695 | } | ||
696 | |||
697 | return -ETIMEDOUT; | ||
698 | } | ||
699 | |||
700 | static void mx27_camera_emma_buf_init(struct soc_camera_device *icd, | ||
701 | int bytesperline) | ||
702 | { | ||
703 | struct soc_camera_host *ici = | ||
704 | to_soc_camera_host(icd->dev.parent); | ||
705 | struct mx2_camera_dev *pcdev = ici->priv; | ||
706 | |||
707 | writel(pcdev->discard_buffer_dma, | ||
708 | pcdev->base_emma + PRP_DEST_RGB1_PTR); | ||
709 | writel(pcdev->discard_buffer_dma, | ||
710 | pcdev->base_emma + PRP_DEST_RGB2_PTR); | ||
711 | |||
712 | /* | ||
713 | * We only use the EMMA engine to get rid of the broken | ||
714 | * DMA Engine. No color space consversion at the moment. | ||
715 | * We adjust incoming and outgoing pixelformat to rgb16 | ||
716 | * and adjust the bytesperline accordingly. | ||
717 | */ | ||
718 | writel(PRP_CNTL_CH1EN | | ||
719 | PRP_CNTL_CSIEN | | ||
720 | PRP_CNTL_DATA_IN_RGB16 | | ||
721 | PRP_CNTL_CH1_OUT_RGB16 | | ||
722 | PRP_CNTL_CH1_LEN | | ||
723 | PRP_CNTL_CH1BYP | | ||
724 | PRP_CNTL_CH1_TSKIP(0) | | ||
725 | PRP_CNTL_IN_TSKIP(0), | ||
726 | pcdev->base_emma + PRP_CNTL); | ||
727 | |||
728 | writel(((bytesperline >> 1) << 16) | icd->user_height, | ||
729 | pcdev->base_emma + PRP_SRC_FRAME_SIZE); | ||
730 | writel(((bytesperline >> 1) << 16) | icd->user_height, | ||
731 | pcdev->base_emma + PRP_CH1_OUT_IMAGE_SIZE); | ||
732 | writel(bytesperline, | ||
733 | pcdev->base_emma + PRP_DEST_CH1_LINE_STRIDE); | ||
734 | writel(0x2ca00565, /* RGB565 */ | ||
735 | pcdev->base_emma + PRP_SRC_PIXEL_FORMAT_CNTL); | ||
736 | writel(0x2ca00565, /* RGB565 */ | ||
737 | pcdev->base_emma + PRP_CH1_PIXEL_FORMAT_CNTL); | ||
738 | |||
739 | /* Enable interrupts */ | ||
740 | writel(PRP_INTR_RDERR | | ||
741 | PRP_INTR_CH1WERR | | ||
742 | PRP_INTR_CH2WERR | | ||
743 | PRP_INTR_CH1FC | | ||
744 | PRP_INTR_CH2FC | | ||
745 | PRP_INTR_LBOVF | | ||
746 | PRP_INTR_CH2OVF, | ||
747 | pcdev->base_emma + PRP_INTR_CNTL); | ||
748 | } | ||
749 | |||
750 | static int mx2_camera_set_bus_param(struct soc_camera_device *icd, | ||
751 | __u32 pixfmt) | ||
752 | { | ||
753 | struct soc_camera_host *ici = | ||
754 | to_soc_camera_host(icd->dev.parent); | ||
755 | struct mx2_camera_dev *pcdev = ici->priv; | ||
756 | unsigned long camera_flags, common_flags; | ||
757 | int ret = 0; | ||
758 | int bytesperline; | ||
759 | u32 csicr1 = pcdev->csicr1; | ||
760 | |||
761 | camera_flags = icd->ops->query_bus_param(icd); | ||
762 | |||
763 | common_flags = soc_camera_bus_param_compatible(camera_flags, | ||
764 | MX2_BUS_FLAGS); | ||
765 | if (!common_flags) | ||
766 | return -EINVAL; | ||
767 | |||
768 | if ((common_flags & SOCAM_HSYNC_ACTIVE_HIGH) && | ||
769 | (common_flags & SOCAM_HSYNC_ACTIVE_LOW)) { | ||
770 | if (pcdev->platform_flags & MX2_CAMERA_HSYNC_HIGH) | ||
771 | common_flags &= ~SOCAM_HSYNC_ACTIVE_LOW; | ||
772 | else | ||
773 | common_flags &= ~SOCAM_HSYNC_ACTIVE_HIGH; | ||
774 | } | ||
775 | |||
776 | if ((common_flags & SOCAM_PCLK_SAMPLE_RISING) && | ||
777 | (common_flags & SOCAM_PCLK_SAMPLE_FALLING)) { | ||
778 | if (pcdev->platform_flags & MX2_CAMERA_PCLK_SAMPLE_RISING) | ||
779 | common_flags &= ~SOCAM_PCLK_SAMPLE_FALLING; | ||
780 | else | ||
781 | common_flags &= ~SOCAM_PCLK_SAMPLE_RISING; | ||
782 | } | ||
783 | |||
784 | ret = icd->ops->set_bus_param(icd, common_flags); | ||
785 | if (ret < 0) | ||
786 | return ret; | ||
787 | |||
788 | if (common_flags & SOCAM_PCLK_SAMPLE_FALLING) | ||
789 | csicr1 |= CSICR1_INV_PCLK; | ||
790 | if (common_flags & SOCAM_VSYNC_ACTIVE_HIGH) | ||
791 | csicr1 |= CSICR1_SOF_POL; | ||
792 | if (common_flags & SOCAM_HSYNC_ACTIVE_HIGH) | ||
793 | csicr1 |= CSICR1_HSYNC_POL; | ||
794 | if (pcdev->platform_flags & MX2_CAMERA_SWAP16) | ||
795 | csicr1 |= CSICR1_SWAP16_EN; | ||
796 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) | ||
797 | csicr1 |= CSICR1_EXT_VSYNC; | ||
798 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) | ||
799 | csicr1 |= CSICR1_CCIR_EN; | ||
800 | if (pcdev->platform_flags & MX2_CAMERA_CCIR_INTERLACE) | ||
801 | csicr1 |= CSICR1_CCIR_MODE; | ||
802 | if (pcdev->platform_flags & MX2_CAMERA_GATED_CLOCK) | ||
803 | csicr1 |= CSICR1_GCLK_MODE; | ||
804 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) | ||
805 | csicr1 |= CSICR1_INV_DATA; | ||
806 | if (pcdev->platform_flags & MX2_CAMERA_PACK_DIR_MSB) | ||
807 | csicr1 |= CSICR1_PACK_DIR; | ||
808 | |||
809 | pcdev->csicr1 = csicr1; | ||
810 | |||
811 | bytesperline = soc_mbus_bytes_per_line(icd->user_width, | ||
812 | icd->current_fmt->host_fmt); | ||
813 | if (bytesperline < 0) | ||
814 | return bytesperline; | ||
815 | |||
816 | if (mx27_camera_emma(pcdev)) { | ||
817 | ret = mx27_camera_emma_prp_reset(pcdev); | ||
818 | if (ret) | ||
819 | return ret; | ||
820 | |||
821 | if (pcdev->discard_buffer) | ||
822 | dma_free_coherent(ici->v4l2_dev.dev, | ||
823 | pcdev->discard_size, pcdev->discard_buffer, | ||
824 | pcdev->discard_buffer_dma); | ||
825 | |||
826 | /* | ||
827 | * I didn't manage to properly enable/disable the prp | ||
828 | * on a per frame basis during running transfers, | ||
829 | * thus we allocate a buffer here and use it to | ||
830 | * discard frames when no buffer is available. | ||
831 | * Feel free to work on this ;) | ||
832 | */ | ||
833 | pcdev->discard_size = icd->user_height * bytesperline; | ||
834 | pcdev->discard_buffer = dma_alloc_coherent(ici->v4l2_dev.dev, | ||
835 | pcdev->discard_size, &pcdev->discard_buffer_dma, | ||
836 | GFP_KERNEL); | ||
837 | if (!pcdev->discard_buffer) | ||
838 | return -ENOMEM; | ||
839 | |||
840 | mx27_camera_emma_buf_init(icd, bytesperline); | ||
841 | } else if (cpu_is_mx25()) { | ||
842 | writel((bytesperline * icd->user_height) >> 2, | ||
843 | pcdev->base_csi + CSIRXCNT); | ||
844 | writel((bytesperline << 16) | icd->user_height, | ||
845 | pcdev->base_csi + CSIIMAG_PARA); | ||
846 | } | ||
847 | |||
848 | writel(pcdev->csicr1, pcdev->base_csi + CSICR1); | ||
849 | |||
850 | return 0; | ||
851 | } | ||
852 | |||
853 | static int mx2_camera_set_crop(struct soc_camera_device *icd, | ||
854 | struct v4l2_crop *a) | ||
855 | { | ||
856 | struct v4l2_rect *rect = &a->c; | ||
857 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | ||
858 | struct v4l2_mbus_framefmt mf; | ||
859 | int ret; | ||
860 | |||
861 | soc_camera_limit_side(&rect->left, &rect->width, 0, 2, 4096); | ||
862 | soc_camera_limit_side(&rect->top, &rect->height, 0, 2, 4096); | ||
863 | |||
864 | ret = v4l2_subdev_call(sd, video, s_crop, a); | ||
865 | if (ret < 0) | ||
866 | return ret; | ||
867 | |||
868 | /* The capture device might have changed its output */ | ||
869 | ret = v4l2_subdev_call(sd, video, g_mbus_fmt, &mf); | ||
870 | if (ret < 0) | ||
871 | return ret; | ||
872 | |||
873 | dev_dbg(icd->dev.parent, "Sensor cropped %dx%d\n", | ||
874 | mf.width, mf.height); | ||
875 | |||
876 | icd->user_width = mf.width; | ||
877 | icd->user_height = mf.height; | ||
878 | |||
879 | return ret; | ||
880 | } | ||
881 | |||
882 | static int mx2_camera_set_fmt(struct soc_camera_device *icd, | ||
883 | struct v4l2_format *f) | ||
884 | { | ||
885 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
886 | struct mx2_camera_dev *pcdev = ici->priv; | ||
887 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | ||
888 | const struct soc_camera_format_xlate *xlate; | ||
889 | struct v4l2_pix_format *pix = &f->fmt.pix; | ||
890 | struct v4l2_mbus_framefmt mf; | ||
891 | int ret; | ||
892 | |||
893 | xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); | ||
894 | if (!xlate) { | ||
895 | dev_warn(icd->dev.parent, "Format %x not found\n", | ||
896 | pix->pixelformat); | ||
897 | return -EINVAL; | ||
898 | } | ||
899 | |||
900 | /* eMMA can only do RGB565 */ | ||
901 | if (mx27_camera_emma(pcdev) && pix->pixelformat != V4L2_PIX_FMT_RGB565) | ||
902 | return -EINVAL; | ||
903 | |||
904 | mf.width = pix->width; | ||
905 | mf.height = pix->height; | ||
906 | mf.field = pix->field; | ||
907 | mf.colorspace = pix->colorspace; | ||
908 | mf.code = xlate->code; | ||
909 | |||
910 | ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); | ||
911 | if (ret < 0 && ret != -ENOIOCTLCMD) | ||
912 | return ret; | ||
913 | |||
914 | if (mf.code != xlate->code) | ||
915 | return -EINVAL; | ||
916 | |||
917 | pix->width = mf.width; | ||
918 | pix->height = mf.height; | ||
919 | pix->field = mf.field; | ||
920 | pix->colorspace = mf.colorspace; | ||
921 | icd->current_fmt = xlate; | ||
922 | |||
923 | return 0; | ||
924 | } | ||
925 | |||
926 | static int mx2_camera_try_fmt(struct soc_camera_device *icd, | ||
927 | struct v4l2_format *f) | ||
928 | { | ||
929 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
930 | struct mx2_camera_dev *pcdev = ici->priv; | ||
931 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | ||
932 | const struct soc_camera_format_xlate *xlate; | ||
933 | struct v4l2_pix_format *pix = &f->fmt.pix; | ||
934 | struct v4l2_mbus_framefmt mf; | ||
935 | __u32 pixfmt = pix->pixelformat; | ||
936 | unsigned int width_limit; | ||
937 | int ret; | ||
938 | |||
939 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | ||
940 | if (pixfmt && !xlate) { | ||
941 | dev_warn(icd->dev.parent, "Format %x not found\n", pixfmt); | ||
942 | return -EINVAL; | ||
943 | } | ||
944 | |||
945 | /* FIXME: implement MX27 limits */ | ||
946 | |||
947 | /* eMMA can only do RGB565 */ | ||
948 | if (mx27_camera_emma(pcdev) && pixfmt != V4L2_PIX_FMT_RGB565) | ||
949 | return -EINVAL; | ||
950 | |||
951 | /* limit to MX25 hardware capabilities */ | ||
952 | if (cpu_is_mx25()) { | ||
953 | if (xlate->host_fmt->bits_per_sample <= 8) | ||
954 | width_limit = 0xffff * 4; | ||
955 | else | ||
956 | width_limit = 0xffff * 2; | ||
957 | /* CSIIMAG_PARA limit */ | ||
958 | if (pix->width > width_limit) | ||
959 | pix->width = width_limit; | ||
960 | if (pix->height > 0xffff) | ||
961 | pix->height = 0xffff; | ||
962 | |||
963 | pix->bytesperline = soc_mbus_bytes_per_line(pix->width, | ||
964 | xlate->host_fmt); | ||
965 | if (pix->bytesperline < 0) | ||
966 | return pix->bytesperline; | ||
967 | pix->sizeimage = pix->height * pix->bytesperline; | ||
968 | if (pix->sizeimage > (4 * 0x3ffff)) { /* CSIRXCNT limit */ | ||
969 | dev_warn(icd->dev.parent, | ||
970 | "Image size (%u) above limit\n", | ||
971 | pix->sizeimage); | ||
972 | return -EINVAL; | ||
973 | } | ||
974 | } | ||
975 | |||
976 | /* limit to sensor capabilities */ | ||
977 | mf.width = pix->width; | ||
978 | mf.height = pix->height; | ||
979 | mf.field = pix->field; | ||
980 | mf.colorspace = pix->colorspace; | ||
981 | mf.code = xlate->code; | ||
982 | |||
983 | ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); | ||
984 | if (ret < 0) | ||
985 | return ret; | ||
986 | |||
987 | if (mf.field == V4L2_FIELD_ANY) | ||
988 | mf.field = V4L2_FIELD_NONE; | ||
989 | if (mf.field != V4L2_FIELD_NONE) { | ||
990 | dev_err(icd->dev.parent, "Field type %d unsupported.\n", | ||
991 | mf.field); | ||
992 | return -EINVAL; | ||
993 | } | ||
994 | |||
995 | pix->width = mf.width; | ||
996 | pix->height = mf.height; | ||
997 | pix->field = mf.field; | ||
998 | pix->colorspace = mf.colorspace; | ||
999 | |||
1000 | return 0; | ||
1001 | } | ||
1002 | |||
1003 | static int mx2_camera_querycap(struct soc_camera_host *ici, | ||
1004 | struct v4l2_capability *cap) | ||
1005 | { | ||
1006 | /* cap->name is set by the friendly caller:-> */ | ||
1007 | strlcpy(cap->card, MX2_CAM_DRIVER_DESCRIPTION, sizeof(cap->card)); | ||
1008 | cap->version = MX2_CAM_VERSION_CODE; | ||
1009 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; | ||
1010 | |||
1011 | return 0; | ||
1012 | } | ||
1013 | |||
1014 | static int mx2_camera_reqbufs(struct soc_camera_file *icf, | ||
1015 | struct v4l2_requestbuffers *p) | ||
1016 | { | ||
1017 | int i; | ||
1018 | |||
1019 | for (i = 0; i < p->count; i++) { | ||
1020 | struct mx2_buffer *buf = container_of(icf->vb_vidq.bufs[i], | ||
1021 | struct mx2_buffer, vb); | ||
1022 | INIT_LIST_HEAD(&buf->vb.queue); | ||
1023 | } | ||
1024 | |||
1025 | return 0; | ||
1026 | } | ||
1027 | |||
1028 | #ifdef CONFIG_MACH_MX27 | ||
1029 | static void mx27_camera_frame_done(struct mx2_camera_dev *pcdev, int state) | ||
1030 | { | ||
1031 | struct videobuf_buffer *vb; | ||
1032 | struct mx2_buffer *buf; | ||
1033 | unsigned long flags; | ||
1034 | int ret; | ||
1035 | |||
1036 | spin_lock_irqsave(&pcdev->lock, flags); | ||
1037 | |||
1038 | if (!pcdev->active) { | ||
1039 | dev_err(pcdev->dev, "%s called with no active buffer!\n", | ||
1040 | __func__); | ||
1041 | goto out; | ||
1042 | } | ||
1043 | |||
1044 | vb = &pcdev->active->vb; | ||
1045 | buf = container_of(vb, struct mx2_buffer, vb); | ||
1046 | WARN_ON(list_empty(&vb->queue)); | ||
1047 | dev_dbg(pcdev->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | ||
1048 | vb, vb->baddr, vb->bsize); | ||
1049 | |||
1050 | /* _init is used to debug races, see comment in pxa_camera_reqbufs() */ | ||
1051 | list_del_init(&vb->queue); | ||
1052 | vb->state = state; | ||
1053 | do_gettimeofday(&vb->ts); | ||
1054 | vb->field_count++; | ||
1055 | |||
1056 | wake_up(&vb->done); | ||
1057 | |||
1058 | if (list_empty(&pcdev->capture)) { | ||
1059 | pcdev->active = NULL; | ||
1060 | goto out; | ||
1061 | } | ||
1062 | |||
1063 | pcdev->active = list_entry(pcdev->capture.next, | ||
1064 | struct mx2_buffer, vb.queue); | ||
1065 | |||
1066 | vb = &pcdev->active->vb; | ||
1067 | vb->state = VIDEOBUF_ACTIVE; | ||
1068 | |||
1069 | ret = imx_dma_setup_single(pcdev->dma, videobuf_to_dma_contig(vb), | ||
1070 | vb->size, (u32)pcdev->base_dma + 0x10, DMA_MODE_READ); | ||
1071 | |||
1072 | if (ret) { | ||
1073 | vb->state = VIDEOBUF_ERROR; | ||
1074 | pcdev->active = NULL; | ||
1075 | wake_up(&vb->done); | ||
1076 | } | ||
1077 | |||
1078 | out: | ||
1079 | spin_unlock_irqrestore(&pcdev->lock, flags); | ||
1080 | } | ||
1081 | |||
1082 | static void mx27_camera_dma_err_callback(int channel, void *data, int err) | ||
1083 | { | ||
1084 | struct mx2_camera_dev *pcdev = data; | ||
1085 | |||
1086 | mx27_camera_frame_done(pcdev, VIDEOBUF_ERROR); | ||
1087 | } | ||
1088 | |||
1089 | static void mx27_camera_dma_callback(int channel, void *data) | ||
1090 | { | ||
1091 | struct mx2_camera_dev *pcdev = data; | ||
1092 | |||
1093 | mx27_camera_frame_done(pcdev, VIDEOBUF_DONE); | ||
1094 | } | ||
1095 | |||
1096 | #define DMA_REQ_CSI_RX 31 /* FIXME: Add this to a resource */ | ||
1097 | |||
1098 | static int __devinit mx27_camera_dma_init(struct platform_device *pdev, | ||
1099 | struct mx2_camera_dev *pcdev) | ||
1100 | { | ||
1101 | int err; | ||
1102 | |||
1103 | pcdev->dma = imx_dma_request_by_prio("CSI RX DMA", DMA_PRIO_HIGH); | ||
1104 | if (pcdev->dma < 0) { | ||
1105 | dev_err(&pdev->dev, "%s failed to request DMA channel\n", | ||
1106 | __func__); | ||
1107 | return pcdev->dma; | ||
1108 | } | ||
1109 | |||
1110 | err = imx_dma_setup_handlers(pcdev->dma, mx27_camera_dma_callback, | ||
1111 | mx27_camera_dma_err_callback, pcdev); | ||
1112 | if (err) { | ||
1113 | dev_err(&pdev->dev, "%s failed to set DMA callback\n", | ||
1114 | __func__); | ||
1115 | goto err_out; | ||
1116 | } | ||
1117 | |||
1118 | err = imx_dma_config_channel(pcdev->dma, | ||
1119 | IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_FIFO, | ||
1120 | IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR, | ||
1121 | DMA_REQ_CSI_RX, 1); | ||
1122 | if (err) { | ||
1123 | dev_err(&pdev->dev, "%s failed to config DMA channel\n", | ||
1124 | __func__); | ||
1125 | goto err_out; | ||
1126 | } | ||
1127 | |||
1128 | imx_dma_config_burstlen(pcdev->dma, 64); | ||
1129 | |||
1130 | return 0; | ||
1131 | |||
1132 | err_out: | ||
1133 | imx_dma_free(pcdev->dma); | ||
1134 | |||
1135 | return err; | ||
1136 | } | ||
1137 | #endif /* CONFIG_MACH_MX27 */ | ||
1138 | |||
1139 | static unsigned int mx2_camera_poll(struct file *file, poll_table *pt) | ||
1140 | { | ||
1141 | struct soc_camera_file *icf = file->private_data; | ||
1142 | |||
1143 | return videobuf_poll_stream(file, &icf->vb_vidq, pt); | ||
1144 | } | ||
1145 | |||
1146 | static struct soc_camera_host_ops mx2_soc_camera_host_ops = { | ||
1147 | .owner = THIS_MODULE, | ||
1148 | .add = mx2_camera_add_device, | ||
1149 | .remove = mx2_camera_remove_device, | ||
1150 | .set_fmt = mx2_camera_set_fmt, | ||
1151 | .set_crop = mx2_camera_set_crop, | ||
1152 | .try_fmt = mx2_camera_try_fmt, | ||
1153 | .init_videobuf = mx2_camera_init_videobuf, | ||
1154 | .reqbufs = mx2_camera_reqbufs, | ||
1155 | .poll = mx2_camera_poll, | ||
1156 | .querycap = mx2_camera_querycap, | ||
1157 | .set_bus_param = mx2_camera_set_bus_param, | ||
1158 | }; | ||
1159 | |||
1160 | static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev, | ||
1161 | int bufnum, int state) | ||
1162 | { | ||
1163 | struct mx2_buffer *buf; | ||
1164 | struct videobuf_buffer *vb; | ||
1165 | unsigned long phys; | ||
1166 | |||
1167 | if (!list_empty(&pcdev->active_bufs)) { | ||
1168 | buf = list_entry(pcdev->active_bufs.next, | ||
1169 | struct mx2_buffer, vb.queue); | ||
1170 | |||
1171 | BUG_ON(buf->bufnum != bufnum); | ||
1172 | |||
1173 | vb = &buf->vb; | ||
1174 | #ifdef DEBUG | ||
1175 | phys = videobuf_to_dma_contig(vb); | ||
1176 | if (readl(pcdev->base_emma + PRP_DEST_RGB1_PTR + 4 * bufnum) | ||
1177 | != phys) { | ||
1178 | dev_err(pcdev->dev, "%p != %p\n", phys, | ||
1179 | readl(pcdev->base_emma + | ||
1180 | PRP_DEST_RGB1_PTR + | ||
1181 | 4 * bufnum)); | ||
1182 | } | ||
1183 | #endif | ||
1184 | dev_dbg(pcdev->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, vb, | ||
1185 | vb->baddr, vb->bsize); | ||
1186 | |||
1187 | list_del(&vb->queue); | ||
1188 | vb->state = state; | ||
1189 | do_gettimeofday(&vb->ts); | ||
1190 | vb->field_count++; | ||
1191 | |||
1192 | wake_up(&vb->done); | ||
1193 | } | ||
1194 | |||
1195 | if (list_empty(&pcdev->capture)) { | ||
1196 | writel(pcdev->discard_buffer_dma, pcdev->base_emma + | ||
1197 | PRP_DEST_RGB1_PTR + 4 * bufnum); | ||
1198 | return; | ||
1199 | } | ||
1200 | |||
1201 | buf = list_entry(pcdev->capture.next, | ||
1202 | struct mx2_buffer, vb.queue); | ||
1203 | |||
1204 | buf->bufnum = bufnum; | ||
1205 | |||
1206 | list_move_tail(pcdev->capture.next, &pcdev->active_bufs); | ||
1207 | |||
1208 | vb = &buf->vb; | ||
1209 | vb->state = VIDEOBUF_ACTIVE; | ||
1210 | |||
1211 | phys = videobuf_to_dma_contig(vb); | ||
1212 | writel(phys, pcdev->base_emma + PRP_DEST_RGB1_PTR + 4 * bufnum); | ||
1213 | } | ||
1214 | |||
1215 | static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data) | ||
1216 | { | ||
1217 | struct mx2_camera_dev *pcdev = data; | ||
1218 | unsigned int status = readl(pcdev->base_emma + PRP_INTRSTATUS); | ||
1219 | struct mx2_buffer *buf; | ||
1220 | |||
1221 | if (status & (1 << 7)) { /* overflow */ | ||
1222 | u32 cntl; | ||
1223 | /* | ||
1224 | * We only disable channel 1 here since this is the only | ||
1225 | * enabled channel | ||
1226 | * | ||
1227 | * FIXME: the correct DMA overflow handling should be resetting | ||
1228 | * the buffer, returning an error frame, and continuing with | ||
1229 | * the next one. | ||
1230 | */ | ||
1231 | cntl = readl(pcdev->base_emma + PRP_CNTL); | ||
1232 | writel(cntl & ~PRP_CNTL_CH1EN, pcdev->base_emma + PRP_CNTL); | ||
1233 | writel(cntl, pcdev->base_emma + PRP_CNTL); | ||
1234 | } | ||
1235 | if ((status & (3 << 5)) == (3 << 5) | ||
1236 | && !list_empty(&pcdev->active_bufs)) { | ||
1237 | /* | ||
1238 | * Both buffers have triggered, process the one we're expecting | ||
1239 | * to first | ||
1240 | */ | ||
1241 | buf = list_entry(pcdev->active_bufs.next, | ||
1242 | struct mx2_buffer, vb.queue); | ||
1243 | mx27_camera_frame_done_emma(pcdev, buf->bufnum, VIDEOBUF_DONE); | ||
1244 | status &= ~(1 << (6 - buf->bufnum)); /* mark processed */ | ||
1245 | } | ||
1246 | if (status & (1 << 6)) | ||
1247 | mx27_camera_frame_done_emma(pcdev, 0, VIDEOBUF_DONE); | ||
1248 | if (status & (1 << 5)) | ||
1249 | mx27_camera_frame_done_emma(pcdev, 1, VIDEOBUF_DONE); | ||
1250 | |||
1251 | writel(status, pcdev->base_emma + PRP_INTRSTATUS); | ||
1252 | |||
1253 | return IRQ_HANDLED; | ||
1254 | } | ||
1255 | |||
1256 | static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev) | ||
1257 | { | ||
1258 | struct resource *res_emma = pcdev->res_emma; | ||
1259 | int err = 0; | ||
1260 | |||
1261 | if (!request_mem_region(res_emma->start, resource_size(res_emma), | ||
1262 | MX2_CAM_DRV_NAME)) { | ||
1263 | err = -EBUSY; | ||
1264 | goto out; | ||
1265 | } | ||
1266 | |||
1267 | pcdev->base_emma = ioremap(res_emma->start, resource_size(res_emma)); | ||
1268 | if (!pcdev->base_emma) { | ||
1269 | err = -ENOMEM; | ||
1270 | goto exit_release; | ||
1271 | } | ||
1272 | |||
1273 | err = request_irq(pcdev->irq_emma, mx27_camera_emma_irq, 0, | ||
1274 | MX2_CAM_DRV_NAME, pcdev); | ||
1275 | if (err) { | ||
1276 | dev_err(pcdev->dev, "Camera EMMA interrupt register failed \n"); | ||
1277 | goto exit_iounmap; | ||
1278 | } | ||
1279 | |||
1280 | pcdev->clk_emma = clk_get(NULL, "emma"); | ||
1281 | if (IS_ERR(pcdev->clk_emma)) { | ||
1282 | err = PTR_ERR(pcdev->clk_emma); | ||
1283 | goto exit_free_irq; | ||
1284 | } | ||
1285 | |||
1286 | clk_enable(pcdev->clk_emma); | ||
1287 | |||
1288 | err = mx27_camera_emma_prp_reset(pcdev); | ||
1289 | if (err) | ||
1290 | goto exit_clk_emma_put; | ||
1291 | |||
1292 | return err; | ||
1293 | |||
1294 | exit_clk_emma_put: | ||
1295 | clk_disable(pcdev->clk_emma); | ||
1296 | clk_put(pcdev->clk_emma); | ||
1297 | exit_free_irq: | ||
1298 | free_irq(pcdev->irq_emma, pcdev); | ||
1299 | exit_iounmap: | ||
1300 | iounmap(pcdev->base_emma); | ||
1301 | exit_release: | ||
1302 | release_mem_region(res_emma->start, resource_size(res_emma)); | ||
1303 | out: | ||
1304 | return err; | ||
1305 | } | ||
1306 | |||
1307 | static int __devinit mx2_camera_probe(struct platform_device *pdev) | ||
1308 | { | ||
1309 | struct mx2_camera_dev *pcdev; | ||
1310 | struct resource *res_csi, *res_emma; | ||
1311 | void __iomem *base_csi; | ||
1312 | int irq_csi, irq_emma; | ||
1313 | irq_handler_t mx2_cam_irq_handler = cpu_is_mx25() ? mx25_camera_irq | ||
1314 | : mx27_camera_irq; | ||
1315 | int err = 0; | ||
1316 | |||
1317 | dev_dbg(&pdev->dev, "initialising\n"); | ||
1318 | |||
1319 | res_csi = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
1320 | irq_csi = platform_get_irq(pdev, 0); | ||
1321 | if (res_csi == NULL || irq_csi < 0) { | ||
1322 | dev_err(&pdev->dev, "Missing platform resources data\n"); | ||
1323 | err = -ENODEV; | ||
1324 | goto exit; | ||
1325 | } | ||
1326 | |||
1327 | pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL); | ||
1328 | if (!pcdev) { | ||
1329 | dev_err(&pdev->dev, "Could not allocate pcdev\n"); | ||
1330 | err = -ENOMEM; | ||
1331 | goto exit; | ||
1332 | } | ||
1333 | |||
1334 | pcdev->clk_csi = clk_get(&pdev->dev, NULL); | ||
1335 | if (IS_ERR(pcdev->clk_csi)) { | ||
1336 | err = PTR_ERR(pcdev->clk_csi); | ||
1337 | goto exit_kfree; | ||
1338 | } | ||
1339 | |||
1340 | dev_dbg(&pdev->dev, "Camera clock frequency: %ld\n", | ||
1341 | clk_get_rate(pcdev->clk_csi)); | ||
1342 | |||
1343 | /* Initialize DMA */ | ||
1344 | #ifdef CONFIG_MACH_MX27 | ||
1345 | if (cpu_is_mx27()) { | ||
1346 | err = mx27_camera_dma_init(pdev, pcdev); | ||
1347 | if (err) | ||
1348 | goto exit_clk_put; | ||
1349 | } | ||
1350 | #endif /* CONFIG_MACH_MX27 */ | ||
1351 | |||
1352 | pcdev->res_csi = res_csi; | ||
1353 | pcdev->pdata = pdev->dev.platform_data; | ||
1354 | if (pcdev->pdata) { | ||
1355 | long rate; | ||
1356 | |||
1357 | pcdev->platform_flags = pcdev->pdata->flags; | ||
1358 | |||
1359 | rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2); | ||
1360 | if (rate <= 0) { | ||
1361 | err = -ENODEV; | ||
1362 | goto exit_dma_free; | ||
1363 | } | ||
1364 | err = clk_set_rate(pcdev->clk_csi, rate); | ||
1365 | if (err < 0) | ||
1366 | goto exit_dma_free; | ||
1367 | } | ||
1368 | |||
1369 | INIT_LIST_HEAD(&pcdev->capture); | ||
1370 | INIT_LIST_HEAD(&pcdev->active_bufs); | ||
1371 | spin_lock_init(&pcdev->lock); | ||
1372 | |||
1373 | /* | ||
1374 | * Request the regions. | ||
1375 | */ | ||
1376 | if (!request_mem_region(res_csi->start, resource_size(res_csi), | ||
1377 | MX2_CAM_DRV_NAME)) { | ||
1378 | err = -EBUSY; | ||
1379 | goto exit_dma_free; | ||
1380 | } | ||
1381 | |||
1382 | base_csi = ioremap(res_csi->start, resource_size(res_csi)); | ||
1383 | if (!base_csi) { | ||
1384 | err = -ENOMEM; | ||
1385 | goto exit_release; | ||
1386 | } | ||
1387 | pcdev->irq_csi = irq_csi; | ||
1388 | pcdev->base_csi = base_csi; | ||
1389 | pcdev->base_dma = res_csi->start; | ||
1390 | pcdev->dev = &pdev->dev; | ||
1391 | |||
1392 | err = request_irq(pcdev->irq_csi, mx2_cam_irq_handler, 0, | ||
1393 | MX2_CAM_DRV_NAME, pcdev); | ||
1394 | if (err) { | ||
1395 | dev_err(pcdev->dev, "Camera interrupt register failed \n"); | ||
1396 | goto exit_iounmap; | ||
1397 | } | ||
1398 | |||
1399 | if (cpu_is_mx27()) { | ||
1400 | /* EMMA support */ | ||
1401 | res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1); | ||
1402 | irq_emma = platform_get_irq(pdev, 1); | ||
1403 | |||
1404 | if (res_emma && irq_emma >= 0) { | ||
1405 | dev_info(&pdev->dev, "Using EMMA\n"); | ||
1406 | pcdev->use_emma = 1; | ||
1407 | pcdev->res_emma = res_emma; | ||
1408 | pcdev->irq_emma = irq_emma; | ||
1409 | if (mx27_camera_emma_init(pcdev)) | ||
1410 | goto exit_free_irq; | ||
1411 | } | ||
1412 | } | ||
1413 | |||
1414 | pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME, | ||
1415 | pcdev->soc_host.ops = &mx2_soc_camera_host_ops, | ||
1416 | pcdev->soc_host.priv = pcdev; | ||
1417 | pcdev->soc_host.v4l2_dev.dev = &pdev->dev; | ||
1418 | pcdev->soc_host.nr = pdev->id; | ||
1419 | err = soc_camera_host_register(&pcdev->soc_host); | ||
1420 | if (err) | ||
1421 | goto exit_free_emma; | ||
1422 | |||
1423 | return 0; | ||
1424 | |||
1425 | exit_free_emma: | ||
1426 | if (mx27_camera_emma(pcdev)) { | ||
1427 | free_irq(pcdev->irq_emma, pcdev); | ||
1428 | clk_disable(pcdev->clk_emma); | ||
1429 | clk_put(pcdev->clk_emma); | ||
1430 | iounmap(pcdev->base_emma); | ||
1431 | release_mem_region(res_emma->start, resource_size(res_emma)); | ||
1432 | } | ||
1433 | exit_free_irq: | ||
1434 | free_irq(pcdev->irq_csi, pcdev); | ||
1435 | exit_iounmap: | ||
1436 | iounmap(base_csi); | ||
1437 | exit_release: | ||
1438 | release_mem_region(res_csi->start, resource_size(res_csi)); | ||
1439 | exit_dma_free: | ||
1440 | #ifdef CONFIG_MACH_MX27 | ||
1441 | if (cpu_is_mx27()) | ||
1442 | imx_dma_free(pcdev->dma); | ||
1443 | exit_clk_put: | ||
1444 | clk_put(pcdev->clk_csi); | ||
1445 | #endif /* CONFIG_MACH_MX27 */ | ||
1446 | exit_kfree: | ||
1447 | kfree(pcdev); | ||
1448 | exit: | ||
1449 | return err; | ||
1450 | } | ||
1451 | |||
1452 | static int __devexit mx2_camera_remove(struct platform_device *pdev) | ||
1453 | { | ||
1454 | struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev); | ||
1455 | struct mx2_camera_dev *pcdev = container_of(soc_host, | ||
1456 | struct mx2_camera_dev, soc_host); | ||
1457 | struct resource *res; | ||
1458 | |||
1459 | clk_put(pcdev->clk_csi); | ||
1460 | #ifdef CONFIG_MACH_MX27 | ||
1461 | if (cpu_is_mx27()) | ||
1462 | imx_dma_free(pcdev->dma); | ||
1463 | #endif /* CONFIG_MACH_MX27 */ | ||
1464 | free_irq(pcdev->irq_csi, pcdev); | ||
1465 | if (mx27_camera_emma(pcdev)) | ||
1466 | free_irq(pcdev->irq_emma, pcdev); | ||
1467 | |||
1468 | soc_camera_host_unregister(&pcdev->soc_host); | ||
1469 | |||
1470 | iounmap(pcdev->base_csi); | ||
1471 | |||
1472 | if (mx27_camera_emma(pcdev)) { | ||
1473 | clk_disable(pcdev->clk_emma); | ||
1474 | clk_put(pcdev->clk_emma); | ||
1475 | iounmap(pcdev->base_emma); | ||
1476 | res = pcdev->res_emma; | ||
1477 | release_mem_region(res->start, resource_size(res)); | ||
1478 | } | ||
1479 | |||
1480 | res = pcdev->res_csi; | ||
1481 | release_mem_region(res->start, resource_size(res)); | ||
1482 | |||
1483 | kfree(pcdev); | ||
1484 | |||
1485 | dev_info(&pdev->dev, "MX2 Camera driver unloaded\n"); | ||
1486 | |||
1487 | return 0; | ||
1488 | } | ||
1489 | |||
1490 | static struct platform_driver mx2_camera_driver = { | ||
1491 | .driver = { | ||
1492 | .name = MX2_CAM_DRV_NAME, | ||
1493 | }, | ||
1494 | .remove = __devexit_p(mx2_camera_remove), | ||
1495 | }; | ||
1496 | |||
1497 | |||
1498 | static int __init mx2_camera_init(void) | ||
1499 | { | ||
1500 | return platform_driver_probe(&mx2_camera_driver, &mx2_camera_probe); | ||
1501 | } | ||
1502 | |||
1503 | static void __exit mx2_camera_exit(void) | ||
1504 | { | ||
1505 | return platform_driver_unregister(&mx2_camera_driver); | ||
1506 | } | ||
1507 | |||
1508 | module_init(mx2_camera_init); | ||
1509 | module_exit(mx2_camera_exit); | ||
1510 | |||
1511 | MODULE_DESCRIPTION("i.MX27/i.MX25 SoC Camera Host driver"); | ||
1512 | MODULE_AUTHOR("Sascha Hauer <sha@pengutronix.de>"); | ||
1513 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/video/omap/Kconfig b/drivers/media/video/omap/Kconfig index 97c53949ca89..e63233fd2aaa 100644 --- a/drivers/media/video/omap/Kconfig +++ b/drivers/media/video/omap/Kconfig | |||
@@ -1,8 +1,8 @@ | |||
1 | config VIDEO_OMAP2_VOUT | 1 | config VIDEO_OMAP2_VOUT |
2 | tristate "OMAP2/OMAP3 V4L2-Display driver" | 2 | tristate "OMAP2/OMAP3 V4L2-Display driver" |
3 | depends on ARCH_OMAP24XX || ARCH_OMAP34XX | 3 | depends on ARCH_OMAP2 || ARCH_OMAP3 |
4 | select VIDEOBUF_GEN | 4 | select VIDEOBUF_GEN |
5 | select VIDEOBUF_DMA_SG | 5 | select VIDEOBUF_DMA_CONTIG |
6 | select OMAP2_DSS | 6 | select OMAP2_DSS |
7 | select OMAP2_VRAM | 7 | select OMAP2_VRAM |
8 | select OMAP2_VRFB | 8 | select OMAP2_VRFB |
diff --git a/drivers/media/video/omap/Makefile b/drivers/media/video/omap/Makefile index b8bab00ad010..b28788070ae1 100644 --- a/drivers/media/video/omap/Makefile +++ b/drivers/media/video/omap/Makefile | |||
@@ -3,5 +3,5 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # OMAP2/3 Display driver | 5 | # OMAP2/3 Display driver |
6 | omap-vout-mod-objs := omap_vout.o omap_voutlib.o | 6 | omap-vout-y := omap_vout.o omap_voutlib.o |
7 | obj-$(CONFIG_VIDEO_OMAP2_VOUT) += omap-vout-mod.o | 7 | obj-$(CONFIG_VIDEO_OMAP2_VOUT) += omap-vout.o |
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index e7db0554949a..929073e792c9 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c | |||
@@ -38,8 +38,9 @@ | |||
38 | #include <linux/dma-mapping.h> | 38 | #include <linux/dma-mapping.h> |
39 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
40 | #include <linux/videodev2.h> | 40 | #include <linux/videodev2.h> |
41 | #include <linux/slab.h> | ||
41 | 42 | ||
42 | #include <media/videobuf-dma-sg.h> | 43 | #include <media/videobuf-dma-contig.h> |
43 | #include <media/v4l2-device.h> | 44 | #include <media/v4l2-device.h> |
44 | #include <media/v4l2-ioctl.h> | 45 | #include <media/v4l2-ioctl.h> |
45 | 46 | ||
@@ -1053,9 +1054,9 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q, | |||
1053 | struct videobuf_buffer *vb, | 1054 | struct videobuf_buffer *vb, |
1054 | enum v4l2_field field) | 1055 | enum v4l2_field field) |
1055 | { | 1056 | { |
1057 | dma_addr_t dmabuf; | ||
1056 | struct vid_vrfb_dma *tx; | 1058 | struct vid_vrfb_dma *tx; |
1057 | enum dss_rotation rotation; | 1059 | enum dss_rotation rotation; |
1058 | struct videobuf_dmabuf *dmabuf = NULL; | ||
1059 | struct omap_vout_device *vout = q->priv_data; | 1060 | struct omap_vout_device *vout = q->priv_data; |
1060 | u32 dest_frame_index = 0, src_element_index = 0; | 1061 | u32 dest_frame_index = 0, src_element_index = 0; |
1061 | u32 dest_element_index = 0, src_frame_index = 0; | 1062 | u32 dest_element_index = 0, src_frame_index = 0; |
@@ -1074,24 +1075,17 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q, | |||
1074 | if (V4L2_MEMORY_USERPTR == vb->memory) { | 1075 | if (V4L2_MEMORY_USERPTR == vb->memory) { |
1075 | if (0 == vb->baddr) | 1076 | if (0 == vb->baddr) |
1076 | return -EINVAL; | 1077 | return -EINVAL; |
1077 | /* Virtual address */ | ||
1078 | /* priv points to struct videobuf_pci_sg_memory. But we went | ||
1079 | * pointer to videobuf_dmabuf, which is member of | ||
1080 | * videobuf_pci_sg_memory */ | ||
1081 | dmabuf = videobuf_to_dma(q->bufs[vb->i]); | ||
1082 | dmabuf->vmalloc = (void *) vb->baddr; | ||
1083 | |||
1084 | /* Physical address */ | 1078 | /* Physical address */ |
1085 | dmabuf->bus_addr = | 1079 | vout->queued_buf_addr[vb->i] = (u8 *) |
1086 | (dma_addr_t) omap_vout_uservirt_to_phys(vb->baddr); | 1080 | omap_vout_uservirt_to_phys(vb->baddr); |
1081 | } else { | ||
1082 | vout->queued_buf_addr[vb->i] = (u8 *)vout->buf_phy_addr[vb->i]; | ||
1087 | } | 1083 | } |
1088 | 1084 | ||
1089 | if (!rotation_enabled(vout)) { | 1085 | if (!rotation_enabled(vout)) |
1090 | dmabuf = videobuf_to_dma(q->bufs[vb->i]); | ||
1091 | vout->queued_buf_addr[vb->i] = (u8 *) dmabuf->bus_addr; | ||
1092 | return 0; | 1086 | return 0; |
1093 | } | 1087 | |
1094 | dmabuf = videobuf_to_dma(q->bufs[vb->i]); | 1088 | dmabuf = vout->buf_phy_addr[vb->i]; |
1095 | /* If rotation is enabled, copy input buffer into VRFB | 1089 | /* If rotation is enabled, copy input buffer into VRFB |
1096 | * memory space using DMA. We are copying input buffer | 1090 | * memory space using DMA. We are copying input buffer |
1097 | * into VRFB memory space of desired angle and DSS will | 1091 | * into VRFB memory space of desired angle and DSS will |
@@ -1120,7 +1114,7 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q, | |||
1120 | tx->dev_id, 0x0); | 1114 | tx->dev_id, 0x0); |
1121 | /* src_port required only for OMAP1 */ | 1115 | /* src_port required only for OMAP1 */ |
1122 | omap_set_dma_src_params(tx->dma_ch, 0, OMAP_DMA_AMODE_POST_INC, | 1116 | omap_set_dma_src_params(tx->dma_ch, 0, OMAP_DMA_AMODE_POST_INC, |
1123 | dmabuf->bus_addr, src_element_index, src_frame_index); | 1117 | dmabuf, src_element_index, src_frame_index); |
1124 | /*set dma source burst mode for VRFB */ | 1118 | /*set dma source burst mode for VRFB */ |
1125 | omap_set_dma_src_burst_mode(tx->dma_ch, OMAP_DMA_DATA_BURST_16); | 1119 | omap_set_dma_src_burst_mode(tx->dma_ch, OMAP_DMA_DATA_BURST_16); |
1126 | rotation = calc_rotation(vout); | 1120 | rotation = calc_rotation(vout); |
@@ -1211,7 +1205,6 @@ static int omap_vout_mmap(struct file *file, struct vm_area_struct *vma) | |||
1211 | void *pos; | 1205 | void *pos; |
1212 | unsigned long start = vma->vm_start; | 1206 | unsigned long start = vma->vm_start; |
1213 | unsigned long size = (vma->vm_end - vma->vm_start); | 1207 | unsigned long size = (vma->vm_end - vma->vm_start); |
1214 | struct videobuf_dmabuf *dmabuf = NULL; | ||
1215 | struct omap_vout_device *vout = file->private_data; | 1208 | struct omap_vout_device *vout = file->private_data; |
1216 | struct videobuf_queue *q = &vout->vbq; | 1209 | struct videobuf_queue *q = &vout->vbq; |
1217 | 1210 | ||
@@ -1241,8 +1234,7 @@ static int omap_vout_mmap(struct file *file, struct vm_area_struct *vma) | |||
1241 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | 1234 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
1242 | vma->vm_ops = &omap_vout_vm_ops; | 1235 | vma->vm_ops = &omap_vout_vm_ops; |
1243 | vma->vm_private_data = (void *) vout; | 1236 | vma->vm_private_data = (void *) vout; |
1244 | dmabuf = videobuf_to_dma(q->bufs[i]); | 1237 | pos = (void *)vout->buf_virt_addr[i]; |
1245 | pos = dmabuf->vmalloc; | ||
1246 | vma->vm_pgoff = virt_to_phys((void *)pos) >> PAGE_SHIFT; | 1238 | vma->vm_pgoff = virt_to_phys((void *)pos) >> PAGE_SHIFT; |
1247 | while (size > 0) { | 1239 | while (size > 0) { |
1248 | unsigned long pfn; | 1240 | unsigned long pfn; |
@@ -1347,8 +1339,8 @@ static int omap_vout_open(struct file *file) | |||
1347 | video_vbq_ops.buf_queue = omap_vout_buffer_queue; | 1339 | video_vbq_ops.buf_queue = omap_vout_buffer_queue; |
1348 | spin_lock_init(&vout->vbq_lock); | 1340 | spin_lock_init(&vout->vbq_lock); |
1349 | 1341 | ||
1350 | videobuf_queue_sg_init(q, &video_vbq_ops, NULL, &vout->vbq_lock, | 1342 | videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev, |
1351 | vout->type, V4L2_FIELD_NONE, | 1343 | &vout->vbq_lock, vout->type, V4L2_FIELD_NONE, |
1352 | sizeof(struct videobuf_buffer), vout); | 1344 | sizeof(struct videobuf_buffer), vout); |
1353 | 1345 | ||
1354 | v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Exiting %s\n", __func__); | 1346 | v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Exiting %s\n", __func__); |
@@ -1799,7 +1791,6 @@ static int vidioc_reqbufs(struct file *file, void *fh, | |||
1799 | unsigned int i, num_buffers = 0; | 1791 | unsigned int i, num_buffers = 0; |
1800 | struct omap_vout_device *vout = fh; | 1792 | struct omap_vout_device *vout = fh; |
1801 | struct videobuf_queue *q = &vout->vbq; | 1793 | struct videobuf_queue *q = &vout->vbq; |
1802 | struct videobuf_dmabuf *dmabuf = NULL; | ||
1803 | 1794 | ||
1804 | if ((req->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) || (req->count < 0)) | 1795 | if ((req->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) || (req->count < 0)) |
1805 | return -EINVAL; | 1796 | return -EINVAL; |
@@ -1825,8 +1816,7 @@ static int vidioc_reqbufs(struct file *file, void *fh, | |||
1825 | num_buffers = (vout->vid == OMAP_VIDEO1) ? | 1816 | num_buffers = (vout->vid == OMAP_VIDEO1) ? |
1826 | video1_numbuffers : video2_numbuffers; | 1817 | video1_numbuffers : video2_numbuffers; |
1827 | for (i = num_buffers; i < vout->buffer_allocated; i++) { | 1818 | for (i = num_buffers; i < vout->buffer_allocated; i++) { |
1828 | dmabuf = videobuf_to_dma(q->bufs[i]); | 1819 | omap_vout_free_buffer(vout->buf_virt_addr[i], |
1829 | omap_vout_free_buffer((u32)dmabuf->vmalloc, | ||
1830 | vout->buffer_size); | 1820 | vout->buffer_size); |
1831 | vout->buf_virt_addr[i] = 0; | 1821 | vout->buf_virt_addr[i] = 0; |
1832 | vout->buf_phy_addr[i] = 0; | 1822 | vout->buf_phy_addr[i] = 0; |
@@ -1855,12 +1845,7 @@ static int vidioc_reqbufs(struct file *file, void *fh, | |||
1855 | goto reqbuf_err; | 1845 | goto reqbuf_err; |
1856 | 1846 | ||
1857 | vout->buffer_allocated = req->count; | 1847 | vout->buffer_allocated = req->count; |
1858 | for (i = 0; i < req->count; i++) { | 1848 | |
1859 | dmabuf = videobuf_to_dma(q->bufs[i]); | ||
1860 | dmabuf->vmalloc = (void *) vout->buf_virt_addr[i]; | ||
1861 | dmabuf->bus_addr = (dma_addr_t) vout->buf_phy_addr[i]; | ||
1862 | dmabuf->sglen = 1; | ||
1863 | } | ||
1864 | reqbuf_err: | 1849 | reqbuf_err: |
1865 | mutex_unlock(&vout->lock); | 1850 | mutex_unlock(&vout->lock); |
1866 | return ret; | 1851 | return ret; |
@@ -2488,7 +2473,7 @@ static int omap_vout_remove(struct platform_device *pdev) | |||
2488 | 2473 | ||
2489 | for (k = 0; k < vid_dev->num_displays; k++) { | 2474 | for (k = 0; k < vid_dev->num_displays; k++) { |
2490 | if (vid_dev->displays[k]->state != OMAP_DSS_DISPLAY_DISABLED) | 2475 | if (vid_dev->displays[k]->state != OMAP_DSS_DISPLAY_DISABLED) |
2491 | vid_dev->displays[k]->disable(vid_dev->displays[k]); | 2476 | vid_dev->displays[k]->driver->disable(vid_dev->displays[k]); |
2492 | 2477 | ||
2493 | omap_dss_put_device(vid_dev->displays[k]); | 2478 | omap_dss_put_device(vid_dev->displays[k]); |
2494 | } | 2479 | } |
@@ -2545,7 +2530,9 @@ static int __init omap_vout_probe(struct platform_device *pdev) | |||
2545 | def_display = NULL; | 2530 | def_display = NULL; |
2546 | } | 2531 | } |
2547 | if (def_display) { | 2532 | if (def_display) { |
2548 | ret = def_display->enable(def_display); | 2533 | struct omap_dss_driver *dssdrv = def_display->driver; |
2534 | |||
2535 | ret = dssdrv->enable(def_display); | ||
2549 | if (ret) { | 2536 | if (ret) { |
2550 | /* Here we are not considering a error | 2537 | /* Here we are not considering a error |
2551 | * as display may be enabled by frame | 2538 | * as display may be enabled by frame |
@@ -2559,21 +2546,21 @@ static int __init omap_vout_probe(struct platform_device *pdev) | |||
2559 | if (def_display->caps & | 2546 | if (def_display->caps & |
2560 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { | 2547 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { |
2561 | #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE | 2548 | #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE |
2562 | if (def_display->enable_te) | 2549 | if (dssdrv->enable_te) |
2563 | def_display->enable_te(def_display, 1); | 2550 | dssdrv->enable_te(def_display, 1); |
2564 | if (def_display->set_update_mode) | 2551 | if (dssdrv->set_update_mode) |
2565 | def_display->set_update_mode(def_display, | 2552 | dssdrv->set_update_mode(def_display, |
2566 | OMAP_DSS_UPDATE_AUTO); | 2553 | OMAP_DSS_UPDATE_AUTO); |
2567 | #else /* MANUAL_UPDATE */ | 2554 | #else /* MANUAL_UPDATE */ |
2568 | if (def_display->enable_te) | 2555 | if (dssdrv->enable_te) |
2569 | def_display->enable_te(def_display, 0); | 2556 | dssdrv->enable_te(def_display, 0); |
2570 | if (def_display->set_update_mode) | 2557 | if (dssdrv->set_update_mode) |
2571 | def_display->set_update_mode(def_display, | 2558 | dssdrv->set_update_mode(def_display, |
2572 | OMAP_DSS_UPDATE_MANUAL); | 2559 | OMAP_DSS_UPDATE_MANUAL); |
2573 | #endif | 2560 | #endif |
2574 | } else { | 2561 | } else { |
2575 | if (def_display->set_update_mode) | 2562 | if (dssdrv->set_update_mode) |
2576 | def_display->set_update_mode(def_display, | 2563 | dssdrv->set_update_mode(def_display, |
2577 | OMAP_DSS_UPDATE_AUTO); | 2564 | OMAP_DSS_UPDATE_AUTO); |
2578 | } | 2565 | } |
2579 | } | 2566 | } |
@@ -2592,8 +2579,8 @@ static int __init omap_vout_probe(struct platform_device *pdev) | |||
2592 | for (i = 0; i < vid_dev->num_displays; i++) { | 2579 | for (i = 0; i < vid_dev->num_displays; i++) { |
2593 | struct omap_dss_device *display = vid_dev->displays[i]; | 2580 | struct omap_dss_device *display = vid_dev->displays[i]; |
2594 | 2581 | ||
2595 | if (display->update) | 2582 | if (display->driver->update) |
2596 | display->update(display, 0, 0, | 2583 | display->driver->update(display, 0, 0, |
2597 | display->panel.timings.x_res, | 2584 | display->panel.timings.x_res, |
2598 | display->panel.timings.y_res); | 2585 | display->panel.timings.y_res); |
2599 | } | 2586 | } |
@@ -2608,8 +2595,8 @@ probe_err1: | |||
2608 | if (ovl->manager && ovl->manager->device) | 2595 | if (ovl->manager && ovl->manager->device) |
2609 | def_display = ovl->manager->device; | 2596 | def_display = ovl->manager->device; |
2610 | 2597 | ||
2611 | if (def_display) | 2598 | if (def_display && def_display->driver) |
2612 | def_display->disable(def_display); | 2599 | def_display->driver->disable(def_display); |
2613 | } | 2600 | } |
2614 | probe_err0: | 2601 | probe_err0: |
2615 | kfree(vid_dev); | 2602 | kfree(vid_dev); |
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 0a877497b93f..07fabdd9b465 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -267,6 +267,21 @@ hauppauge_tuner[] = | |||
267 | { TUNER_ABSENT, "Xceive XC4000"}, | 267 | { TUNER_ABSENT, "Xceive XC4000"}, |
268 | { TUNER_ABSENT, "Dibcom 7070"}, | 268 | { TUNER_ABSENT, "Dibcom 7070"}, |
269 | { TUNER_PHILIPS_TDA8290, "NXP 18271C2"}, | 269 | { TUNER_PHILIPS_TDA8290, "NXP 18271C2"}, |
270 | { TUNER_ABSENT, "unknown"}, | ||
271 | { TUNER_ABSENT, "unknown"}, | ||
272 | { TUNER_ABSENT, "unknown"}, | ||
273 | { TUNER_ABSENT, "unknown"}, | ||
274 | /* 160-169 */ | ||
275 | { TUNER_ABSENT, "unknown"}, | ||
276 | { TUNER_ABSENT, "unknown"}, | ||
277 | { TUNER_ABSENT, "unknown"}, | ||
278 | { TUNER_ABSENT, "unknown"}, | ||
279 | { TUNER_ABSENT, "unknown"}, | ||
280 | { TUNER_ABSENT, "unknown"}, | ||
281 | { TUNER_ABSENT, "unknown"}, | ||
282 | { TUNER_ABSENT, "unknown"}, | ||
283 | { TUNER_PHILIPS_FQ1236_MK5, "TCL M30WTP-4N-E"}, | ||
284 | { TUNER_ABSENT, "unknown"}, | ||
270 | }; | 285 | }; |
271 | 286 | ||
272 | /* Use V4L2_IDENT_AMBIGUOUS for those audio 'chips' that are | 287 | /* Use V4L2_IDENT_AMBIGUOUS for those audio 'chips' that are |
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index aa0720af07a0..27a79f087b15 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -122,8 +122,8 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
122 | .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, | 122 | .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, |
123 | .index = 10, | 123 | .index = 10, |
124 | .size = 1, | 124 | .size = 1, |
125 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE | 125 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR |
126 | | UVC_CONTROL_RESTORE, | 126 | | UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE, |
127 | }, | 127 | }, |
128 | { | 128 | { |
129 | .entity = UVC_GUID_UVC_PROCESSING, | 129 | .entity = UVC_GUID_UVC_PROCESSING, |
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 26386a92f5aa..9b089dfb173e 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -353,6 +353,16 @@ config VMWARE_BALLOON | |||
353 | To compile this driver as a module, choose M here: the | 353 | To compile this driver as a module, choose M here: the |
354 | module will be called vmware_balloon. | 354 | module will be called vmware_balloon. |
355 | 355 | ||
356 | config ARM_CHARLCD | ||
357 | bool "ARM Ltd. Character LCD Driver" | ||
358 | depends on PLAT_VERSATILE | ||
359 | help | ||
360 | This is a driver for the character LCD found on the ARM Ltd. | ||
361 | Versatile and RealView Platform Baseboards. It doesn't do | ||
362 | very much more than display the text "ARM Linux" on the first | ||
363 | line and the Linux version on the second line, but that's | ||
364 | still useful. | ||
365 | |||
356 | source "drivers/misc/c2port/Kconfig" | 366 | source "drivers/misc/c2port/Kconfig" |
357 | source "drivers/misc/eeprom/Kconfig" | 367 | source "drivers/misc/eeprom/Kconfig" |
358 | source "drivers/misc/cb710/Kconfig" | 368 | source "drivers/misc/cb710/Kconfig" |
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 6ed06a19474a..67552d6e9327 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile | |||
@@ -31,3 +31,4 @@ obj-$(CONFIG_IWMC3200TOP) += iwmc3200top/ | |||
31 | obj-y += eeprom/ | 31 | obj-y += eeprom/ |
32 | obj-y += cb710/ | 32 | obj-y += cb710/ |
33 | obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o | 33 | obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o |
34 | obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o | ||
diff --git a/drivers/misc/arm-charlcd.c b/drivers/misc/arm-charlcd.c new file mode 100644 index 000000000000..9e3879ef58f2 --- /dev/null +++ b/drivers/misc/arm-charlcd.c | |||
@@ -0,0 +1,396 @@ | |||
1 | /* | ||
2 | * Driver for the on-board character LCD found on some ARM reference boards | ||
3 | * This is basically an Hitachi HD44780 LCD with a custom IP block to drive it | ||
4 | * http://en.wikipedia.org/wiki/HD44780_Character_LCD | ||
5 | * Currently it will just display the text "ARM Linux" and the linux version | ||
6 | * | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | * Author: Linus Walleij <triad@df.lth.se> | ||
9 | */ | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/module.h> | ||
12 | #include <linux/interrupt.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/completion.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/slab.h> | ||
18 | #include <linux/workqueue.h> | ||
19 | #include <generated/utsrelease.h> | ||
20 | |||
21 | #define DRIVERNAME "arm-charlcd" | ||
22 | #define CHARLCD_TIMEOUT (msecs_to_jiffies(1000)) | ||
23 | |||
24 | /* Offsets to registers */ | ||
25 | #define CHAR_COM 0x00U | ||
26 | #define CHAR_DAT 0x04U | ||
27 | #define CHAR_RD 0x08U | ||
28 | #define CHAR_RAW 0x0CU | ||
29 | #define CHAR_MASK 0x10U | ||
30 | #define CHAR_STAT 0x14U | ||
31 | |||
32 | #define CHAR_RAW_CLEAR 0x00000000U | ||
33 | #define CHAR_RAW_VALID 0x00000100U | ||
34 | |||
35 | /* Hitachi HD44780 display commands */ | ||
36 | #define HD_CLEAR 0x01U | ||
37 | #define HD_HOME 0x02U | ||
38 | #define HD_ENTRYMODE 0x04U | ||
39 | #define HD_ENTRYMODE_INCREMENT 0x02U | ||
40 | #define HD_ENTRYMODE_SHIFT 0x01U | ||
41 | #define HD_DISPCTRL 0x08U | ||
42 | #define HD_DISPCTRL_ON 0x04U | ||
43 | #define HD_DISPCTRL_CURSOR_ON 0x02U | ||
44 | #define HD_DISPCTRL_CURSOR_BLINK 0x01U | ||
45 | #define HD_CRSR_SHIFT 0x10U | ||
46 | #define HD_CRSR_SHIFT_DISPLAY 0x08U | ||
47 | #define HD_CRSR_SHIFT_DISPLAY_RIGHT 0x04U | ||
48 | #define HD_FUNCSET 0x20U | ||
49 | #define HD_FUNCSET_8BIT 0x10U | ||
50 | #define HD_FUNCSET_2_LINES 0x08U | ||
51 | #define HD_FUNCSET_FONT_5X10 0x04U | ||
52 | #define HD_SET_CGRAM 0x40U | ||
53 | #define HD_SET_DDRAM 0x80U | ||
54 | #define HD_BUSY_FLAG 0x80U | ||
55 | |||
56 | /** | ||
57 | * @dev: a pointer back to containing device | ||
58 | * @phybase: the offset to the controller in physical memory | ||
59 | * @physize: the size of the physical page | ||
60 | * @virtbase: the offset to the controller in virtual memory | ||
61 | * @irq: reserved interrupt number | ||
62 | * @complete: completion structure for the last LCD command | ||
63 | */ | ||
64 | struct charlcd { | ||
65 | struct device *dev; | ||
66 | u32 phybase; | ||
67 | u32 physize; | ||
68 | void __iomem *virtbase; | ||
69 | int irq; | ||
70 | struct completion complete; | ||
71 | struct delayed_work init_work; | ||
72 | }; | ||
73 | |||
74 | static irqreturn_t charlcd_interrupt(int irq, void *data) | ||
75 | { | ||
76 | struct charlcd *lcd = data; | ||
77 | u8 status; | ||
78 | |||
79 | status = readl(lcd->virtbase + CHAR_STAT) & 0x01; | ||
80 | /* Clear IRQ */ | ||
81 | writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW); | ||
82 | if (status) | ||
83 | complete(&lcd->complete); | ||
84 | else | ||
85 | dev_info(lcd->dev, "Spurious IRQ (%02x)\n", status); | ||
86 | return IRQ_HANDLED; | ||
87 | } | ||
88 | |||
89 | |||
90 | static void charlcd_wait_complete_irq(struct charlcd *lcd) | ||
91 | { | ||
92 | int ret; | ||
93 | |||
94 | ret = wait_for_completion_interruptible_timeout(&lcd->complete, | ||
95 | CHARLCD_TIMEOUT); | ||
96 | /* Disable IRQ after completion */ | ||
97 | writel(0x00, lcd->virtbase + CHAR_MASK); | ||
98 | |||
99 | if (ret < 0) { | ||
100 | dev_err(lcd->dev, | ||
101 | "wait_for_completion_interruptible_timeout() " | ||
102 | "returned %d waiting for ready\n", ret); | ||
103 | return; | ||
104 | } | ||
105 | |||
106 | if (ret == 0) { | ||
107 | dev_err(lcd->dev, "charlcd controller timed out " | ||
108 | "waiting for ready\n"); | ||
109 | return; | ||
110 | } | ||
111 | } | ||
112 | |||
113 | static u8 charlcd_4bit_read_char(struct charlcd *lcd) | ||
114 | { | ||
115 | u8 data; | ||
116 | u32 val; | ||
117 | int i; | ||
118 | |||
119 | /* If we can, use an IRQ to wait for the data, else poll */ | ||
120 | if (lcd->irq >= 0) | ||
121 | charlcd_wait_complete_irq(lcd); | ||
122 | else { | ||
123 | i = 0; | ||
124 | val = 0; | ||
125 | while (!(val & CHAR_RAW_VALID) && i < 10) { | ||
126 | udelay(100); | ||
127 | val = readl(lcd->virtbase + CHAR_RAW); | ||
128 | i++; | ||
129 | } | ||
130 | |||
131 | writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW); | ||
132 | } | ||
133 | msleep(1); | ||
134 | |||
135 | /* Read the 4 high bits of the data */ | ||
136 | data = readl(lcd->virtbase + CHAR_RD) & 0xf0; | ||
137 | |||
138 | /* | ||
139 | * The second read for the low bits does not trigger an IRQ | ||
140 | * so in this case we have to poll for the 4 lower bits | ||
141 | */ | ||
142 | i = 0; | ||
143 | val = 0; | ||
144 | while (!(val & CHAR_RAW_VALID) && i < 10) { | ||
145 | udelay(100); | ||
146 | val = readl(lcd->virtbase + CHAR_RAW); | ||
147 | i++; | ||
148 | } | ||
149 | writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW); | ||
150 | msleep(1); | ||
151 | |||
152 | /* Read the 4 low bits of the data */ | ||
153 | data |= (readl(lcd->virtbase + CHAR_RD) >> 4) & 0x0f; | ||
154 | |||
155 | return data; | ||
156 | } | ||
157 | |||
158 | static bool charlcd_4bit_read_bf(struct charlcd *lcd) | ||
159 | { | ||
160 | if (lcd->irq >= 0) { | ||
161 | /* | ||
162 | * If we'll use IRQs to wait for the busyflag, clear any | ||
163 | * pending flag and enable IRQ | ||
164 | */ | ||
165 | writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW); | ||
166 | init_completion(&lcd->complete); | ||
167 | writel(0x01, lcd->virtbase + CHAR_MASK); | ||
168 | } | ||
169 | readl(lcd->virtbase + CHAR_COM); | ||
170 | return charlcd_4bit_read_char(lcd) & HD_BUSY_FLAG ? true : false; | ||
171 | } | ||
172 | |||
173 | static void charlcd_4bit_wait_busy(struct charlcd *lcd) | ||
174 | { | ||
175 | int retries = 50; | ||
176 | |||
177 | udelay(100); | ||
178 | while (charlcd_4bit_read_bf(lcd) && retries) | ||
179 | retries--; | ||
180 | if (!retries) | ||
181 | dev_err(lcd->dev, "timeout waiting for busyflag\n"); | ||
182 | } | ||
183 | |||
184 | static void charlcd_4bit_command(struct charlcd *lcd, u8 cmd) | ||
185 | { | ||
186 | u32 cmdlo = (cmd << 4) & 0xf0; | ||
187 | u32 cmdhi = (cmd & 0xf0); | ||
188 | |||
189 | writel(cmdhi, lcd->virtbase + CHAR_COM); | ||
190 | udelay(10); | ||
191 | writel(cmdlo, lcd->virtbase + CHAR_COM); | ||
192 | charlcd_4bit_wait_busy(lcd); | ||
193 | } | ||
194 | |||
195 | static void charlcd_4bit_char(struct charlcd *lcd, u8 ch) | ||
196 | { | ||
197 | u32 chlo = (ch << 4) & 0xf0; | ||
198 | u32 chhi = (ch & 0xf0); | ||
199 | |||
200 | writel(chhi, lcd->virtbase + CHAR_DAT); | ||
201 | udelay(10); | ||
202 | writel(chlo, lcd->virtbase + CHAR_DAT); | ||
203 | charlcd_4bit_wait_busy(lcd); | ||
204 | } | ||
205 | |||
206 | static void charlcd_4bit_print(struct charlcd *lcd, int line, const char *str) | ||
207 | { | ||
208 | u8 offset; | ||
209 | int i; | ||
210 | |||
211 | /* | ||
212 | * We support line 0, 1 | ||
213 | * Line 1 runs from 0x00..0x27 | ||
214 | * Line 2 runs from 0x28..0x4f | ||
215 | */ | ||
216 | if (line == 0) | ||
217 | offset = 0; | ||
218 | else if (line == 1) | ||
219 | offset = 0x28; | ||
220 | else | ||
221 | return; | ||
222 | |||
223 | /* Set offset */ | ||
224 | charlcd_4bit_command(lcd, HD_SET_DDRAM | offset); | ||
225 | |||
226 | /* Send string */ | ||
227 | for (i = 0; i < strlen(str) && i < 0x28; i++) | ||
228 | charlcd_4bit_char(lcd, str[i]); | ||
229 | } | ||
230 | |||
231 | static void charlcd_4bit_init(struct charlcd *lcd) | ||
232 | { | ||
233 | /* These commands cannot be checked with the busy flag */ | ||
234 | writel(HD_FUNCSET | HD_FUNCSET_8BIT, lcd->virtbase + CHAR_COM); | ||
235 | msleep(5); | ||
236 | writel(HD_FUNCSET | HD_FUNCSET_8BIT, lcd->virtbase + CHAR_COM); | ||
237 | udelay(100); | ||
238 | writel(HD_FUNCSET | HD_FUNCSET_8BIT, lcd->virtbase + CHAR_COM); | ||
239 | udelay(100); | ||
240 | /* Go to 4bit mode */ | ||
241 | writel(HD_FUNCSET, lcd->virtbase + CHAR_COM); | ||
242 | udelay(100); | ||
243 | /* | ||
244 | * 4bit mode, 2 lines, 5x8 font, after this the number of lines | ||
245 | * and the font cannot be changed until the next initialization sequence | ||
246 | */ | ||
247 | charlcd_4bit_command(lcd, HD_FUNCSET | HD_FUNCSET_2_LINES); | ||
248 | charlcd_4bit_command(lcd, HD_DISPCTRL | HD_DISPCTRL_ON); | ||
249 | charlcd_4bit_command(lcd, HD_ENTRYMODE | HD_ENTRYMODE_INCREMENT); | ||
250 | charlcd_4bit_command(lcd, HD_CLEAR); | ||
251 | charlcd_4bit_command(lcd, HD_HOME); | ||
252 | /* Put something useful in the display */ | ||
253 | charlcd_4bit_print(lcd, 0, "ARM Linux"); | ||
254 | charlcd_4bit_print(lcd, 1, UTS_RELEASE); | ||
255 | } | ||
256 | |||
257 | static void charlcd_init_work(struct work_struct *work) | ||
258 | { | ||
259 | struct charlcd *lcd = | ||
260 | container_of(work, struct charlcd, init_work.work); | ||
261 | |||
262 | charlcd_4bit_init(lcd); | ||
263 | } | ||
264 | |||
265 | static int __init charlcd_probe(struct platform_device *pdev) | ||
266 | { | ||
267 | int ret; | ||
268 | struct charlcd *lcd; | ||
269 | struct resource *res; | ||
270 | |||
271 | lcd = kzalloc(sizeof(struct charlcd), GFP_KERNEL); | ||
272 | if (!lcd) | ||
273 | return -ENOMEM; | ||
274 | |||
275 | lcd->dev = &pdev->dev; | ||
276 | |||
277 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
278 | if (!res) { | ||
279 | ret = -ENOENT; | ||
280 | goto out_no_resource; | ||
281 | } | ||
282 | lcd->phybase = res->start; | ||
283 | lcd->physize = resource_size(res); | ||
284 | |||
285 | if (request_mem_region(lcd->phybase, lcd->physize, | ||
286 | DRIVERNAME) == NULL) { | ||
287 | ret = -EBUSY; | ||
288 | goto out_no_memregion; | ||
289 | } | ||
290 | |||
291 | lcd->virtbase = ioremap(lcd->phybase, lcd->physize); | ||
292 | if (!lcd->virtbase) { | ||
293 | ret = -ENOMEM; | ||
294 | goto out_no_remap; | ||
295 | } | ||
296 | |||
297 | lcd->irq = platform_get_irq(pdev, 0); | ||
298 | /* If no IRQ is supplied, we'll survive without it */ | ||
299 | if (lcd->irq >= 0) { | ||
300 | if (request_irq(lcd->irq, charlcd_interrupt, IRQF_DISABLED, | ||
301 | DRIVERNAME, lcd)) { | ||
302 | ret = -EIO; | ||
303 | goto out_no_irq; | ||
304 | } | ||
305 | } | ||
306 | |||
307 | platform_set_drvdata(pdev, lcd); | ||
308 | |||
309 | /* | ||
310 | * Initialize the display in a delayed work, because | ||
311 | * it is VERY slow and would slow down the boot of the system. | ||
312 | */ | ||
313 | INIT_DELAYED_WORK(&lcd->init_work, charlcd_init_work); | ||
314 | schedule_delayed_work(&lcd->init_work, 0); | ||
315 | |||
316 | dev_info(&pdev->dev, "initalized ARM character LCD at %08x\n", | ||
317 | lcd->phybase); | ||
318 | |||
319 | return 0; | ||
320 | |||
321 | out_no_irq: | ||
322 | iounmap(lcd->virtbase); | ||
323 | out_no_remap: | ||
324 | platform_set_drvdata(pdev, NULL); | ||
325 | out_no_memregion: | ||
326 | release_mem_region(lcd->phybase, SZ_4K); | ||
327 | out_no_resource: | ||
328 | kfree(lcd); | ||
329 | return ret; | ||
330 | } | ||
331 | |||
332 | static int __exit charlcd_remove(struct platform_device *pdev) | ||
333 | { | ||
334 | struct charlcd *lcd = platform_get_drvdata(pdev); | ||
335 | |||
336 | if (lcd) { | ||
337 | free_irq(lcd->irq, lcd); | ||
338 | iounmap(lcd->virtbase); | ||
339 | release_mem_region(lcd->phybase, lcd->physize); | ||
340 | platform_set_drvdata(pdev, NULL); | ||
341 | kfree(lcd); | ||
342 | } | ||
343 | |||
344 | return 0; | ||
345 | } | ||
346 | |||
347 | static int charlcd_suspend(struct device *dev) | ||
348 | { | ||
349 | struct platform_device *pdev = to_platform_device(dev); | ||
350 | struct charlcd *lcd = platform_get_drvdata(pdev); | ||
351 | |||
352 | /* Power the display off */ | ||
353 | charlcd_4bit_command(lcd, HD_DISPCTRL); | ||
354 | return 0; | ||
355 | } | ||
356 | |||
357 | static int charlcd_resume(struct device *dev) | ||
358 | { | ||
359 | struct platform_device *pdev = to_platform_device(dev); | ||
360 | struct charlcd *lcd = platform_get_drvdata(pdev); | ||
361 | |||
362 | /* Turn the display back on */ | ||
363 | charlcd_4bit_command(lcd, HD_DISPCTRL | HD_DISPCTRL_ON); | ||
364 | return 0; | ||
365 | } | ||
366 | |||
367 | static const struct dev_pm_ops charlcd_pm_ops = { | ||
368 | .suspend = charlcd_suspend, | ||
369 | .resume = charlcd_resume, | ||
370 | }; | ||
371 | |||
372 | static struct platform_driver charlcd_driver = { | ||
373 | .driver = { | ||
374 | .name = DRIVERNAME, | ||
375 | .owner = THIS_MODULE, | ||
376 | .pm = &charlcd_pm_ops, | ||
377 | }, | ||
378 | .remove = __exit_p(charlcd_remove), | ||
379 | }; | ||
380 | |||
381 | static int __init charlcd_init(void) | ||
382 | { | ||
383 | return platform_driver_probe(&charlcd_driver, charlcd_probe); | ||
384 | } | ||
385 | |||
386 | static void __exit charlcd_exit(void) | ||
387 | { | ||
388 | platform_driver_unregister(&charlcd_driver); | ||
389 | } | ||
390 | |||
391 | module_init(charlcd_init); | ||
392 | module_exit(charlcd_exit); | ||
393 | |||
394 | MODULE_AUTHOR("Linus Walleij <triad@df.lth.se>"); | ||
395 | MODULE_DESCRIPTION("ARM Character LCD Driver"); | ||
396 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c index 9bec24db4d41..2d44b3300104 100644 --- a/drivers/misc/cs5535-mfgpt.c +++ b/drivers/misc/cs5535-mfgpt.c | |||
@@ -366,6 +366,6 @@ static int __init cs5535_mfgpt_init(void) | |||
366 | 366 | ||
367 | module_init(cs5535_mfgpt_init); | 367 | module_init(cs5535_mfgpt_init); |
368 | 368 | ||
369 | MODULE_AUTHOR("Andres Salomon <dilinger@collabora.co.uk>"); | 369 | MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>"); |
370 | MODULE_DESCRIPTION("CS5535/CS5536 MFGPT timer driver"); | 370 | MODULE_DESCRIPTION("CS5535/CS5536 MFGPT timer driver"); |
371 | MODULE_LICENSE("GPL"); | 371 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 4917af96bae1..840b301b5671 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/amba/mmci.h> | 26 | #include <linux/amba/mmci.h> |
27 | #include <linux/regulator/consumer.h> | 27 | #include <linux/regulator/consumer.h> |
28 | 28 | ||
29 | #include <asm/cacheflush.h> | ||
30 | #include <asm/div64.h> | 29 | #include <asm/div64.h> |
31 | #include <asm/io.h> | 30 | #include <asm/io.h> |
32 | #include <asm/sizes.h> | 31 | #include <asm/sizes.h> |
@@ -37,12 +36,39 @@ | |||
37 | 36 | ||
38 | static unsigned int fmax = 515633; | 37 | static unsigned int fmax = 515633; |
39 | 38 | ||
39 | /** | ||
40 | * struct variant_data - MMCI variant-specific quirks | ||
41 | * @clkreg: default value for MCICLOCK register | ||
42 | * @clkreg_enable: enable value for MMCICLOCK register | ||
43 | * @datalength_bits: number of bits in the MMCIDATALENGTH register | ||
44 | */ | ||
45 | struct variant_data { | ||
46 | unsigned int clkreg; | ||
47 | unsigned int clkreg_enable; | ||
48 | unsigned int datalength_bits; | ||
49 | }; | ||
50 | |||
51 | static struct variant_data variant_arm = { | ||
52 | .datalength_bits = 16, | ||
53 | }; | ||
54 | |||
55 | static struct variant_data variant_u300 = { | ||
56 | .clkreg_enable = 1 << 13, /* HWFCEN */ | ||
57 | .datalength_bits = 16, | ||
58 | }; | ||
59 | |||
60 | static struct variant_data variant_ux500 = { | ||
61 | .clkreg = MCI_CLK_ENABLE, | ||
62 | .clkreg_enable = 1 << 14, /* HWFCEN */ | ||
63 | .datalength_bits = 24, | ||
64 | }; | ||
40 | /* | 65 | /* |
41 | * This must be called with host->lock held | 66 | * This must be called with host->lock held |
42 | */ | 67 | */ |
43 | static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) | 68 | static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) |
44 | { | 69 | { |
45 | u32 clk = 0; | 70 | struct variant_data *variant = host->variant; |
71 | u32 clk = variant->clkreg; | ||
46 | 72 | ||
47 | if (desired) { | 73 | if (desired) { |
48 | if (desired >= host->mclk) { | 74 | if (desired >= host->mclk) { |
@@ -54,8 +80,8 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) | |||
54 | clk = 255; | 80 | clk = 255; |
55 | host->cclk = host->mclk / (2 * (clk + 1)); | 81 | host->cclk = host->mclk / (2 * (clk + 1)); |
56 | } | 82 | } |
57 | if (host->hw_designer == AMBA_VENDOR_ST) | 83 | |
58 | clk |= MCI_ST_FCEN; /* Bug fix in ST IP block */ | 84 | clk |= variant->clkreg_enable; |
59 | clk |= MCI_CLK_ENABLE; | 85 | clk |= MCI_CLK_ENABLE; |
60 | /* This hasn't proven to be worthwhile */ | 86 | /* This hasn't proven to be worthwhile */ |
61 | /* clk |= MCI_CLK_PWRSAVE; */ | 87 | /* clk |= MCI_CLK_PWRSAVE; */ |
@@ -98,6 +124,18 @@ static void mmci_stop_data(struct mmci_host *host) | |||
98 | host->data = NULL; | 124 | host->data = NULL; |
99 | } | 125 | } |
100 | 126 | ||
127 | static void mmci_init_sg(struct mmci_host *host, struct mmc_data *data) | ||
128 | { | ||
129 | unsigned int flags = SG_MITER_ATOMIC; | ||
130 | |||
131 | if (data->flags & MMC_DATA_READ) | ||
132 | flags |= SG_MITER_TO_SG; | ||
133 | else | ||
134 | flags |= SG_MITER_FROM_SG; | ||
135 | |||
136 | sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags); | ||
137 | } | ||
138 | |||
101 | static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | 139 | static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) |
102 | { | 140 | { |
103 | unsigned int datactrl, timeout, irqmask; | 141 | unsigned int datactrl, timeout, irqmask; |
@@ -109,7 +147,7 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | |||
109 | data->blksz, data->blocks, data->flags); | 147 | data->blksz, data->blocks, data->flags); |
110 | 148 | ||
111 | host->data = data; | 149 | host->data = data; |
112 | host->size = data->blksz; | 150 | host->size = data->blksz * data->blocks; |
113 | host->data_xfered = 0; | 151 | host->data_xfered = 0; |
114 | 152 | ||
115 | mmci_init_sg(host, data); | 153 | mmci_init_sg(host, data); |
@@ -210,8 +248,17 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
210 | * We hit an error condition. Ensure that any data | 248 | * We hit an error condition. Ensure that any data |
211 | * partially written to a page is properly coherent. | 249 | * partially written to a page is properly coherent. |
212 | */ | 250 | */ |
213 | if (host->sg_len && data->flags & MMC_DATA_READ) | 251 | if (data->flags & MMC_DATA_READ) { |
214 | flush_dcache_page(sg_page(host->sg_ptr)); | 252 | struct sg_mapping_iter *sg_miter = &host->sg_miter; |
253 | unsigned long flags; | ||
254 | |||
255 | local_irq_save(flags); | ||
256 | if (sg_miter_next(sg_miter)) { | ||
257 | flush_dcache_page(sg_miter->page); | ||
258 | sg_miter_stop(sg_miter); | ||
259 | } | ||
260 | local_irq_restore(flags); | ||
261 | } | ||
215 | } | 262 | } |
216 | if (status & MCI_DATAEND) { | 263 | if (status & MCI_DATAEND) { |
217 | mmci_stop_data(host); | 264 | mmci_stop_data(host); |
@@ -314,15 +361,18 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem | |||
314 | static irqreturn_t mmci_pio_irq(int irq, void *dev_id) | 361 | static irqreturn_t mmci_pio_irq(int irq, void *dev_id) |
315 | { | 362 | { |
316 | struct mmci_host *host = dev_id; | 363 | struct mmci_host *host = dev_id; |
364 | struct sg_mapping_iter *sg_miter = &host->sg_miter; | ||
317 | void __iomem *base = host->base; | 365 | void __iomem *base = host->base; |
366 | unsigned long flags; | ||
318 | u32 status; | 367 | u32 status; |
319 | 368 | ||
320 | status = readl(base + MMCISTATUS); | 369 | status = readl(base + MMCISTATUS); |
321 | 370 | ||
322 | dev_dbg(mmc_dev(host->mmc), "irq1 (pio) %08x\n", status); | 371 | dev_dbg(mmc_dev(host->mmc), "irq1 (pio) %08x\n", status); |
323 | 372 | ||
373 | local_irq_save(flags); | ||
374 | |||
324 | do { | 375 | do { |
325 | unsigned long flags; | ||
326 | unsigned int remain, len; | 376 | unsigned int remain, len; |
327 | char *buffer; | 377 | char *buffer; |
328 | 378 | ||
@@ -336,11 +386,11 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id) | |||
336 | if (!(status & (MCI_TXFIFOHALFEMPTY|MCI_RXDATAAVLBL))) | 386 | if (!(status & (MCI_TXFIFOHALFEMPTY|MCI_RXDATAAVLBL))) |
337 | break; | 387 | break; |
338 | 388 | ||
339 | /* | 389 | if (!sg_miter_next(sg_miter)) |
340 | * Map the current scatter buffer. | 390 | break; |
341 | */ | 391 | |
342 | buffer = mmci_kmap_atomic(host, &flags) + host->sg_off; | 392 | buffer = sg_miter->addr; |
343 | remain = host->sg_ptr->length - host->sg_off; | 393 | remain = sg_miter->length; |
344 | 394 | ||
345 | len = 0; | 395 | len = 0; |
346 | if (status & MCI_RXACTIVE) | 396 | if (status & MCI_RXACTIVE) |
@@ -348,31 +398,24 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id) | |||
348 | if (status & MCI_TXACTIVE) | 398 | if (status & MCI_TXACTIVE) |
349 | len = mmci_pio_write(host, buffer, remain, status); | 399 | len = mmci_pio_write(host, buffer, remain, status); |
350 | 400 | ||
351 | /* | 401 | sg_miter->consumed = len; |
352 | * Unmap the buffer. | ||
353 | */ | ||
354 | mmci_kunmap_atomic(host, buffer, &flags); | ||
355 | 402 | ||
356 | host->sg_off += len; | ||
357 | host->size -= len; | 403 | host->size -= len; |
358 | remain -= len; | 404 | remain -= len; |
359 | 405 | ||
360 | if (remain) | 406 | if (remain) |
361 | break; | 407 | break; |
362 | 408 | ||
363 | /* | ||
364 | * If we were reading, and we have completed this | ||
365 | * page, ensure that the data cache is coherent. | ||
366 | */ | ||
367 | if (status & MCI_RXACTIVE) | 409 | if (status & MCI_RXACTIVE) |
368 | flush_dcache_page(sg_page(host->sg_ptr)); | 410 | flush_dcache_page(sg_miter->page); |
369 | |||
370 | if (!mmci_next_sg(host)) | ||
371 | break; | ||
372 | 411 | ||
373 | status = readl(base + MMCISTATUS); | 412 | status = readl(base + MMCISTATUS); |
374 | } while (1); | 413 | } while (1); |
375 | 414 | ||
415 | sg_miter_stop(sg_miter); | ||
416 | |||
417 | local_irq_restore(flags); | ||
418 | |||
376 | /* | 419 | /* |
377 | * If we're nearing the end of the read, switch to | 420 | * If we're nearing the end of the read, switch to |
378 | * "any data available" mode. | 421 | * "any data available" mode. |
@@ -477,16 +520,9 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
477 | /* This implicitly enables the regulator */ | 520 | /* This implicitly enables the regulator */ |
478 | mmc_regulator_set_ocr(host->vcc, ios->vdd); | 521 | mmc_regulator_set_ocr(host->vcc, ios->vdd); |
479 | #endif | 522 | #endif |
480 | /* | 523 | if (host->plat->vdd_handler) |
481 | * The translate_vdd function is not used if you have | 524 | pwr |= host->plat->vdd_handler(mmc_dev(mmc), ios->vdd, |
482 | * an external regulator, or your design is really weird. | 525 | ios->power_mode); |
483 | * Using it would mean sending in power control BOTH using | ||
484 | * a regulator AND the 4 MMCIPWR bits. If we don't have | ||
485 | * a regulator, we might have some other platform specific | ||
486 | * power control behind this translate function. | ||
487 | */ | ||
488 | if (!host->vcc && host->plat->translate_vdd) | ||
489 | pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd); | ||
490 | /* The ST version does not have this, fall through to POWER_ON */ | 526 | /* The ST version does not have this, fall through to POWER_ON */ |
491 | if (host->hw_designer != AMBA_VENDOR_ST) { | 527 | if (host->hw_designer != AMBA_VENDOR_ST) { |
492 | pwr |= MCI_PWR_UP; | 528 | pwr |= MCI_PWR_UP; |
@@ -539,9 +575,13 @@ static int mmci_get_cd(struct mmc_host *mmc) | |||
539 | if (host->gpio_cd == -ENOSYS) | 575 | if (host->gpio_cd == -ENOSYS) |
540 | status = host->plat->status(mmc_dev(host->mmc)); | 576 | status = host->plat->status(mmc_dev(host->mmc)); |
541 | else | 577 | else |
542 | status = gpio_get_value(host->gpio_cd); | 578 | status = !gpio_get_value(host->gpio_cd); |
543 | 579 | ||
544 | return !status; | 580 | /* |
581 | * Use positive logic throughout - status is zero for no card, | ||
582 | * non-zero for card inserted. | ||
583 | */ | ||
584 | return status; | ||
545 | } | 585 | } |
546 | 586 | ||
547 | static const struct mmc_host_ops mmci_ops = { | 587 | static const struct mmc_host_ops mmci_ops = { |
@@ -551,21 +591,10 @@ static const struct mmc_host_ops mmci_ops = { | |||
551 | .get_cd = mmci_get_cd, | 591 | .get_cd = mmci_get_cd, |
552 | }; | 592 | }; |
553 | 593 | ||
554 | static void mmci_check_status(unsigned long data) | ||
555 | { | ||
556 | struct mmci_host *host = (struct mmci_host *)data; | ||
557 | unsigned int status = mmci_get_cd(host->mmc); | ||
558 | |||
559 | if (status ^ host->oldstat) | ||
560 | mmc_detect_change(host->mmc, 0); | ||
561 | |||
562 | host->oldstat = status; | ||
563 | mod_timer(&host->timer, jiffies + HZ); | ||
564 | } | ||
565 | |||
566 | static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | 594 | static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) |
567 | { | 595 | { |
568 | struct mmci_platform_data *plat = dev->dev.platform_data; | 596 | struct mmci_platform_data *plat = dev->dev.platform_data; |
597 | struct variant_data *variant = id->data; | ||
569 | struct mmci_host *host; | 598 | struct mmci_host *host; |
570 | struct mmc_host *mmc; | 599 | struct mmc_host *mmc; |
571 | int ret; | 600 | int ret; |
@@ -609,6 +638,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
609 | goto clk_free; | 638 | goto clk_free; |
610 | 639 | ||
611 | host->plat = plat; | 640 | host->plat = plat; |
641 | host->variant = variant; | ||
612 | host->mclk = clk_get_rate(host->clk); | 642 | host->mclk = clk_get_rate(host->clk); |
613 | /* | 643 | /* |
614 | * According to the spec, mclk is max 100 MHz, | 644 | * According to the spec, mclk is max 100 MHz, |
@@ -669,6 +699,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
669 | if (host->vcc == NULL) | 699 | if (host->vcc == NULL) |
670 | mmc->ocr_avail = plat->ocr_mask; | 700 | mmc->ocr_avail = plat->ocr_mask; |
671 | mmc->caps = plat->capabilities; | 701 | mmc->caps = plat->capabilities; |
702 | mmc->caps |= MMC_CAP_NEEDS_POLL; | ||
672 | 703 | ||
673 | /* | 704 | /* |
674 | * We can do SGIO | 705 | * We can do SGIO |
@@ -677,10 +708,11 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
677 | mmc->max_phys_segs = NR_SG; | 708 | mmc->max_phys_segs = NR_SG; |
678 | 709 | ||
679 | /* | 710 | /* |
680 | * Since we only have a 16-bit data length register, we must | 711 | * Since only a certain number of bits are valid in the data length |
681 | * ensure that we don't exceed 2^16-1 bytes in a single request. | 712 | * register, we must ensure that we don't exceed 2^num-1 bytes in a |
713 | * single request. | ||
682 | */ | 714 | */ |
683 | mmc->max_req_size = 65535; | 715 | mmc->max_req_size = (1 << variant->datalength_bits) - 1; |
684 | 716 | ||
685 | /* | 717 | /* |
686 | * Set the maximum segment size. Since we aren't doing DMA | 718 | * Set the maximum segment size. Since we aren't doing DMA |
@@ -734,7 +766,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
734 | writel(MCI_IRQENABLE, host->base + MMCIMASK0); | 766 | writel(MCI_IRQENABLE, host->base + MMCIMASK0); |
735 | 767 | ||
736 | amba_set_drvdata(dev, mmc); | 768 | amba_set_drvdata(dev, mmc); |
737 | host->oldstat = mmci_get_cd(host->mmc); | ||
738 | 769 | ||
739 | mmc_add_host(mmc); | 770 | mmc_add_host(mmc); |
740 | 771 | ||
@@ -742,12 +773,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
742 | mmc_hostname(mmc), amba_rev(dev), amba_config(dev), | 773 | mmc_hostname(mmc), amba_rev(dev), amba_config(dev), |
743 | (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]); | 774 | (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]); |
744 | 775 | ||
745 | init_timer(&host->timer); | ||
746 | host->timer.data = (unsigned long)host; | ||
747 | host->timer.function = mmci_check_status; | ||
748 | host->timer.expires = jiffies + HZ; | ||
749 | add_timer(&host->timer); | ||
750 | |||
751 | return 0; | 776 | return 0; |
752 | 777 | ||
753 | irq0_free: | 778 | irq0_free: |
@@ -781,8 +806,6 @@ static int __devexit mmci_remove(struct amba_device *dev) | |||
781 | if (mmc) { | 806 | if (mmc) { |
782 | struct mmci_host *host = mmc_priv(mmc); | 807 | struct mmci_host *host = mmc_priv(mmc); |
783 | 808 | ||
784 | del_timer_sync(&host->timer); | ||
785 | |||
786 | mmc_remove_host(mmc); | 809 | mmc_remove_host(mmc); |
787 | 810 | ||
788 | writel(0, host->base + MMCIMASK0); | 811 | writel(0, host->base + MMCIMASK0); |
@@ -856,19 +879,28 @@ static struct amba_id mmci_ids[] = { | |||
856 | { | 879 | { |
857 | .id = 0x00041180, | 880 | .id = 0x00041180, |
858 | .mask = 0x000fffff, | 881 | .mask = 0x000fffff, |
882 | .data = &variant_arm, | ||
859 | }, | 883 | }, |
860 | { | 884 | { |
861 | .id = 0x00041181, | 885 | .id = 0x00041181, |
862 | .mask = 0x000fffff, | 886 | .mask = 0x000fffff, |
887 | .data = &variant_arm, | ||
863 | }, | 888 | }, |
864 | /* ST Micro variants */ | 889 | /* ST Micro variants */ |
865 | { | 890 | { |
866 | .id = 0x00180180, | 891 | .id = 0x00180180, |
867 | .mask = 0x00ffffff, | 892 | .mask = 0x00ffffff, |
893 | .data = &variant_u300, | ||
868 | }, | 894 | }, |
869 | { | 895 | { |
870 | .id = 0x00280180, | 896 | .id = 0x00280180, |
871 | .mask = 0x00ffffff, | 897 | .mask = 0x00ffffff, |
898 | .data = &variant_u300, | ||
899 | }, | ||
900 | { | ||
901 | .id = 0x00480180, | ||
902 | .mask = 0x00ffffff, | ||
903 | .data = &variant_ux500, | ||
872 | }, | 904 | }, |
873 | { 0, 0 }, | 905 | { 0, 0 }, |
874 | }; | 906 | }; |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index d77062e5e3af..68970cfb81e1 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
@@ -28,8 +28,6 @@ | |||
28 | #define MCI_4BIT_BUS (1 << 11) | 28 | #define MCI_4BIT_BUS (1 << 11) |
29 | /* 8bit wide buses supported in ST Micro versions */ | 29 | /* 8bit wide buses supported in ST Micro versions */ |
30 | #define MCI_ST_8BIT_BUS (1 << 12) | 30 | #define MCI_ST_8BIT_BUS (1 << 12) |
31 | /* HW flow control on the ST Micro version */ | ||
32 | #define MCI_ST_FCEN (1 << 13) | ||
33 | 31 | ||
34 | #define MMCIARGUMENT 0x008 | 32 | #define MMCIARGUMENT 0x008 |
35 | #define MMCICOMMAND 0x00c | 33 | #define MMCICOMMAND 0x00c |
@@ -145,6 +143,7 @@ | |||
145 | #define NR_SG 16 | 143 | #define NR_SG 16 |
146 | 144 | ||
147 | struct clk; | 145 | struct clk; |
146 | struct variant_data; | ||
148 | 147 | ||
149 | struct mmci_host { | 148 | struct mmci_host { |
150 | void __iomem *base; | 149 | void __iomem *base; |
@@ -164,6 +163,7 @@ struct mmci_host { | |||
164 | unsigned int cclk; | 163 | unsigned int cclk; |
165 | u32 pwr; | 164 | u32 pwr; |
166 | struct mmci_platform_data *plat; | 165 | struct mmci_platform_data *plat; |
166 | struct variant_data *variant; | ||
167 | 167 | ||
168 | u8 hw_designer; | 168 | u8 hw_designer; |
169 | u8 hw_revision:4; | 169 | u8 hw_revision:4; |
@@ -171,42 +171,9 @@ struct mmci_host { | |||
171 | struct timer_list timer; | 171 | struct timer_list timer; |
172 | unsigned int oldstat; | 172 | unsigned int oldstat; |
173 | 173 | ||
174 | unsigned int sg_len; | ||
175 | |||
176 | /* pio stuff */ | 174 | /* pio stuff */ |
177 | struct scatterlist *sg_ptr; | 175 | struct sg_mapping_iter sg_miter; |
178 | unsigned int sg_off; | ||
179 | unsigned int size; | 176 | unsigned int size; |
180 | struct regulator *vcc; | 177 | struct regulator *vcc; |
181 | }; | 178 | }; |
182 | 179 | ||
183 | static inline void mmci_init_sg(struct mmci_host *host, struct mmc_data *data) | ||
184 | { | ||
185 | /* | ||
186 | * Ideally, we want the higher levels to pass us a scatter list. | ||
187 | */ | ||
188 | host->sg_len = data->sg_len; | ||
189 | host->sg_ptr = data->sg; | ||
190 | host->sg_off = 0; | ||
191 | } | ||
192 | |||
193 | static inline int mmci_next_sg(struct mmci_host *host) | ||
194 | { | ||
195 | host->sg_ptr++; | ||
196 | host->sg_off = 0; | ||
197 | return --host->sg_len; | ||
198 | } | ||
199 | |||
200 | static inline char *mmci_kmap_atomic(struct mmci_host *host, unsigned long *flags) | ||
201 | { | ||
202 | struct scatterlist *sg = host->sg_ptr; | ||
203 | |||
204 | local_irq_save(*flags); | ||
205 | return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset; | ||
206 | } | ||
207 | |||
208 | static inline void mmci_kunmap_atomic(struct mmci_host *host, void *buffer, unsigned long *flags) | ||
209 | { | ||
210 | kunmap_atomic(buffer, KM_BIO_SRC_IRQ); | ||
211 | local_irq_restore(*flags); | ||
212 | } | ||
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index d9d4a72e0ec7..350f78e86245 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
@@ -119,6 +119,7 @@ struct mxcmci_host { | |||
119 | int detect_irq; | 119 | int detect_irq; |
120 | int dma; | 120 | int dma; |
121 | int do_dma; | 121 | int do_dma; |
122 | int default_irq_mask; | ||
122 | int use_sdio; | 123 | int use_sdio; |
123 | unsigned int power_mode; | 124 | unsigned int power_mode; |
124 | struct imxmmc_platform_data *pdata; | 125 | struct imxmmc_platform_data *pdata; |
@@ -228,7 +229,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) | |||
228 | static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, | 229 | static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, |
229 | unsigned int cmdat) | 230 | unsigned int cmdat) |
230 | { | 231 | { |
231 | u32 int_cntr; | 232 | u32 int_cntr = host->default_irq_mask; |
232 | unsigned long flags; | 233 | unsigned long flags; |
233 | 234 | ||
234 | WARN_ON(host->cmd != NULL); | 235 | WARN_ON(host->cmd != NULL); |
@@ -275,7 +276,7 @@ static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, | |||
275 | static void mxcmci_finish_request(struct mxcmci_host *host, | 276 | static void mxcmci_finish_request(struct mxcmci_host *host, |
276 | struct mmc_request *req) | 277 | struct mmc_request *req) |
277 | { | 278 | { |
278 | u32 int_cntr = 0; | 279 | u32 int_cntr = host->default_irq_mask; |
279 | unsigned long flags; | 280 | unsigned long flags; |
280 | 281 | ||
281 | spin_lock_irqsave(&host->lock, flags); | 282 | spin_lock_irqsave(&host->lock, flags); |
@@ -585,6 +586,9 @@ static irqreturn_t mxcmci_irq(int irq, void *devid) | |||
585 | (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE))) | 586 | (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE))) |
586 | mxcmci_data_done(host, stat); | 587 | mxcmci_data_done(host, stat); |
587 | #endif | 588 | #endif |
589 | if (host->default_irq_mask && | ||
590 | (stat & (STATUS_CARD_INSERTION | STATUS_CARD_REMOVAL))) | ||
591 | mmc_detect_change(host->mmc, msecs_to_jiffies(200)); | ||
588 | return IRQ_HANDLED; | 592 | return IRQ_HANDLED; |
589 | } | 593 | } |
590 | 594 | ||
@@ -809,6 +813,12 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
809 | else | 813 | else |
810 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; | 814 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; |
811 | 815 | ||
816 | if (host->pdata && host->pdata->dat3_card_detect) | ||
817 | host->default_irq_mask = | ||
818 | INT_CARD_INSERTION_EN | INT_CARD_REMOVAL_EN; | ||
819 | else | ||
820 | host->default_irq_mask = 0; | ||
821 | |||
812 | host->res = r; | 822 | host->res = r; |
813 | host->irq = irq; | 823 | host->irq = irq; |
814 | 824 | ||
@@ -835,7 +845,7 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
835 | /* recommended in data sheet */ | 845 | /* recommended in data sheet */ |
836 | writew(0x2db4, host->base + MMC_REG_READ_TO); | 846 | writew(0x2db4, host->base + MMC_REG_READ_TO); |
837 | 847 | ||
838 | writel(0, host->base + MMC_REG_INT_CNTR); | 848 | writel(host->default_irq_mask, host->base + MMC_REG_INT_CNTR); |
839 | 849 | ||
840 | #ifdef HAS_DMA | 850 | #ifdef HAS_DMA |
841 | host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW); | 851 | host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW); |
@@ -926,43 +936,47 @@ static int mxcmci_remove(struct platform_device *pdev) | |||
926 | } | 936 | } |
927 | 937 | ||
928 | #ifdef CONFIG_PM | 938 | #ifdef CONFIG_PM |
929 | static int mxcmci_suspend(struct platform_device *dev, pm_message_t state) | 939 | static int mxcmci_suspend(struct device *dev) |
930 | { | 940 | { |
931 | struct mmc_host *mmc = platform_get_drvdata(dev); | 941 | struct mmc_host *mmc = dev_get_drvdata(dev); |
942 | struct mxcmci_host *host = mmc_priv(mmc); | ||
932 | int ret = 0; | 943 | int ret = 0; |
933 | 944 | ||
934 | if (mmc) | 945 | if (mmc) |
935 | ret = mmc_suspend_host(mmc); | 946 | ret = mmc_suspend_host(mmc); |
947 | clk_disable(host->clk); | ||
936 | 948 | ||
937 | return ret; | 949 | return ret; |
938 | } | 950 | } |
939 | 951 | ||
940 | static int mxcmci_resume(struct platform_device *dev) | 952 | static int mxcmci_resume(struct device *dev) |
941 | { | 953 | { |
942 | struct mmc_host *mmc = platform_get_drvdata(dev); | 954 | struct mmc_host *mmc = dev_get_drvdata(dev); |
943 | struct mxcmci_host *host; | 955 | struct mxcmci_host *host = mmc_priv(mmc); |
944 | int ret = 0; | 956 | int ret = 0; |
945 | 957 | ||
946 | if (mmc) { | 958 | clk_enable(host->clk); |
947 | host = mmc_priv(mmc); | 959 | if (mmc) |
948 | ret = mmc_resume_host(mmc); | 960 | ret = mmc_resume_host(mmc); |
949 | } | ||
950 | 961 | ||
951 | return ret; | 962 | return ret; |
952 | } | 963 | } |
953 | #else | 964 | |
954 | #define mxcmci_suspend NULL | 965 | static const struct dev_pm_ops mxcmci_pm_ops = { |
955 | #define mxcmci_resume NULL | 966 | .suspend = mxcmci_suspend, |
956 | #endif /* CONFIG_PM */ | 967 | .resume = mxcmci_resume, |
968 | }; | ||
969 | #endif | ||
957 | 970 | ||
958 | static struct platform_driver mxcmci_driver = { | 971 | static struct platform_driver mxcmci_driver = { |
959 | .probe = mxcmci_probe, | 972 | .probe = mxcmci_probe, |
960 | .remove = mxcmci_remove, | 973 | .remove = mxcmci_remove, |
961 | .suspend = mxcmci_suspend, | ||
962 | .resume = mxcmci_resume, | ||
963 | .driver = { | 974 | .driver = { |
964 | .name = DRIVER_NAME, | 975 | .name = DRIVER_NAME, |
965 | .owner = THIS_MODULE, | 976 | .owner = THIS_MODULE, |
977 | #ifdef CONFIG_PM | ||
978 | .pm = &mxcmci_pm_ops, | ||
979 | #endif | ||
966 | } | 980 | } |
967 | }; | 981 | }; |
968 | 982 | ||
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index af217924a76e..ad30f074ee15 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -365,6 +365,26 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
365 | 365 | ||
366 | static int __devexit sdhci_s3c_remove(struct platform_device *pdev) | 366 | static int __devexit sdhci_s3c_remove(struct platform_device *pdev) |
367 | { | 367 | { |
368 | struct sdhci_host *host = platform_get_drvdata(pdev); | ||
369 | struct sdhci_s3c *sc = sdhci_priv(host); | ||
370 | int ptr; | ||
371 | |||
372 | sdhci_remove_host(host, 1); | ||
373 | |||
374 | for (ptr = 0; ptr < 3; ptr++) { | ||
375 | clk_disable(sc->clk_bus[ptr]); | ||
376 | clk_put(sc->clk_bus[ptr]); | ||
377 | } | ||
378 | clk_disable(sc->clk_io); | ||
379 | clk_put(sc->clk_io); | ||
380 | |||
381 | iounmap(host->ioaddr); | ||
382 | release_resource(sc->ioarea); | ||
383 | kfree(sc->ioarea); | ||
384 | |||
385 | sdhci_free_host(host); | ||
386 | platform_set_drvdata(pdev, NULL); | ||
387 | |||
368 | return 0; | 388 | return 0; |
369 | } | 389 | } |
370 | 390 | ||
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 82e94389824e..0d76b169482f 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -623,8 +623,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
623 | else | 623 | else |
624 | host->buf_start = column + mtd->writesize; | 624 | host->buf_start = column + mtd->writesize; |
625 | 625 | ||
626 | if (mtd->writesize > 512) | 626 | command = NAND_CMD_READ0; /* only READ0 is valid */ |
627 | command = NAND_CMD_READ0; /* only READ0 is valid */ | ||
628 | 627 | ||
629 | send_cmd(host, command, false); | 628 | send_cmd(host, command, false); |
630 | mxc_do_addr_cycle(mtd, column, page_addr); | 629 | mxc_do_addr_cycle(mtd, column, page_addr); |
@@ -639,31 +638,11 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
639 | break; | 638 | break; |
640 | 639 | ||
641 | case NAND_CMD_SEQIN: | 640 | case NAND_CMD_SEQIN: |
642 | if (column >= mtd->writesize) { | 641 | if (column >= mtd->writesize) |
643 | /* | 642 | /* call ourself to read a page */ |
644 | * FIXME: before send SEQIN command for write OOB, | 643 | mxc_nand_command(mtd, NAND_CMD_READ0, 0, page_addr); |
645 | * We must read one page out. | ||
646 | * For K9F1GXX has no READ1 command to set current HW | ||
647 | * pointer to spare area, we must write the whole page | ||
648 | * including OOB together. | ||
649 | */ | ||
650 | if (mtd->writesize > 512) | ||
651 | /* call ourself to read a page */ | ||
652 | mxc_nand_command(mtd, NAND_CMD_READ0, 0, | ||
653 | page_addr); | ||
654 | |||
655 | host->buf_start = column; | ||
656 | |||
657 | /* Set program pointer to spare region */ | ||
658 | if (mtd->writesize == 512) | ||
659 | send_cmd(host, NAND_CMD_READOOB, false); | ||
660 | } else { | ||
661 | host->buf_start = column; | ||
662 | 644 | ||
663 | /* Set program pointer to page start */ | 645 | host->buf_start = column; |
664 | if (mtd->writesize == 512) | ||
665 | send_cmd(host, NAND_CMD_READ0, false); | ||
666 | } | ||
667 | 646 | ||
668 | send_cmd(host, command, false); | 647 | send_cmd(host, command, false); |
669 | mxc_do_addr_cycle(mtd, column, page_addr); | 648 | mxc_do_addr_cycle(mtd, column, page_addr); |
@@ -853,6 +832,8 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
853 | parse_mtd_partitions(mtd, part_probes, &host->parts, 0); | 832 | parse_mtd_partitions(mtd, part_probes, &host->parts, 0); |
854 | if (nr_parts > 0) | 833 | if (nr_parts > 0) |
855 | add_mtd_partitions(mtd, host->parts, nr_parts); | 834 | add_mtd_partitions(mtd, host->parts, nr_parts); |
835 | else if (pdata->parts) | ||
836 | add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); | ||
856 | else | 837 | else |
857 | #endif | 838 | #endif |
858 | { | 839 | { |
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 13b05cb33b08..78ae89488a4f 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
@@ -593,6 +593,7 @@ static int attach_by_scanning(struct ubi_device *ubi) | |||
593 | ubi->good_peb_count = ubi->peb_count - ubi->bad_peb_count; | 593 | ubi->good_peb_count = ubi->peb_count - ubi->bad_peb_count; |
594 | ubi->max_ec = si->max_ec; | 594 | ubi->max_ec = si->max_ec; |
595 | ubi->mean_ec = si->mean_ec; | 595 | ubi->mean_ec = si->mean_ec; |
596 | ubi_msg("max. sequence number: %llu", si->max_sqnum); | ||
596 | 597 | ||
597 | err = ubi_read_volume_table(ubi, si); | 598 | err = ubi_read_volume_table(ubi, si); |
598 | if (err) | 599 | if (err) |
@@ -981,7 +982,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) | |||
981 | ubi_msg("number of PEBs reserved for bad PEB handling: %d", | 982 | ubi_msg("number of PEBs reserved for bad PEB handling: %d", |
982 | ubi->beb_rsvd_pebs); | 983 | ubi->beb_rsvd_pebs); |
983 | ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec); | 984 | ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec); |
984 | ubi_msg("image sequence number: %d", ubi->image_seq); | 985 | ubi_msg("image sequence number: %d", ubi->image_seq); |
985 | 986 | ||
986 | /* | 987 | /* |
987 | * The below lock makes sure we do not race with 'ubi_thread()' which | 988 | * The below lock makes sure we do not race with 'ubi_thread()' which |
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index 9f87c99189a9..fe74749e0dae 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c | |||
@@ -418,7 +418,8 @@ retry: | |||
418 | * may try to recover data. FIXME: but this is | 418 | * may try to recover data. FIXME: but this is |
419 | * not implemented. | 419 | * not implemented. |
420 | */ | 420 | */ |
421 | if (err == UBI_IO_BAD_VID_HDR) { | 421 | if (err == UBI_IO_BAD_HDR_READ || |
422 | err == UBI_IO_BAD_HDR) { | ||
422 | ubi_warn("corrupted VID header at PEB " | 423 | ubi_warn("corrupted VID header at PEB " |
423 | "%d, LEB %d:%d", pnum, vol_id, | 424 | "%d, LEB %d:%d", pnum, vol_id, |
424 | lnum); | 425 | lnum); |
@@ -961,8 +962,8 @@ write_error: | |||
961 | */ | 962 | */ |
962 | static int is_error_sane(int err) | 963 | static int is_error_sane(int err) |
963 | { | 964 | { |
964 | if (err == -EIO || err == -ENOMEM || err == UBI_IO_BAD_VID_HDR || | 965 | if (err == -EIO || err == -ENOMEM || err == UBI_IO_BAD_HDR || |
965 | err == -ETIMEDOUT) | 966 | err == UBI_IO_BAD_HDR_READ || err == -ETIMEDOUT) |
966 | return 0; | 967 | return 0; |
967 | return 1; | 968 | return 1; |
968 | } | 969 | } |
@@ -1165,6 +1166,44 @@ out_unlock_leb: | |||
1165 | } | 1166 | } |
1166 | 1167 | ||
1167 | /** | 1168 | /** |
1169 | * print_rsvd_warning - warn about not having enough reserved PEBs. | ||
1170 | * @ubi: UBI device description object | ||
1171 | * | ||
1172 | * This is a helper function for 'ubi_eba_init_scan()' which is called when UBI | ||
1173 | * cannot reserve enough PEBs for bad block handling. This function makes a | ||
1174 | * decision whether we have to print a warning or not. The algorithm is as | ||
1175 | * follows: | ||
1176 | * o if this is a new UBI image, then just print the warning | ||
1177 | * o if this is an UBI image which has already been used for some time, print | ||
1178 | * a warning only if we can reserve less than 10% of the expected amount of | ||
1179 | * the reserved PEB. | ||
1180 | * | ||
1181 | * The idea is that when UBI is used, PEBs become bad, and the reserved pool | ||
1182 | * of PEBs becomes smaller, which is normal and we do not want to scare users | ||
1183 | * with a warning every time they attach the MTD device. This was an issue | ||
1184 | * reported by real users. | ||
1185 | */ | ||
1186 | static void print_rsvd_warning(struct ubi_device *ubi, | ||
1187 | struct ubi_scan_info *si) | ||
1188 | { | ||
1189 | /* | ||
1190 | * The 1 << 18 (256KiB) number is picked randomly, just a reasonably | ||
1191 | * large number to distinguish between newly flashed and used images. | ||
1192 | */ | ||
1193 | if (si->max_sqnum > (1 << 18)) { | ||
1194 | int min = ubi->beb_rsvd_level / 10; | ||
1195 | |||
1196 | if (!min) | ||
1197 | min = 1; | ||
1198 | if (ubi->beb_rsvd_pebs > min) | ||
1199 | return; | ||
1200 | } | ||
1201 | |||
1202 | ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d," | ||
1203 | " need %d", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); | ||
1204 | } | ||
1205 | |||
1206 | /** | ||
1168 | * ubi_eba_init_scan - initialize the EBA sub-system using scanning information. | 1207 | * ubi_eba_init_scan - initialize the EBA sub-system using scanning information. |
1169 | * @ubi: UBI device description object | 1208 | * @ubi: UBI device description object |
1170 | * @si: scanning information | 1209 | * @si: scanning information |
@@ -1236,9 +1275,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si) | |||
1236 | if (ubi->avail_pebs < ubi->beb_rsvd_level) { | 1275 | if (ubi->avail_pebs < ubi->beb_rsvd_level) { |
1237 | /* No enough free physical eraseblocks */ | 1276 | /* No enough free physical eraseblocks */ |
1238 | ubi->beb_rsvd_pebs = ubi->avail_pebs; | 1277 | ubi->beb_rsvd_pebs = ubi->avail_pebs; |
1239 | ubi_warn("cannot reserve enough PEBs for bad PEB " | 1278 | print_rsvd_warning(ubi, si); |
1240 | "handling, reserved %d, need %d", | ||
1241 | ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); | ||
1242 | } else | 1279 | } else |
1243 | ubi->beb_rsvd_pebs = ubi->beb_rsvd_level; | 1280 | ubi->beb_rsvd_pebs = ubi->beb_rsvd_level; |
1244 | 1281 | ||
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 4b979e34b159..332f992f13d9 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
@@ -150,6 +150,8 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset, | |||
150 | retry: | 150 | retry: |
151 | err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf); | 151 | err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf); |
152 | if (err) { | 152 | if (err) { |
153 | const char *errstr = (err == -EBADMSG) ? " (ECC error)" : ""; | ||
154 | |||
153 | if (err == -EUCLEAN) { | 155 | if (err == -EUCLEAN) { |
154 | /* | 156 | /* |
155 | * -EUCLEAN is reported if there was a bit-flip which | 157 | * -EUCLEAN is reported if there was a bit-flip which |
@@ -165,15 +167,15 @@ retry: | |||
165 | } | 167 | } |
166 | 168 | ||
167 | if (read != len && retries++ < UBI_IO_RETRIES) { | 169 | if (read != len && retries++ < UBI_IO_RETRIES) { |
168 | dbg_io("error %d while reading %d bytes from PEB %d:%d," | 170 | dbg_io("error %d%s while reading %d bytes from PEB %d:%d," |
169 | " read only %zd bytes, retry", | 171 | " read only %zd bytes, retry", |
170 | err, len, pnum, offset, read); | 172 | err, errstr, len, pnum, offset, read); |
171 | yield(); | 173 | yield(); |
172 | goto retry; | 174 | goto retry; |
173 | } | 175 | } |
174 | 176 | ||
175 | ubi_err("error %d while reading %d bytes from PEB %d:%d, " | 177 | ubi_err("error %d%s while reading %d bytes from PEB %d:%d, " |
176 | "read %zd bytes", err, len, pnum, offset, read); | 178 | "read %zd bytes", err, errstr, len, pnum, offset, read); |
177 | ubi_dbg_dump_stack(); | 179 | ubi_dbg_dump_stack(); |
178 | 180 | ||
179 | /* | 181 | /* |
@@ -515,7 +517,7 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum) | |||
515 | * In this case we probably anyway have garbage in this PEB. | 517 | * In this case we probably anyway have garbage in this PEB. |
516 | */ | 518 | */ |
517 | err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); | 519 | err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); |
518 | if (err1 == UBI_IO_BAD_VID_HDR) | 520 | if (err1 == UBI_IO_BAD_HDR_READ || err1 == UBI_IO_BAD_HDR) |
519 | /* | 521 | /* |
520 | * The VID header is corrupted, so we can safely erase this | 522 | * The VID header is corrupted, so we can safely erase this |
521 | * PEB and not afraid that it will be treated as a valid PEB in | 523 | * PEB and not afraid that it will be treated as a valid PEB in |
@@ -709,7 +711,7 @@ bad: | |||
709 | * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected | 711 | * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected |
710 | * and corrected by the flash driver; this is harmless but may indicate that | 712 | * and corrected by the flash driver; this is harmless but may indicate that |
711 | * this eraseblock may become bad soon (but may be not); | 713 | * this eraseblock may become bad soon (but may be not); |
712 | * o %UBI_IO_BAD_EC_HDR if the erase counter header is corrupted (a CRC error); | 714 | * o %UBI_IO_BAD_HDR if the erase counter header is corrupted (a CRC error); |
713 | * o %UBI_IO_PEB_EMPTY if the physical eraseblock is empty; | 715 | * o %UBI_IO_PEB_EMPTY if the physical eraseblock is empty; |
714 | * o a negative error code in case of failure. | 716 | * o a negative error code in case of failure. |
715 | */ | 717 | */ |
@@ -736,23 +738,21 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum, | |||
736 | * header is still OK, we just report this as there was a | 738 | * header is still OK, we just report this as there was a |
737 | * bit-flip. | 739 | * bit-flip. |
738 | */ | 740 | */ |
739 | read_err = err; | 741 | if (err == -EBADMSG) |
742 | read_err = UBI_IO_BAD_HDR_READ; | ||
740 | } | 743 | } |
741 | 744 | ||
742 | magic = be32_to_cpu(ec_hdr->magic); | 745 | magic = be32_to_cpu(ec_hdr->magic); |
743 | if (magic != UBI_EC_HDR_MAGIC) { | 746 | if (magic != UBI_EC_HDR_MAGIC) { |
747 | if (read_err) | ||
748 | return read_err; | ||
749 | |||
744 | /* | 750 | /* |
745 | * The magic field is wrong. Let's check if we have read all | 751 | * The magic field is wrong. Let's check if we have read all |
746 | * 0xFF. If yes, this physical eraseblock is assumed to be | 752 | * 0xFF. If yes, this physical eraseblock is assumed to be |
747 | * empty. | 753 | * empty. |
748 | * | ||
749 | * But if there was a read error, we do not test it for all | ||
750 | * 0xFFs. Even if it does contain all 0xFFs, this error | ||
751 | * indicates that something is still wrong with this physical | ||
752 | * eraseblock and we anyway cannot treat it as empty. | ||
753 | */ | 754 | */ |
754 | if (read_err != -EBADMSG && | 755 | if (check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { |
755 | check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { | ||
756 | /* The physical eraseblock is supposedly empty */ | 756 | /* The physical eraseblock is supposedly empty */ |
757 | if (verbose) | 757 | if (verbose) |
758 | ubi_warn("no EC header found at PEB %d, " | 758 | ubi_warn("no EC header found at PEB %d, " |
@@ -774,7 +774,7 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum, | |||
774 | } else if (UBI_IO_DEBUG) | 774 | } else if (UBI_IO_DEBUG) |
775 | dbg_msg("bad magic number at PEB %d: %08x instead of " | 775 | dbg_msg("bad magic number at PEB %d: %08x instead of " |
776 | "%08x", pnum, magic, UBI_EC_HDR_MAGIC); | 776 | "%08x", pnum, magic, UBI_EC_HDR_MAGIC); |
777 | return UBI_IO_BAD_EC_HDR; | 777 | return UBI_IO_BAD_HDR; |
778 | } | 778 | } |
779 | 779 | ||
780 | crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); | 780 | crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); |
@@ -788,7 +788,7 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum, | |||
788 | } else if (UBI_IO_DEBUG) | 788 | } else if (UBI_IO_DEBUG) |
789 | dbg_msg("bad EC header CRC at PEB %d, calculated " | 789 | dbg_msg("bad EC header CRC at PEB %d, calculated " |
790 | "%#08x, read %#08x", pnum, crc, hdr_crc); | 790 | "%#08x, read %#08x", pnum, crc, hdr_crc); |
791 | return UBI_IO_BAD_EC_HDR; | 791 | return read_err ?: UBI_IO_BAD_HDR; |
792 | } | 792 | } |
793 | 793 | ||
794 | /* And of course validate what has just been read from the media */ | 794 | /* And of course validate what has just been read from the media */ |
@@ -798,6 +798,10 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum, | |||
798 | return -EINVAL; | 798 | return -EINVAL; |
799 | } | 799 | } |
800 | 800 | ||
801 | /* | ||
802 | * If there was %-EBADMSG, but the header CRC is still OK, report about | ||
803 | * a bit-flip to force scrubbing on this PEB. | ||
804 | */ | ||
801 | return read_err ? UBI_IO_BITFLIPS : 0; | 805 | return read_err ? UBI_IO_BITFLIPS : 0; |
802 | } | 806 | } |
803 | 807 | ||
@@ -977,7 +981,7 @@ bad: | |||
977 | * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected | 981 | * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected |
978 | * and corrected by the flash driver; this is harmless but may indicate that | 982 | * and corrected by the flash driver; this is harmless but may indicate that |
979 | * this eraseblock may become bad soon; | 983 | * this eraseblock may become bad soon; |
980 | * o %UBI_IO_BAD_VID_HDR if the volume identifier header is corrupted (a CRC | 984 | * o %UBI_IO_BAD_HDR if the volume identifier header is corrupted (a CRC |
981 | * error detected); | 985 | * error detected); |
982 | * o %UBI_IO_PEB_FREE if the physical eraseblock is free (i.e., there is no VID | 986 | * o %UBI_IO_PEB_FREE if the physical eraseblock is free (i.e., there is no VID |
983 | * header there); | 987 | * header there); |
@@ -1008,22 +1012,20 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum, | |||
1008 | * CRC check-sum and we will identify this. If the VID header is | 1012 | * CRC check-sum and we will identify this. If the VID header is |
1009 | * still OK, we just report this as there was a bit-flip. | 1013 | * still OK, we just report this as there was a bit-flip. |
1010 | */ | 1014 | */ |
1011 | read_err = err; | 1015 | if (err == -EBADMSG) |
1016 | read_err = UBI_IO_BAD_HDR_READ; | ||
1012 | } | 1017 | } |
1013 | 1018 | ||
1014 | magic = be32_to_cpu(vid_hdr->magic); | 1019 | magic = be32_to_cpu(vid_hdr->magic); |
1015 | if (magic != UBI_VID_HDR_MAGIC) { | 1020 | if (magic != UBI_VID_HDR_MAGIC) { |
1021 | if (read_err) | ||
1022 | return read_err; | ||
1023 | |||
1016 | /* | 1024 | /* |
1017 | * If we have read all 0xFF bytes, the VID header probably does | 1025 | * If we have read all 0xFF bytes, the VID header probably does |
1018 | * not exist and the physical eraseblock is assumed to be free. | 1026 | * not exist and the physical eraseblock is assumed to be free. |
1019 | * | ||
1020 | * But if there was a read error, we do not test the data for | ||
1021 | * 0xFFs. Even if it does contain all 0xFFs, this error | ||
1022 | * indicates that something is still wrong with this physical | ||
1023 | * eraseblock and it cannot be regarded as free. | ||
1024 | */ | 1027 | */ |
1025 | if (read_err != -EBADMSG && | 1028 | if (check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { |
1026 | check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { | ||
1027 | /* The physical eraseblock is supposedly free */ | 1029 | /* The physical eraseblock is supposedly free */ |
1028 | if (verbose) | 1030 | if (verbose) |
1029 | ubi_warn("no VID header found at PEB %d, " | 1031 | ubi_warn("no VID header found at PEB %d, " |
@@ -1045,7 +1047,7 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum, | |||
1045 | } else if (UBI_IO_DEBUG) | 1047 | } else if (UBI_IO_DEBUG) |
1046 | dbg_msg("bad magic number at PEB %d: %08x instead of " | 1048 | dbg_msg("bad magic number at PEB %d: %08x instead of " |
1047 | "%08x", pnum, magic, UBI_VID_HDR_MAGIC); | 1049 | "%08x", pnum, magic, UBI_VID_HDR_MAGIC); |
1048 | return UBI_IO_BAD_VID_HDR; | 1050 | return UBI_IO_BAD_HDR; |
1049 | } | 1051 | } |
1050 | 1052 | ||
1051 | crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC); | 1053 | crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC); |
@@ -1059,7 +1061,7 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum, | |||
1059 | } else if (UBI_IO_DEBUG) | 1061 | } else if (UBI_IO_DEBUG) |
1060 | dbg_msg("bad CRC at PEB %d, calculated %#08x, " | 1062 | dbg_msg("bad CRC at PEB %d, calculated %#08x, " |
1061 | "read %#08x", pnum, crc, hdr_crc); | 1063 | "read %#08x", pnum, crc, hdr_crc); |
1062 | return UBI_IO_BAD_VID_HDR; | 1064 | return read_err ?: UBI_IO_BAD_HDR; |
1063 | } | 1065 | } |
1064 | 1066 | ||
1065 | /* Validate the VID header that we have just read */ | 1067 | /* Validate the VID header that we have just read */ |
@@ -1069,6 +1071,10 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum, | |||
1069 | return -EINVAL; | 1071 | return -EINVAL; |
1070 | } | 1072 | } |
1071 | 1073 | ||
1074 | /* | ||
1075 | * If there was a read error (%-EBADMSG), but the header CRC is still | ||
1076 | * OK, report about a bit-flip to force scrubbing on this PEB. | ||
1077 | */ | ||
1072 | return read_err ? UBI_IO_BITFLIPS : 0; | 1078 | return read_err ? UBI_IO_BITFLIPS : 0; |
1073 | } | 1079 | } |
1074 | 1080 | ||
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index aed19f33b8f3..372a15ac9995 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/slab.h> | 44 | #include <linux/slab.h> |
45 | #include <linux/crc32.h> | 45 | #include <linux/crc32.h> |
46 | #include <linux/math64.h> | 46 | #include <linux/math64.h> |
47 | #include <linux/random.h> | ||
47 | #include "ubi.h" | 48 | #include "ubi.h" |
48 | 49 | ||
49 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID | 50 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
@@ -72,16 +73,19 @@ static int add_to_list(struct ubi_scan_info *si, int pnum, int ec, | |||
72 | { | 73 | { |
73 | struct ubi_scan_leb *seb; | 74 | struct ubi_scan_leb *seb; |
74 | 75 | ||
75 | if (list == &si->free) | 76 | if (list == &si->free) { |
76 | dbg_bld("add to free: PEB %d, EC %d", pnum, ec); | 77 | dbg_bld("add to free: PEB %d, EC %d", pnum, ec); |
77 | else if (list == &si->erase) | 78 | si->free_peb_count += 1; |
79 | } else if (list == &si->erase) { | ||
78 | dbg_bld("add to erase: PEB %d, EC %d", pnum, ec); | 80 | dbg_bld("add to erase: PEB %d, EC %d", pnum, ec); |
79 | else if (list == &si->corr) { | 81 | si->erase_peb_count += 1; |
82 | } else if (list == &si->corr) { | ||
80 | dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); | 83 | dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); |
81 | si->corr_count += 1; | 84 | si->corr_peb_count += 1; |
82 | } else if (list == &si->alien) | 85 | } else if (list == &si->alien) { |
83 | dbg_bld("add to alien: PEB %d, EC %d", pnum, ec); | 86 | dbg_bld("add to alien: PEB %d, EC %d", pnum, ec); |
84 | else | 87 | si->alien_peb_count += 1; |
88 | } else | ||
85 | BUG(); | 89 | BUG(); |
86 | 90 | ||
87 | seb = kmalloc(sizeof(struct ubi_scan_leb), GFP_KERNEL); | 91 | seb = kmalloc(sizeof(struct ubi_scan_leb), GFP_KERNEL); |
@@ -517,6 +521,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
517 | sv->leb_count += 1; | 521 | sv->leb_count += 1; |
518 | rb_link_node(&seb->u.rb, parent, p); | 522 | rb_link_node(&seb->u.rb, parent, p); |
519 | rb_insert_color(&seb->u.rb, &sv->root); | 523 | rb_insert_color(&seb->u.rb, &sv->root); |
524 | si->used_peb_count += 1; | ||
520 | return 0; | 525 | return 0; |
521 | } | 526 | } |
522 | 527 | ||
@@ -745,19 +750,17 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
745 | bitflips = 1; | 750 | bitflips = 1; |
746 | else if (err == UBI_IO_PEB_EMPTY) | 751 | else if (err == UBI_IO_PEB_EMPTY) |
747 | return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase); | 752 | return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase); |
748 | else if (err == UBI_IO_BAD_EC_HDR) { | 753 | else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR) { |
749 | /* | 754 | /* |
750 | * We have to also look at the VID header, possibly it is not | 755 | * We have to also look at the VID header, possibly it is not |
751 | * corrupted. Set %bitflips flag in order to make this PEB be | 756 | * corrupted. Set %bitflips flag in order to make this PEB be |
752 | * moved and EC be re-created. | 757 | * moved and EC be re-created. |
753 | */ | 758 | */ |
754 | ec_corr = 1; | 759 | ec_corr = err; |
755 | ec = UBI_SCAN_UNKNOWN_EC; | 760 | ec = UBI_SCAN_UNKNOWN_EC; |
756 | bitflips = 1; | 761 | bitflips = 1; |
757 | } | 762 | } |
758 | 763 | ||
759 | si->is_empty = 0; | ||
760 | |||
761 | if (!ec_corr) { | 764 | if (!ec_corr) { |
762 | int image_seq; | 765 | int image_seq; |
763 | 766 | ||
@@ -813,9 +816,12 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
813 | return err; | 816 | return err; |
814 | else if (err == UBI_IO_BITFLIPS) | 817 | else if (err == UBI_IO_BITFLIPS) |
815 | bitflips = 1; | 818 | bitflips = 1; |
816 | else if (err == UBI_IO_BAD_VID_HDR || | 819 | else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR || |
817 | (err == UBI_IO_PEB_FREE && ec_corr)) { | 820 | (err == UBI_IO_PEB_FREE && ec_corr)) { |
818 | /* VID header is corrupted */ | 821 | /* VID header is corrupted */ |
822 | if (err == UBI_IO_BAD_HDR_READ || | ||
823 | ec_corr == UBI_IO_BAD_HDR_READ) | ||
824 | si->read_err_count += 1; | ||
819 | err = add_to_list(si, pnum, ec, &si->corr); | 825 | err = add_to_list(si, pnum, ec, &si->corr); |
820 | if (err) | 826 | if (err) |
821 | return err; | 827 | return err; |
@@ -836,11 +842,11 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
836 | switch (vidh->compat) { | 842 | switch (vidh->compat) { |
837 | case UBI_COMPAT_DELETE: | 843 | case UBI_COMPAT_DELETE: |
838 | ubi_msg("\"delete\" compatible internal volume %d:%d" | 844 | ubi_msg("\"delete\" compatible internal volume %d:%d" |
839 | " found, remove it", vol_id, lnum); | 845 | " found, will remove it", vol_id, lnum); |
840 | err = add_to_list(si, pnum, ec, &si->corr); | 846 | err = add_to_list(si, pnum, ec, &si->corr); |
841 | if (err) | 847 | if (err) |
842 | return err; | 848 | return err; |
843 | break; | 849 | return 0; |
844 | 850 | ||
845 | case UBI_COMPAT_RO: | 851 | case UBI_COMPAT_RO: |
846 | ubi_msg("read-only compatible internal volume %d:%d" | 852 | ubi_msg("read-only compatible internal volume %d:%d" |
@@ -855,7 +861,6 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
855 | err = add_to_list(si, pnum, ec, &si->alien); | 861 | err = add_to_list(si, pnum, ec, &si->alien); |
856 | if (err) | 862 | if (err) |
857 | return err; | 863 | return err; |
858 | si->alien_peb_count += 1; | ||
859 | return 0; | 864 | return 0; |
860 | 865 | ||
861 | case UBI_COMPAT_REJECT: | 866 | case UBI_COMPAT_REJECT: |
@@ -886,6 +891,85 @@ adjust_mean_ec: | |||
886 | } | 891 | } |
887 | 892 | ||
888 | /** | 893 | /** |
894 | * check_what_we_have - check what PEB were found by scanning. | ||
895 | * @ubi: UBI device description object | ||
896 | * @si: scanning information | ||
897 | * | ||
898 | * This is a helper function which takes a look what PEBs were found by | ||
899 | * scanning, and decides whether the flash is empty and should be formatted and | ||
900 | * whether there are too many corrupted PEBs and we should not attach this | ||
901 | * MTD device. Returns zero if we should proceed with attaching the MTD device, | ||
902 | * and %-EINVAL if we should not. | ||
903 | */ | ||
904 | static int check_what_we_have(struct ubi_device *ubi, struct ubi_scan_info *si) | ||
905 | { | ||
906 | struct ubi_scan_leb *seb; | ||
907 | int max_corr; | ||
908 | |||
909 | max_corr = ubi->peb_count - si->bad_peb_count - si->alien_peb_count; | ||
910 | max_corr = max_corr / 20 ?: 8; | ||
911 | |||
912 | /* | ||
913 | * Few corrupted PEBs are not a problem and may be just a result of | ||
914 | * unclean reboots. However, many of them may indicate some problems | ||
915 | * with the flash HW or driver. | ||
916 | */ | ||
917 | if (si->corr_peb_count >= 8) { | ||
918 | ubi_warn("%d PEBs are corrupted", si->corr_peb_count); | ||
919 | printk(KERN_WARNING "corrupted PEBs are:"); | ||
920 | list_for_each_entry(seb, &si->corr, u.list) | ||
921 | printk(KERN_CONT " %d", seb->pnum); | ||
922 | printk(KERN_CONT "\n"); | ||
923 | |||
924 | /* | ||
925 | * If too many PEBs are corrupted, we refuse attaching, | ||
926 | * otherwise, only print a warning. | ||
927 | */ | ||
928 | if (si->corr_peb_count >= max_corr) { | ||
929 | ubi_err("too many corrupted PEBs, refusing this device"); | ||
930 | return -EINVAL; | ||
931 | } | ||
932 | } | ||
933 | |||
934 | if (si->free_peb_count + si->used_peb_count + | ||
935 | si->alien_peb_count == 0) { | ||
936 | /* No UBI-formatted eraseblocks were found */ | ||
937 | if (si->corr_peb_count == si->read_err_count && | ||
938 | si->corr_peb_count < 8) { | ||
939 | /* No or just few corrupted PEBs, and all of them had a | ||
940 | * read error. We assume that those are bad PEBs, which | ||
941 | * were just not marked as bad so far. | ||
942 | * | ||
943 | * This piece of code basically tries to distinguish | ||
944 | * between the following 2 situations: | ||
945 | * | ||
946 | * 1. Flash is empty, but there are few bad PEBs, which | ||
947 | * are not marked as bad so far, and which were read | ||
948 | * with error. We want to go ahead and format this | ||
949 | * flash. While formating, the faulty PEBs will | ||
950 | * probably be marked as bad. | ||
951 | * | ||
952 | * 2. Flash probably contains non-UBI data and we do | ||
953 | * not want to format it and destroy possibly needed | ||
954 | * data (e.g., consider the case when the bootloader | ||
955 | * MTD partition was accidentally fed to UBI). | ||
956 | */ | ||
957 | si->is_empty = 1; | ||
958 | ubi_msg("empty MTD device detected"); | ||
959 | get_random_bytes(&ubi->image_seq, sizeof(ubi->image_seq)); | ||
960 | } else { | ||
961 | ubi_err("MTD device possibly contains non-UBI data, " | ||
962 | "refusing it"); | ||
963 | return -EINVAL; | ||
964 | } | ||
965 | } | ||
966 | |||
967 | if (si->corr_peb_count > 0) | ||
968 | ubi_msg("corrupted PEBs will be formatted"); | ||
969 | return 0; | ||
970 | } | ||
971 | |||
972 | /** | ||
889 | * ubi_scan - scan an MTD device. | 973 | * ubi_scan - scan an MTD device. |
890 | * @ubi: UBI device description object | 974 | * @ubi: UBI device description object |
891 | * | 975 | * |
@@ -909,7 +993,6 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) | |||
909 | INIT_LIST_HEAD(&si->erase); | 993 | INIT_LIST_HEAD(&si->erase); |
910 | INIT_LIST_HEAD(&si->alien); | 994 | INIT_LIST_HEAD(&si->alien); |
911 | si->volumes = RB_ROOT; | 995 | si->volumes = RB_ROOT; |
912 | si->is_empty = 1; | ||
913 | 996 | ||
914 | err = -ENOMEM; | 997 | err = -ENOMEM; |
915 | ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); | 998 | ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); |
@@ -935,21 +1018,9 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) | |||
935 | if (si->ec_count) | 1018 | if (si->ec_count) |
936 | si->mean_ec = div_u64(si->ec_sum, si->ec_count); | 1019 | si->mean_ec = div_u64(si->ec_sum, si->ec_count); |
937 | 1020 | ||
938 | if (si->is_empty) | 1021 | err = check_what_we_have(ubi, si); |
939 | ubi_msg("empty MTD device detected"); | 1022 | if (err) |
940 | 1023 | goto out_vidh; | |
941 | /* | ||
942 | * Few corrupted PEBs are not a problem and may be just a result of | ||
943 | * unclean reboots. However, many of them may indicate some problems | ||
944 | * with the flash HW or driver. Print a warning in this case. | ||
945 | */ | ||
946 | if (si->corr_count >= 8 || si->corr_count >= ubi->peb_count / 4) { | ||
947 | ubi_warn("%d PEBs are corrupted", si->corr_count); | ||
948 | printk(KERN_WARNING "corrupted PEBs are:"); | ||
949 | list_for_each_entry(seb, &si->corr, u.list) | ||
950 | printk(KERN_CONT " %d", seb->pnum); | ||
951 | printk(KERN_CONT "\n"); | ||
952 | } | ||
953 | 1024 | ||
954 | /* | 1025 | /* |
955 | * In case of unknown erase counter we use the mean erase counter | 1026 | * In case of unknown erase counter we use the mean erase counter |
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h index ff179ad7ca55..2576a8d1532b 100644 --- a/drivers/mtd/ubi/scan.h +++ b/drivers/mtd/ubi/scan.h | |||
@@ -91,10 +91,16 @@ struct ubi_scan_volume { | |||
91 | * @erase: list of physical eraseblocks which have to be erased | 91 | * @erase: list of physical eraseblocks which have to be erased |
92 | * @alien: list of physical eraseblocks which should not be used by UBI (e.g., | 92 | * @alien: list of physical eraseblocks which should not be used by UBI (e.g., |
93 | * those belonging to "preserve"-compatible internal volumes) | 93 | * those belonging to "preserve"-compatible internal volumes) |
94 | * @used_peb_count: count of used PEBs | ||
95 | * @corr_peb_count: count of PEBs in the @corr list | ||
96 | * @read_err_count: count of PEBs read with error (%UBI_IO_BAD_HDR_READ was | ||
97 | * returned) | ||
98 | * @free_peb_count: count of PEBs in the @free list | ||
99 | * @erase_peb_count: count of PEBs in the @erase list | ||
100 | * @alien_peb_count: count of PEBs in the @alien list | ||
94 | * @bad_peb_count: count of bad physical eraseblocks | 101 | * @bad_peb_count: count of bad physical eraseblocks |
95 | * @vols_found: number of volumes found during scanning | 102 | * @vols_found: number of volumes found during scanning |
96 | * @highest_vol_id: highest volume ID | 103 | * @highest_vol_id: highest volume ID |
97 | * @alien_peb_count: count of physical eraseblocks in the @alien list | ||
98 | * @is_empty: flag indicating whether the MTD device is empty or not | 104 | * @is_empty: flag indicating whether the MTD device is empty or not |
99 | * @min_ec: lowest erase counter value | 105 | * @min_ec: lowest erase counter value |
100 | * @max_ec: highest erase counter value | 106 | * @max_ec: highest erase counter value |
@@ -102,7 +108,6 @@ struct ubi_scan_volume { | |||
102 | * @mean_ec: mean erase counter value | 108 | * @mean_ec: mean erase counter value |
103 | * @ec_sum: a temporary variable used when calculating @mean_ec | 109 | * @ec_sum: a temporary variable used when calculating @mean_ec |
104 | * @ec_count: a temporary variable used when calculating @mean_ec | 110 | * @ec_count: a temporary variable used when calculating @mean_ec |
105 | * @corr_count: count of corrupted PEBs | ||
106 | * | 111 | * |
107 | * This data structure contains the result of scanning and may be used by other | 112 | * This data structure contains the result of scanning and may be used by other |
108 | * UBI sub-systems to build final UBI data structures, further error-recovery | 113 | * UBI sub-systems to build final UBI data structures, further error-recovery |
@@ -114,10 +119,15 @@ struct ubi_scan_info { | |||
114 | struct list_head free; | 119 | struct list_head free; |
115 | struct list_head erase; | 120 | struct list_head erase; |
116 | struct list_head alien; | 121 | struct list_head alien; |
122 | int used_peb_count; | ||
123 | int corr_peb_count; | ||
124 | int read_err_count; | ||
125 | int free_peb_count; | ||
126 | int erase_peb_count; | ||
127 | int alien_peb_count; | ||
117 | int bad_peb_count; | 128 | int bad_peb_count; |
118 | int vols_found; | 129 | int vols_found; |
119 | int highest_vol_id; | 130 | int highest_vol_id; |
120 | int alien_peb_count; | ||
121 | int is_empty; | 131 | int is_empty; |
122 | int min_ec; | 132 | int min_ec; |
123 | int max_ec; | 133 | int max_ec; |
@@ -125,7 +135,6 @@ struct ubi_scan_info { | |||
125 | int mean_ec; | 135 | int mean_ec; |
126 | uint64_t ec_sum; | 136 | uint64_t ec_sum; |
127 | int ec_count; | 137 | int ec_count; |
128 | int corr_count; | ||
129 | }; | 138 | }; |
130 | 139 | ||
131 | struct ubi_device; | 140 | struct ubi_device; |
@@ -135,7 +144,7 @@ struct ubi_vid_hdr; | |||
135 | * ubi_scan_move_to_list - move a PEB from the volume tree to a list. | 144 | * ubi_scan_move_to_list - move a PEB from the volume tree to a list. |
136 | * | 145 | * |
137 | * @sv: volume scanning information | 146 | * @sv: volume scanning information |
138 | * @seb: scanning eraseblock infprmation | 147 | * @seb: scanning eraseblock information |
139 | * @list: the list to move to | 148 | * @list: the list to move to |
140 | */ | 149 | */ |
141 | static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv, | 150 | static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv, |
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index a637f0283add..0359e0cce482 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h | |||
@@ -89,16 +89,16 @@ | |||
89 | * %0xFF bytes | 89 | * %0xFF bytes |
90 | * UBI_IO_PEB_FREE: the physical eraseblock is free, i.e. it contains only a | 90 | * UBI_IO_PEB_FREE: the physical eraseblock is free, i.e. it contains only a |
91 | * valid erase counter header, and the rest are %0xFF bytes | 91 | * valid erase counter header, and the rest are %0xFF bytes |
92 | * UBI_IO_BAD_EC_HDR: the erase counter header is corrupted (bad magic or CRC) | 92 | * UBI_IO_BAD_HDR: the EC or VID header is corrupted (bad magic or CRC) |
93 | * UBI_IO_BAD_VID_HDR: the volume identifier header is corrupted (bad magic or | 93 | * UBI_IO_BAD_HDR_READ: the same as %UBI_IO_BAD_HDR, but also there was a read |
94 | * CRC) | 94 | * error reported by the flash driver |
95 | * UBI_IO_BITFLIPS: bit-flips were detected and corrected | 95 | * UBI_IO_BITFLIPS: bit-flips were detected and corrected |
96 | */ | 96 | */ |
97 | enum { | 97 | enum { |
98 | UBI_IO_PEB_EMPTY = 1, | 98 | UBI_IO_PEB_EMPTY = 1, |
99 | UBI_IO_PEB_FREE, | 99 | UBI_IO_PEB_FREE, |
100 | UBI_IO_BAD_EC_HDR, | 100 | UBI_IO_BAD_HDR, |
101 | UBI_IO_BAD_VID_HDR, | 101 | UBI_IO_BAD_HDR_READ, |
102 | UBI_IO_BITFLIPS | 102 | UBI_IO_BITFLIPS |
103 | }; | 103 | }; |
104 | 104 | ||
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 8bd23687c530..bb0872a63315 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -1062,6 +1062,10 @@ struct bnx2x { | |||
1062 | 1062 | ||
1063 | /* used to synchronize stats collecting */ | 1063 | /* used to synchronize stats collecting */ |
1064 | int stats_state; | 1064 | int stats_state; |
1065 | |||
1066 | /* used for synchronization of concurrent threads statistics handling */ | ||
1067 | spinlock_t stats_lock; | ||
1068 | |||
1065 | /* used by dmae command loader */ | 1069 | /* used by dmae command loader */ |
1066 | struct dmae_command stats_dmae; | 1070 | struct dmae_command stats_dmae; |
1067 | int executer_idx; | 1071 | int executer_idx; |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 57ff5b3bcce6..46167c081727 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -57,8 +57,8 @@ | |||
57 | #include "bnx2x_init_ops.h" | 57 | #include "bnx2x_init_ops.h" |
58 | #include "bnx2x_dump.h" | 58 | #include "bnx2x_dump.h" |
59 | 59 | ||
60 | #define DRV_MODULE_VERSION "1.52.53-1" | 60 | #define DRV_MODULE_VERSION "1.52.53-2" |
61 | #define DRV_MODULE_RELDATE "2010/18/04" | 61 | #define DRV_MODULE_RELDATE "2010/21/07" |
62 | #define BNX2X_BC_VER 0x040200 | 62 | #define BNX2X_BC_VER 0x040200 |
63 | 63 | ||
64 | #include <linux/firmware.h> | 64 | #include <linux/firmware.h> |
@@ -3789,6 +3789,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) | |||
3789 | struct eth_query_ramrod_data ramrod_data = {0}; | 3789 | struct eth_query_ramrod_data ramrod_data = {0}; |
3790 | int i, rc; | 3790 | int i, rc; |
3791 | 3791 | ||
3792 | spin_lock_bh(&bp->stats_lock); | ||
3793 | |||
3792 | ramrod_data.drv_counter = bp->stats_counter++; | 3794 | ramrod_data.drv_counter = bp->stats_counter++; |
3793 | ramrod_data.collect_port = bp->port.pmf ? 1 : 0; | 3795 | ramrod_data.collect_port = bp->port.pmf ? 1 : 0; |
3794 | for_each_queue(bp, i) | 3796 | for_each_queue(bp, i) |
@@ -3802,6 +3804,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) | |||
3802 | bp->spq_left++; | 3804 | bp->spq_left++; |
3803 | bp->stats_pending = 1; | 3805 | bp->stats_pending = 1; |
3804 | } | 3806 | } |
3807 | |||
3808 | spin_unlock_bh(&bp->stats_lock); | ||
3805 | } | 3809 | } |
3806 | } | 3810 | } |
3807 | 3811 | ||
@@ -4367,6 +4371,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
4367 | struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); | 4371 | struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); |
4368 | struct bnx2x_eth_stats *estats = &bp->eth_stats; | 4372 | struct bnx2x_eth_stats *estats = &bp->eth_stats; |
4369 | int i; | 4373 | int i; |
4374 | u16 cur_stats_counter; | ||
4375 | |||
4376 | /* Make sure we use the value of the counter | ||
4377 | * used for sending the last stats ramrod. | ||
4378 | */ | ||
4379 | spin_lock_bh(&bp->stats_lock); | ||
4380 | cur_stats_counter = bp->stats_counter - 1; | ||
4381 | spin_unlock_bh(&bp->stats_lock); | ||
4370 | 4382 | ||
4371 | memcpy(&(fstats->total_bytes_received_hi), | 4383 | memcpy(&(fstats->total_bytes_received_hi), |
4372 | &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), | 4384 | &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), |
@@ -4394,25 +4406,22 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
4394 | u32 diff; | 4406 | u32 diff; |
4395 | 4407 | ||
4396 | /* are storm stats valid? */ | 4408 | /* are storm stats valid? */ |
4397 | if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) != | 4409 | if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) { |
4398 | bp->stats_counter) { | ||
4399 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" | 4410 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" |
4400 | " xstorm counter (0x%x) != stats_counter (0x%x)\n", | 4411 | " xstorm counter (0x%x) != stats_counter (0x%x)\n", |
4401 | i, xclient->stats_counter, bp->stats_counter); | 4412 | i, xclient->stats_counter, cur_stats_counter + 1); |
4402 | return -1; | 4413 | return -1; |
4403 | } | 4414 | } |
4404 | if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) != | 4415 | if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) { |
4405 | bp->stats_counter) { | ||
4406 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" | 4416 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" |
4407 | " tstorm counter (0x%x) != stats_counter (0x%x)\n", | 4417 | " tstorm counter (0x%x) != stats_counter (0x%x)\n", |
4408 | i, tclient->stats_counter, bp->stats_counter); | 4418 | i, tclient->stats_counter, cur_stats_counter + 1); |
4409 | return -2; | 4419 | return -2; |
4410 | } | 4420 | } |
4411 | if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) != | 4421 | if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) { |
4412 | bp->stats_counter) { | ||
4413 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" | 4422 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" |
4414 | " ustorm counter (0x%x) != stats_counter (0x%x)\n", | 4423 | " ustorm counter (0x%x) != stats_counter (0x%x)\n", |
4415 | i, uclient->stats_counter, bp->stats_counter); | 4424 | i, uclient->stats_counter, cur_stats_counter + 1); |
4416 | return -4; | 4425 | return -4; |
4417 | } | 4426 | } |
4418 | 4427 | ||
@@ -4849,16 +4858,18 @@ static const struct { | |||
4849 | 4858 | ||
4850 | static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) | 4859 | static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) |
4851 | { | 4860 | { |
4852 | enum bnx2x_stats_state state = bp->stats_state; | 4861 | enum bnx2x_stats_state state; |
4853 | 4862 | ||
4854 | if (unlikely(bp->panic)) | 4863 | if (unlikely(bp->panic)) |
4855 | return; | 4864 | return; |
4856 | 4865 | ||
4857 | bnx2x_stats_stm[state][event].action(bp); | 4866 | /* Protect a state change flow */ |
4867 | spin_lock_bh(&bp->stats_lock); | ||
4868 | state = bp->stats_state; | ||
4858 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; | 4869 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; |
4870 | spin_unlock_bh(&bp->stats_lock); | ||
4859 | 4871 | ||
4860 | /* Make sure the state has been "changed" */ | 4872 | bnx2x_stats_stm[state][event].action(bp); |
4861 | smp_wmb(); | ||
4862 | 4873 | ||
4863 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) | 4874 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) |
4864 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", | 4875 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", |
@@ -9908,6 +9919,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
9908 | 9919 | ||
9909 | mutex_init(&bp->port.phy_mutex); | 9920 | mutex_init(&bp->port.phy_mutex); |
9910 | mutex_init(&bp->fw_mb_mutex); | 9921 | mutex_init(&bp->fw_mb_mutex); |
9922 | spin_lock_init(&bp->stats_lock); | ||
9911 | #ifdef BCM_CNIC | 9923 | #ifdef BCM_CNIC |
9912 | mutex_init(&bp->cnic_mutex); | 9924 | mutex_init(&bp->cnic_mutex); |
9913 | #endif | 9925 | #endif |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 40fdc41446cc..8d7dfd2f1e90 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -340,7 +340,8 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) | |||
340 | 340 | ||
341 | if ((client_info->assigned) && | 341 | if ((client_info->assigned) && |
342 | (client_info->ip_src == arp->ip_dst) && | 342 | (client_info->ip_src == arp->ip_dst) && |
343 | (client_info->ip_dst == arp->ip_src)) { | 343 | (client_info->ip_dst == arp->ip_src) && |
344 | (compare_ether_addr_64bits(client_info->mac_dst, arp->mac_src))) { | ||
344 | /* update the clients MAC address */ | 345 | /* update the clients MAC address */ |
345 | memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); | 346 | memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); |
346 | client_info->ntt = 1; | 347 | client_info->ntt = 1; |
@@ -821,7 +822,7 @@ static int rlb_initialize(struct bonding *bond) | |||
821 | 822 | ||
822 | /*initialize packet type*/ | 823 | /*initialize packet type*/ |
823 | pk_type->type = cpu_to_be16(ETH_P_ARP); | 824 | pk_type->type = cpu_to_be16(ETH_P_ARP); |
824 | pk_type->dev = NULL; | 825 | pk_type->dev = bond->dev; |
825 | pk_type->func = rlb_arp_recv; | 826 | pk_type->func = rlb_arp_recv; |
826 | 827 | ||
827 | /* register to receive ARPs */ | 828 | /* register to receive ARPs */ |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 5e12462a9d5e..c3d98dde2f86 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -168,7 +168,7 @@ static int arp_ip_count; | |||
168 | static int bond_mode = BOND_MODE_ROUNDROBIN; | 168 | static int bond_mode = BOND_MODE_ROUNDROBIN; |
169 | static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; | 169 | static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; |
170 | static int lacp_fast; | 170 | static int lacp_fast; |
171 | 171 | static int disable_netpoll = 1; | |
172 | 172 | ||
173 | const struct bond_parm_tbl bond_lacp_tbl[] = { | 173 | const struct bond_parm_tbl bond_lacp_tbl[] = { |
174 | { "slow", AD_LACP_SLOW}, | 174 | { "slow", AD_LACP_SLOW}, |
@@ -1742,15 +1742,23 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1742 | bond_set_carrier(bond); | 1742 | bond_set_carrier(bond); |
1743 | 1743 | ||
1744 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1744 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1745 | if (slaves_support_netpoll(bond_dev)) { | 1745 | /* |
1746 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | 1746 | * Netpoll and bonding is broken, make sure it is not initialized |
1747 | if (bond_dev->npinfo) | 1747 | * until it is fixed. |
1748 | slave_dev->npinfo = bond_dev->npinfo; | 1748 | */ |
1749 | } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) { | 1749 | if (disable_netpoll) { |
1750 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; | 1750 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; |
1751 | pr_info("New slave device %s does not support netpoll\n", | 1751 | } else { |
1752 | slave_dev->name); | 1752 | if (slaves_support_netpoll(bond_dev)) { |
1753 | pr_info("Disabling netpoll support for %s\n", bond_dev->name); | 1753 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; |
1754 | if (bond_dev->npinfo) | ||
1755 | slave_dev->npinfo = bond_dev->npinfo; | ||
1756 | } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) { | ||
1757 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; | ||
1758 | pr_info("New slave device %s does not support netpoll\n", | ||
1759 | slave_dev->name); | ||
1760 | pr_info("Disabling netpoll support for %s\n", bond_dev->name); | ||
1761 | } | ||
1754 | } | 1762 | } |
1755 | #endif | 1763 | #endif |
1756 | read_unlock(&bond->lock); | 1764 | read_unlock(&bond->lock); |
@@ -1950,8 +1958,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1950 | 1958 | ||
1951 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1959 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1952 | read_lock_bh(&bond->lock); | 1960 | read_lock_bh(&bond->lock); |
1953 | if (slaves_support_netpoll(bond_dev)) | 1961 | |
1954 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | 1962 | /* Make sure netpoll over stays disabled until fixed. */ |
1963 | if (!disable_netpoll) | ||
1964 | if (slaves_support_netpoll(bond_dev)) | ||
1965 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | ||
1955 | read_unlock_bh(&bond->lock); | 1966 | read_unlock_bh(&bond->lock); |
1956 | if (slave_dev->netdev_ops->ndo_netpoll_cleanup) | 1967 | if (slave_dev->netdev_ops->ndo_netpoll_cleanup) |
1957 | slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev); | 1968 | slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev); |
diff --git a/drivers/net/declance.c b/drivers/net/declance.c index 1d973db27c32..d7de376d7178 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c | |||
@@ -1022,7 +1022,7 @@ static const struct net_device_ops lance_netdev_ops = { | |||
1022 | .ndo_set_mac_address = eth_mac_addr, | 1022 | .ndo_set_mac_address = eth_mac_addr, |
1023 | }; | 1023 | }; |
1024 | 1024 | ||
1025 | static int __init dec_lance_probe(struct device *bdev, const int type) | 1025 | static int __devinit dec_lance_probe(struct device *bdev, const int type) |
1026 | { | 1026 | { |
1027 | static unsigned version_printed; | 1027 | static unsigned version_printed; |
1028 | static const char fmt[] = "declance%d"; | 1028 | static const char fmt[] = "declance%d"; |
@@ -1326,7 +1326,7 @@ static void __exit dec_lance_platform_remove(void) | |||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | #ifdef CONFIG_TC | 1328 | #ifdef CONFIG_TC |
1329 | static int __init dec_lance_tc_probe(struct device *dev); | 1329 | static int __devinit dec_lance_tc_probe(struct device *dev); |
1330 | static int __exit dec_lance_tc_remove(struct device *dev); | 1330 | static int __exit dec_lance_tc_remove(struct device *dev); |
1331 | 1331 | ||
1332 | static const struct tc_device_id dec_lance_tc_table[] = { | 1332 | static const struct tc_device_id dec_lance_tc_table[] = { |
@@ -1345,7 +1345,7 @@ static struct tc_driver dec_lance_tc_driver = { | |||
1345 | }, | 1345 | }, |
1346 | }; | 1346 | }; |
1347 | 1347 | ||
1348 | static int __init dec_lance_tc_probe(struct device *dev) | 1348 | static int __devinit dec_lance_tc_probe(struct device *dev) |
1349 | { | 1349 | { |
1350 | int status = dec_lance_probe(dev, PMAD_LANCE); | 1350 | int status = dec_lance_probe(dev, PMAD_LANCE); |
1351 | if (!status) | 1351 | if (!status) |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 7acb3edc47ef..2602852cc55a 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -677,7 +677,7 @@ static int ibmveth_close(struct net_device *netdev) | |||
677 | if (!adapter->pool_config) | 677 | if (!adapter->pool_config) |
678 | netif_stop_queue(netdev); | 678 | netif_stop_queue(netdev); |
679 | 679 | ||
680 | free_irq(netdev->irq, netdev); | 680 | h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); |
681 | 681 | ||
682 | do { | 682 | do { |
683 | lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); | 683 | lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); |
@@ -689,6 +689,8 @@ static int ibmveth_close(struct net_device *netdev) | |||
689 | lpar_rc); | 689 | lpar_rc); |
690 | } | 690 | } |
691 | 691 | ||
692 | free_irq(netdev->irq, netdev); | ||
693 | |||
692 | adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); | 694 | adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); |
693 | 695 | ||
694 | ibmveth_cleanup(adapter); | 696 | ibmveth_cleanup(adapter); |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 3881918f5382..cea37e0837ff 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1722,6 +1722,15 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1722 | u16 eeprom_apme_mask = IGB_EEPROM_APME; | 1722 | u16 eeprom_apme_mask = IGB_EEPROM_APME; |
1723 | u32 part_num; | 1723 | u32 part_num; |
1724 | 1724 | ||
1725 | /* Catch broken hardware that put the wrong VF device ID in | ||
1726 | * the PCIe SR-IOV capability. | ||
1727 | */ | ||
1728 | if (pdev->is_virtfn) { | ||
1729 | WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", | ||
1730 | pci_name(pdev), pdev->vendor, pdev->device); | ||
1731 | return -EINVAL; | ||
1732 | } | ||
1733 | |||
1725 | err = pci_enable_device_mem(pdev); | 1734 | err = pci_enable_device_mem(pdev); |
1726 | if (err) | 1735 | if (err) |
1727 | return err; | 1736 | return err; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index ce30c62a97f7..74d9b6df3029 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3684,10 +3684,6 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3684 | /* signal that we are down to the interrupt handler */ | 3684 | /* signal that we are down to the interrupt handler */ |
3685 | set_bit(__IXGBE_DOWN, &adapter->state); | 3685 | set_bit(__IXGBE_DOWN, &adapter->state); |
3686 | 3686 | ||
3687 | /* power down the optics */ | ||
3688 | if (hw->phy.multispeed_fiber) | ||
3689 | hw->mac.ops.disable_tx_laser(hw); | ||
3690 | |||
3691 | /* disable receive for all VFs and wait one second */ | 3687 | /* disable receive for all VFs and wait one second */ |
3692 | if (adapter->num_vfs) { | 3688 | if (adapter->num_vfs) { |
3693 | /* ping all the active vfs to let them know we are going down */ | 3689 | /* ping all the active vfs to let them know we are going down */ |
@@ -3742,6 +3738,10 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3742 | (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) & | 3738 | (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) & |
3743 | ~IXGBE_DMATXCTL_TE)); | 3739 | ~IXGBE_DMATXCTL_TE)); |
3744 | 3740 | ||
3741 | /* power down the optics */ | ||
3742 | if (hw->phy.multispeed_fiber) | ||
3743 | hw->mac.ops.disable_tx_laser(hw); | ||
3744 | |||
3745 | /* clear n-tuple filters that are cached */ | 3745 | /* clear n-tuple filters that are cached */ |
3746 | ethtool_ntuple_flush(netdev); | 3746 | ethtool_ntuple_flush(netdev); |
3747 | 3747 | ||
@@ -4001,7 +4001,7 @@ static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter) | |||
4001 | 4001 | ||
4002 | done: | 4002 | done: |
4003 | /* Notify the stack of the (possibly) reduced Tx Queue count. */ | 4003 | /* Notify the stack of the (possibly) reduced Tx Queue count. */ |
4004 | adapter->netdev->real_num_tx_queues = adapter->num_tx_queues; | 4004 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
4005 | } | 4005 | } |
4006 | 4006 | ||
4007 | static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, | 4007 | static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, |
@@ -5195,7 +5195,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
5195 | ixgbe_free_all_tx_resources(adapter); | 5195 | ixgbe_free_all_tx_resources(adapter); |
5196 | ixgbe_free_all_rx_resources(adapter); | 5196 | ixgbe_free_all_rx_resources(adapter); |
5197 | } | 5197 | } |
5198 | ixgbe_clear_interrupt_scheme(adapter); | ||
5199 | 5198 | ||
5200 | #ifdef CONFIG_PM | 5199 | #ifdef CONFIG_PM |
5201 | retval = pci_save_state(pdev); | 5200 | retval = pci_save_state(pdev); |
@@ -5230,6 +5229,8 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
5230 | 5229 | ||
5231 | *enable_wake = !!wufc; | 5230 | *enable_wake = !!wufc; |
5232 | 5231 | ||
5232 | ixgbe_clear_interrupt_scheme(adapter); | ||
5233 | |||
5233 | ixgbe_release_hw_control(adapter); | 5234 | ixgbe_release_hw_control(adapter); |
5234 | 5235 | ||
5235 | pci_disable_device(pdev); | 5236 | pci_disable_device(pdev); |
@@ -6023,7 +6024,6 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | |||
6023 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | 6024 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, |
6024 | int queue, u32 tx_flags) | 6025 | int queue, u32 tx_flags) |
6025 | { | 6026 | { |
6026 | /* Right now, we support IPv4 only */ | ||
6027 | struct ixgbe_atr_input atr_input; | 6027 | struct ixgbe_atr_input atr_input; |
6028 | struct tcphdr *th; | 6028 | struct tcphdr *th; |
6029 | struct iphdr *iph = ip_hdr(skb); | 6029 | struct iphdr *iph = ip_hdr(skb); |
@@ -6032,6 +6032,9 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | |||
6032 | u32 src_ipv4_addr, dst_ipv4_addr; | 6032 | u32 src_ipv4_addr, dst_ipv4_addr; |
6033 | u8 l4type = 0; | 6033 | u8 l4type = 0; |
6034 | 6034 | ||
6035 | /* Right now, we support IPv4 only */ | ||
6036 | if (skb->protocol != htons(ETH_P_IP)) | ||
6037 | return; | ||
6035 | /* check if we're UDP or TCP */ | 6038 | /* check if we're UDP or TCP */ |
6036 | if (iph->protocol == IPPROTO_TCP) { | 6039 | if (iph->protocol == IPPROTO_TCP) { |
6037 | th = tcp_hdr(skb); | 6040 | th = tcp_hdr(skb); |
@@ -6489,6 +6492,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6489 | #endif | 6492 | #endif |
6490 | u32 part_num, eec; | 6493 | u32 part_num, eec; |
6491 | 6494 | ||
6495 | /* Catch broken hardware that put the wrong VF device ID in | ||
6496 | * the PCIe SR-IOV capability. | ||
6497 | */ | ||
6498 | if (pdev->is_virtfn) { | ||
6499 | WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", | ||
6500 | pci_name(pdev), pdev->vendor, pdev->device); | ||
6501 | return -EINVAL; | ||
6502 | } | ||
6503 | |||
6492 | err = pci_enable_device_mem(pdev); | 6504 | err = pci_enable_device_mem(pdev); |
6493 | if (err) | 6505 | if (err) |
6494 | return err; | 6506 | return err; |
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index 52dcc8495647..6474c4973d3a 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -964,7 +964,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
964 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); | 964 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); |
965 | if (!np) { | 965 | if (!np) { |
966 | dev_err(&op->dev, "could not find DMA node\n"); | 966 | dev_err(&op->dev, "could not find DMA node\n"); |
967 | goto nodev; | 967 | goto err_iounmap; |
968 | } | 968 | } |
969 | 969 | ||
970 | /* Setup the DMA register accesses, could be DCR or memory mapped */ | 970 | /* Setup the DMA register accesses, could be DCR or memory mapped */ |
@@ -978,7 +978,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
978 | dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs); | 978 | dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs); |
979 | } else { | 979 | } else { |
980 | dev_err(&op->dev, "unable to map DMA registers\n"); | 980 | dev_err(&op->dev, "unable to map DMA registers\n"); |
981 | goto nodev; | 981 | goto err_iounmap; |
982 | } | 982 | } |
983 | } | 983 | } |
984 | 984 | ||
@@ -987,7 +987,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
987 | if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { | 987 | if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { |
988 | dev_err(&op->dev, "could not determine irqs\n"); | 988 | dev_err(&op->dev, "could not determine irqs\n"); |
989 | rc = -ENOMEM; | 989 | rc = -ENOMEM; |
990 | goto nodev; | 990 | goto err_iounmap_2; |
991 | } | 991 | } |
992 | 992 | ||
993 | of_node_put(np); /* Finished with the DMA node; drop the reference */ | 993 | of_node_put(np); /* Finished with the DMA node; drop the reference */ |
@@ -997,7 +997,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
997 | if ((!addr) || (size != 6)) { | 997 | if ((!addr) || (size != 6)) { |
998 | dev_err(&op->dev, "could not find MAC address\n"); | 998 | dev_err(&op->dev, "could not find MAC address\n"); |
999 | rc = -ENODEV; | 999 | rc = -ENODEV; |
1000 | goto nodev; | 1000 | goto err_iounmap_2; |
1001 | } | 1001 | } |
1002 | temac_set_mac_address(ndev, (void *)addr); | 1002 | temac_set_mac_address(ndev, (void *)addr); |
1003 | 1003 | ||
@@ -1013,7 +1013,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1013 | rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group); | 1013 | rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group); |
1014 | if (rc) { | 1014 | if (rc) { |
1015 | dev_err(lp->dev, "Error creating sysfs files\n"); | 1015 | dev_err(lp->dev, "Error creating sysfs files\n"); |
1016 | goto nodev; | 1016 | goto err_iounmap_2; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | rc = register_netdev(lp->ndev); | 1019 | rc = register_netdev(lp->ndev); |
@@ -1026,6 +1026,11 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1026 | 1026 | ||
1027 | err_register_ndev: | 1027 | err_register_ndev: |
1028 | sysfs_remove_group(&lp->dev->kobj, &temac_attr_group); | 1028 | sysfs_remove_group(&lp->dev->kobj, &temac_attr_group); |
1029 | err_iounmap_2: | ||
1030 | if (lp->sdma_regs) | ||
1031 | iounmap(lp->sdma_regs); | ||
1032 | err_iounmap: | ||
1033 | iounmap(lp->regs); | ||
1029 | nodev: | 1034 | nodev: |
1030 | free_netdev(ndev); | 1035 | free_netdev(ndev); |
1031 | ndev = NULL; | 1036 | ndev = NULL; |
@@ -1044,6 +1049,9 @@ static int __devexit temac_of_remove(struct of_device *op) | |||
1044 | of_node_put(lp->phy_node); | 1049 | of_node_put(lp->phy_node); |
1045 | lp->phy_node = NULL; | 1050 | lp->phy_node = NULL; |
1046 | dev_set_drvdata(&op->dev, NULL); | 1051 | dev_set_drvdata(&op->dev, NULL); |
1052 | iounmap(lp->regs); | ||
1053 | if (lp->sdma_regs) | ||
1054 | iounmap(lp->sdma_regs); | ||
1047 | free_netdev(ndev); | 1055 | free_netdev(ndev); |
1048 | return 0; | 1056 | return 0; |
1049 | } | 1057 | } |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 87e8d4cb4057..f15fe2cf72ae 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -499,7 +499,7 @@ static const struct net_device_ops macvlan_netdev_ops = { | |||
499 | .ndo_validate_addr = eth_validate_addr, | 499 | .ndo_validate_addr = eth_validate_addr, |
500 | }; | 500 | }; |
501 | 501 | ||
502 | static void macvlan_setup(struct net_device *dev) | 502 | void macvlan_common_setup(struct net_device *dev) |
503 | { | 503 | { |
504 | ether_setup(dev); | 504 | ether_setup(dev); |
505 | 505 | ||
@@ -508,6 +508,12 @@ static void macvlan_setup(struct net_device *dev) | |||
508 | dev->destructor = free_netdev; | 508 | dev->destructor = free_netdev; |
509 | dev->header_ops = &macvlan_hard_header_ops, | 509 | dev->header_ops = &macvlan_hard_header_ops, |
510 | dev->ethtool_ops = &macvlan_ethtool_ops; | 510 | dev->ethtool_ops = &macvlan_ethtool_ops; |
511 | } | ||
512 | EXPORT_SYMBOL_GPL(macvlan_common_setup); | ||
513 | |||
514 | static void macvlan_setup(struct net_device *dev) | ||
515 | { | ||
516 | macvlan_common_setup(dev); | ||
511 | dev->tx_queue_len = 0; | 517 | dev->tx_queue_len = 0; |
512 | } | 518 | } |
513 | 519 | ||
@@ -705,7 +711,6 @@ int macvlan_link_register(struct rtnl_link_ops *ops) | |||
705 | /* common fields */ | 711 | /* common fields */ |
706 | ops->priv_size = sizeof(struct macvlan_dev); | 712 | ops->priv_size = sizeof(struct macvlan_dev); |
707 | ops->get_tx_queues = macvlan_get_tx_queues; | 713 | ops->get_tx_queues = macvlan_get_tx_queues; |
708 | ops->setup = macvlan_setup; | ||
709 | ops->validate = macvlan_validate; | 714 | ops->validate = macvlan_validate; |
710 | ops->maxtype = IFLA_MACVLAN_MAX; | 715 | ops->maxtype = IFLA_MACVLAN_MAX; |
711 | ops->policy = macvlan_policy; | 716 | ops->policy = macvlan_policy; |
@@ -719,6 +724,7 @@ EXPORT_SYMBOL_GPL(macvlan_link_register); | |||
719 | 724 | ||
720 | static struct rtnl_link_ops macvlan_link_ops = { | 725 | static struct rtnl_link_ops macvlan_link_ops = { |
721 | .kind = "macvlan", | 726 | .kind = "macvlan", |
727 | .setup = macvlan_setup, | ||
722 | .newlink = macvlan_newlink, | 728 | .newlink = macvlan_newlink, |
723 | .dellink = macvlan_dellink, | 729 | .dellink = macvlan_dellink, |
724 | }; | 730 | }; |
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index a8a94e2f6ddc..ff02b836c3c4 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -180,11 +180,18 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb) | |||
180 | { | 180 | { |
181 | struct macvtap_queue *q = macvtap_get_queue(dev, skb); | 181 | struct macvtap_queue *q = macvtap_get_queue(dev, skb); |
182 | if (!q) | 182 | if (!q) |
183 | return -ENOLINK; | 183 | goto drop; |
184 | |||
185 | if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len) | ||
186 | goto drop; | ||
184 | 187 | ||
185 | skb_queue_tail(&q->sk.sk_receive_queue, skb); | 188 | skb_queue_tail(&q->sk.sk_receive_queue, skb); |
186 | wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); | 189 | wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); |
187 | return 0; | 190 | return NET_RX_SUCCESS; |
191 | |||
192 | drop: | ||
193 | kfree_skb(skb); | ||
194 | return NET_RX_DROP; | ||
188 | } | 195 | } |
189 | 196 | ||
190 | /* | 197 | /* |
@@ -235,8 +242,15 @@ static void macvtap_dellink(struct net_device *dev, | |||
235 | macvlan_dellink(dev, head); | 242 | macvlan_dellink(dev, head); |
236 | } | 243 | } |
237 | 244 | ||
245 | static void macvtap_setup(struct net_device *dev) | ||
246 | { | ||
247 | macvlan_common_setup(dev); | ||
248 | dev->tx_queue_len = TUN_READQ_SIZE; | ||
249 | } | ||
250 | |||
238 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { | 251 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { |
239 | .kind = "macvtap", | 252 | .kind = "macvtap", |
253 | .setup = macvtap_setup, | ||
240 | .newlink = macvtap_newlink, | 254 | .newlink = macvtap_newlink, |
241 | .dellink = macvtap_dellink, | 255 | .dellink = macvtap_dellink, |
242 | }; | 256 | }; |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index e345ec8cb473..73bb8ea6f54a 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -289,6 +289,7 @@ struct mv643xx_eth_shared_private { | |||
289 | unsigned int t_clk; | 289 | unsigned int t_clk; |
290 | int extended_rx_coal_limit; | 290 | int extended_rx_coal_limit; |
291 | int tx_bw_control; | 291 | int tx_bw_control; |
292 | int tx_csum_limit; | ||
292 | }; | 293 | }; |
293 | 294 | ||
294 | #define TX_BW_CONTROL_ABSENT 0 | 295 | #define TX_BW_CONTROL_ABSENT 0 |
@@ -776,13 +777,16 @@ static int txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb) | |||
776 | l4i_chk = 0; | 777 | l4i_chk = 0; |
777 | 778 | ||
778 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 779 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
780 | int hdr_len; | ||
779 | int tag_bytes; | 781 | int tag_bytes; |
780 | 782 | ||
781 | BUG_ON(skb->protocol != htons(ETH_P_IP) && | 783 | BUG_ON(skb->protocol != htons(ETH_P_IP) && |
782 | skb->protocol != htons(ETH_P_8021Q)); | 784 | skb->protocol != htons(ETH_P_8021Q)); |
783 | 785 | ||
784 | tag_bytes = (void *)ip_hdr(skb) - (void *)skb->data - ETH_HLEN; | 786 | hdr_len = (void *)ip_hdr(skb) - (void *)skb->data; |
785 | if (unlikely(tag_bytes & ~12)) { | 787 | tag_bytes = hdr_len - ETH_HLEN; |
788 | if (skb->len - hdr_len > mp->shared->tx_csum_limit || | ||
789 | unlikely(tag_bytes & ~12)) { | ||
786 | if (skb_checksum_help(skb) == 0) | 790 | if (skb_checksum_help(skb) == 0) |
787 | goto no_csum; | 791 | goto no_csum; |
788 | kfree_skb(skb); | 792 | kfree_skb(skb); |
@@ -2666,6 +2670,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) | |||
2666 | * Detect hardware parameters. | 2670 | * Detect hardware parameters. |
2667 | */ | 2671 | */ |
2668 | msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000; | 2672 | msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000; |
2673 | msp->tx_csum_limit = pd->tx_csum_limit ? pd->tx_csum_limit : 9 * 1024; | ||
2669 | infer_hw_params(msp); | 2674 | infer_hw_params(msp); |
2670 | 2675 | ||
2671 | platform_set_drvdata(pdev, msp); | 2676 | platform_set_drvdata(pdev, msp); |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index b8e2923a1d69..1063093b3afc 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -806,8 +806,10 @@ static int __init ne_drv_probe(struct platform_device *pdev) | |||
806 | dev->base_addr = res->start; | 806 | dev->base_addr = res->start; |
807 | dev->irq = platform_get_irq(pdev, 0); | 807 | dev->irq = platform_get_irq(pdev, 0); |
808 | } else { | 808 | } else { |
809 | if (this_dev < 0 || this_dev >= MAX_NE_CARDS) | 809 | if (this_dev < 0 || this_dev >= MAX_NE_CARDS) { |
810 | free_netdev(dev); | ||
810 | return -EINVAL; | 811 | return -EINVAL; |
812 | } | ||
811 | dev->base_addr = io[this_dev]; | 813 | dev->base_addr = io[this_dev]; |
812 | dev->irq = irq[this_dev]; | 814 | dev->irq = irq[this_dev]; |
813 | dev->mem_end = bad[this_dev]; | 815 | dev->mem_end = bad[this_dev]; |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 5b3dfb4ab279..33525bf2a3d3 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1168,6 +1168,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1168 | int interrupts, nr_serviced = 0, i; | 1168 | int interrupts, nr_serviced = 0, i; |
1169 | struct ei_device *ei_local; | 1169 | struct ei_device *ei_local; |
1170 | int handled = 0; | 1170 | int handled = 0; |
1171 | unsigned long flags; | ||
1171 | 1172 | ||
1172 | e8390_base = dev->base_addr; | 1173 | e8390_base = dev->base_addr; |
1173 | ei_local = netdev_priv(dev); | 1174 | ei_local = netdev_priv(dev); |
@@ -1176,7 +1177,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1176 | * Protect the irq test too. | 1177 | * Protect the irq test too. |
1177 | */ | 1178 | */ |
1178 | 1179 | ||
1179 | spin_lock(&ei_local->page_lock); | 1180 | spin_lock_irqsave(&ei_local->page_lock, flags); |
1180 | 1181 | ||
1181 | if (ei_local->irqlock) | 1182 | if (ei_local->irqlock) |
1182 | { | 1183 | { |
@@ -1188,7 +1189,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1188 | dev->name, inb_p(e8390_base + EN0_ISR), | 1189 | dev->name, inb_p(e8390_base + EN0_ISR), |
1189 | inb_p(e8390_base + EN0_IMR)); | 1190 | inb_p(e8390_base + EN0_IMR)); |
1190 | #endif | 1191 | #endif |
1191 | spin_unlock(&ei_local->page_lock); | 1192 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1192 | return IRQ_NONE; | 1193 | return IRQ_NONE; |
1193 | } | 1194 | } |
1194 | 1195 | ||
@@ -1261,7 +1262,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1261 | ei_local->irqlock = 0; | 1262 | ei_local->irqlock = 0; |
1262 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); | 1263 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); |
1263 | 1264 | ||
1264 | spin_unlock(&ei_local->page_lock); | 1265 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1265 | return IRQ_RETVAL(handled); | 1266 | return IRQ_RETVAL(handled); |
1266 | } | 1267 | } |
1267 | 1268 | ||
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 78b74e83ce5d..5a1bd5db2a93 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/mii.h> | 29 | #include <linux/mii.h> |
30 | #include <linux/ethtool.h> | 30 | #include <linux/ethtool.h> |
31 | #include <linux/phy.h> | 31 | #include <linux/phy.h> |
32 | #include <linux/marvell_phy.h> | ||
32 | 33 | ||
33 | #include <asm/io.h> | 34 | #include <asm/io.h> |
34 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
@@ -48,8 +49,6 @@ | |||
48 | #define MII_M1145_RGMII_RX_DELAY 0x0080 | 49 | #define MII_M1145_RGMII_RX_DELAY 0x0080 |
49 | #define MII_M1145_RGMII_TX_DELAY 0x0002 | 50 | #define MII_M1145_RGMII_TX_DELAY 0x0002 |
50 | 51 | ||
51 | #define M1145_DEV_FLAGS_RESISTANCE 0x00000001 | ||
52 | |||
53 | #define MII_M1111_PHY_LED_CONTROL 0x18 | 52 | #define MII_M1111_PHY_LED_CONTROL 0x18 |
54 | #define MII_M1111_PHY_LED_DIRECT 0x4100 | 53 | #define MII_M1111_PHY_LED_DIRECT 0x4100 |
55 | #define MII_M1111_PHY_LED_COMBINE 0x411c | 54 | #define MII_M1111_PHY_LED_COMBINE 0x411c |
@@ -350,7 +349,10 @@ static int m88e1118_config_init(struct phy_device *phydev) | |||
350 | return err; | 349 | return err; |
351 | 350 | ||
352 | /* Adjust LED Control */ | 351 | /* Adjust LED Control */ |
353 | err = phy_write(phydev, 0x10, 0x021e); | 352 | if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS) |
353 | err = phy_write(phydev, 0x10, 0x1100); | ||
354 | else | ||
355 | err = phy_write(phydev, 0x10, 0x021e); | ||
354 | if (err < 0) | 356 | if (err < 0) |
355 | return err; | 357 | return err; |
356 | 358 | ||
@@ -398,7 +400,7 @@ static int m88e1145_config_init(struct phy_device *phydev) | |||
398 | if (err < 0) | 400 | if (err < 0) |
399 | return err; | 401 | return err; |
400 | 402 | ||
401 | if (phydev->dev_flags & M1145_DEV_FLAGS_RESISTANCE) { | 403 | if (phydev->dev_flags & MARVELL_PHY_M1145_FLAGS_RESISTANCE) { |
402 | err = phy_write(phydev, 0x1d, 0x0012); | 404 | err = phy_write(phydev, 0x1d, 0x0012); |
403 | if (err < 0) | 405 | if (err < 0) |
404 | return err; | 406 | return err; |
@@ -529,8 +531,8 @@ static int m88e1121_did_interrupt(struct phy_device *phydev) | |||
529 | 531 | ||
530 | static struct phy_driver marvell_drivers[] = { | 532 | static struct phy_driver marvell_drivers[] = { |
531 | { | 533 | { |
532 | .phy_id = 0x01410c60, | 534 | .phy_id = MARVELL_PHY_ID_88E1101, |
533 | .phy_id_mask = 0xfffffff0, | 535 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
534 | .name = "Marvell 88E1101", | 536 | .name = "Marvell 88E1101", |
535 | .features = PHY_GBIT_FEATURES, | 537 | .features = PHY_GBIT_FEATURES, |
536 | .flags = PHY_HAS_INTERRUPT, | 538 | .flags = PHY_HAS_INTERRUPT, |
@@ -541,8 +543,8 @@ static struct phy_driver marvell_drivers[] = { | |||
541 | .driver = { .owner = THIS_MODULE }, | 543 | .driver = { .owner = THIS_MODULE }, |
542 | }, | 544 | }, |
543 | { | 545 | { |
544 | .phy_id = 0x01410c90, | 546 | .phy_id = MARVELL_PHY_ID_88E1112, |
545 | .phy_id_mask = 0xfffffff0, | 547 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
546 | .name = "Marvell 88E1112", | 548 | .name = "Marvell 88E1112", |
547 | .features = PHY_GBIT_FEATURES, | 549 | .features = PHY_GBIT_FEATURES, |
548 | .flags = PHY_HAS_INTERRUPT, | 550 | .flags = PHY_HAS_INTERRUPT, |
@@ -554,8 +556,8 @@ static struct phy_driver marvell_drivers[] = { | |||
554 | .driver = { .owner = THIS_MODULE }, | 556 | .driver = { .owner = THIS_MODULE }, |
555 | }, | 557 | }, |
556 | { | 558 | { |
557 | .phy_id = 0x01410cc0, | 559 | .phy_id = MARVELL_PHY_ID_88E1111, |
558 | .phy_id_mask = 0xfffffff0, | 560 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
559 | .name = "Marvell 88E1111", | 561 | .name = "Marvell 88E1111", |
560 | .features = PHY_GBIT_FEATURES, | 562 | .features = PHY_GBIT_FEATURES, |
561 | .flags = PHY_HAS_INTERRUPT, | 563 | .flags = PHY_HAS_INTERRUPT, |
@@ -567,8 +569,8 @@ static struct phy_driver marvell_drivers[] = { | |||
567 | .driver = { .owner = THIS_MODULE }, | 569 | .driver = { .owner = THIS_MODULE }, |
568 | }, | 570 | }, |
569 | { | 571 | { |
570 | .phy_id = 0x01410e10, | 572 | .phy_id = MARVELL_PHY_ID_88E1118, |
571 | .phy_id_mask = 0xfffffff0, | 573 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
572 | .name = "Marvell 88E1118", | 574 | .name = "Marvell 88E1118", |
573 | .features = PHY_GBIT_FEATURES, | 575 | .features = PHY_GBIT_FEATURES, |
574 | .flags = PHY_HAS_INTERRUPT, | 576 | .flags = PHY_HAS_INTERRUPT, |
@@ -580,8 +582,8 @@ static struct phy_driver marvell_drivers[] = { | |||
580 | .driver = {.owner = THIS_MODULE,}, | 582 | .driver = {.owner = THIS_MODULE,}, |
581 | }, | 583 | }, |
582 | { | 584 | { |
583 | .phy_id = 0x01410cb0, | 585 | .phy_id = MARVELL_PHY_ID_88E1121R, |
584 | .phy_id_mask = 0xfffffff0, | 586 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
585 | .name = "Marvell 88E1121R", | 587 | .name = "Marvell 88E1121R", |
586 | .features = PHY_GBIT_FEATURES, | 588 | .features = PHY_GBIT_FEATURES, |
587 | .flags = PHY_HAS_INTERRUPT, | 589 | .flags = PHY_HAS_INTERRUPT, |
@@ -593,8 +595,8 @@ static struct phy_driver marvell_drivers[] = { | |||
593 | .driver = { .owner = THIS_MODULE }, | 595 | .driver = { .owner = THIS_MODULE }, |
594 | }, | 596 | }, |
595 | { | 597 | { |
596 | .phy_id = 0x01410cd0, | 598 | .phy_id = MARVELL_PHY_ID_88E1145, |
597 | .phy_id_mask = 0xfffffff0, | 599 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
598 | .name = "Marvell 88E1145", | 600 | .name = "Marvell 88E1145", |
599 | .features = PHY_GBIT_FEATURES, | 601 | .features = PHY_GBIT_FEATURES, |
600 | .flags = PHY_HAS_INTERRUPT, | 602 | .flags = PHY_HAS_INTERRUPT, |
@@ -606,8 +608,8 @@ static struct phy_driver marvell_drivers[] = { | |||
606 | .driver = { .owner = THIS_MODULE }, | 608 | .driver = { .owner = THIS_MODULE }, |
607 | }, | 609 | }, |
608 | { | 610 | { |
609 | .phy_id = 0x01410e30, | 611 | .phy_id = MARVELL_PHY_ID_88E1240, |
610 | .phy_id_mask = 0xfffffff0, | 612 | .phy_id_mask = MARVELL_PHY_ID_MASK, |
611 | .name = "Marvell 88E1240", | 613 | .name = "Marvell 88E1240", |
612 | .features = PHY_GBIT_FEATURES, | 614 | .features = PHY_GBIT_FEATURES, |
613 | .flags = PHY_HAS_INTERRUPT, | 615 | .flags = PHY_HAS_INTERRUPT, |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index fa4b24c49f42..d10bcefc0e45 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -4611,8 +4611,7 @@ static void ql_timer(unsigned long data) | |||
4611 | return; | 4611 | return; |
4612 | } | 4612 | } |
4613 | 4613 | ||
4614 | qdev->timer.expires = jiffies + (5*HZ); | 4614 | mod_timer(&qdev->timer, jiffies + (5*HZ)); |
4615 | add_timer(&qdev->timer); | ||
4616 | } | 4615 | } |
4617 | 4616 | ||
4618 | static int __devinit qlge_probe(struct pci_dev *pdev, | 4617 | static int __devinit qlge_probe(struct pci_dev *pdev, |
@@ -4713,6 +4712,8 @@ static void ql_eeh_close(struct net_device *ndev) | |||
4713 | netif_stop_queue(ndev); | 4712 | netif_stop_queue(ndev); |
4714 | } | 4713 | } |
4715 | 4714 | ||
4715 | /* Disabling the timer */ | ||
4716 | del_timer_sync(&qdev->timer); | ||
4716 | if (test_bit(QL_ADAPTER_UP, &qdev->flags)) | 4717 | if (test_bit(QL_ADAPTER_UP, &qdev->flags)) |
4717 | cancel_delayed_work_sync(&qdev->asic_reset_work); | 4718 | cancel_delayed_work_sync(&qdev->asic_reset_work); |
4718 | cancel_delayed_work_sync(&qdev->mpi_reset_work); | 4719 | cancel_delayed_work_sync(&qdev->mpi_reset_work); |
@@ -4808,8 +4809,7 @@ static void qlge_io_resume(struct pci_dev *pdev) | |||
4808 | netif_err(qdev, ifup, qdev->ndev, | 4809 | netif_err(qdev, ifup, qdev->ndev, |
4809 | "Device was not running prior to EEH.\n"); | 4810 | "Device was not running prior to EEH.\n"); |
4810 | } | 4811 | } |
4811 | qdev->timer.expires = jiffies + (5*HZ); | 4812 | mod_timer(&qdev->timer, jiffies + (5*HZ)); |
4812 | add_timer(&qdev->timer); | ||
4813 | netif_device_attach(ndev); | 4813 | netif_device_attach(ndev); |
4814 | } | 4814 | } |
4815 | 4815 | ||
@@ -4871,8 +4871,7 @@ static int qlge_resume(struct pci_dev *pdev) | |||
4871 | return err; | 4871 | return err; |
4872 | } | 4872 | } |
4873 | 4873 | ||
4874 | qdev->timer.expires = jiffies + (5*HZ); | 4874 | mod_timer(&qdev->timer, jiffies + (5*HZ)); |
4875 | add_timer(&qdev->timer); | ||
4876 | netif_device_attach(ndev); | 4875 | netif_device_attach(ndev); |
4877 | 4876 | ||
4878 | return 0; | 4877 | return 0; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 96b6cfbf0a3a..cdc6a5c2e70d 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1316,7 +1316,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp, | |||
1316 | { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 }, | 1316 | { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 }, |
1317 | 1317 | ||
1318 | /* 8168C family. */ | 1318 | /* 8168C family. */ |
1319 | { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 }, | 1319 | { 0x7cf00000, 0x3cb00000, RTL_GIGA_MAC_VER_24 }, |
1320 | { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 }, | 1320 | { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 }, |
1321 | { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 }, | 1321 | { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 }, |
1322 | { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 }, | 1322 | { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 }, |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 668327ccd8d0..1d37f0c310ca 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3130,7 +3130,6 @@ static void tx_intr_handler(struct fifo_info *fifo_data) | |||
3130 | pkt_cnt++; | 3130 | pkt_cnt++; |
3131 | 3131 | ||
3132 | /* Updating the statistics block */ | 3132 | /* Updating the statistics block */ |
3133 | nic->dev->stats.tx_bytes += skb->len; | ||
3134 | swstats->mem_freed += skb->truesize; | 3133 | swstats->mem_freed += skb->truesize; |
3135 | dev_kfree_skb_irq(skb); | 3134 | dev_kfree_skb_irq(skb); |
3136 | 3135 | ||
@@ -4901,48 +4900,81 @@ static void s2io_updt_stats(struct s2io_nic *sp) | |||
4901 | * Return value: | 4900 | * Return value: |
4902 | * pointer to the updated net_device_stats structure. | 4901 | * pointer to the updated net_device_stats structure. |
4903 | */ | 4902 | */ |
4904 | |||
4905 | static struct net_device_stats *s2io_get_stats(struct net_device *dev) | 4903 | static struct net_device_stats *s2io_get_stats(struct net_device *dev) |
4906 | { | 4904 | { |
4907 | struct s2io_nic *sp = netdev_priv(dev); | 4905 | struct s2io_nic *sp = netdev_priv(dev); |
4908 | struct config_param *config = &sp->config; | ||
4909 | struct mac_info *mac_control = &sp->mac_control; | 4906 | struct mac_info *mac_control = &sp->mac_control; |
4910 | struct stat_block *stats = mac_control->stats_info; | 4907 | struct stat_block *stats = mac_control->stats_info; |
4911 | int i; | 4908 | u64 delta; |
4912 | 4909 | ||
4913 | /* Configure Stats for immediate updt */ | 4910 | /* Configure Stats for immediate updt */ |
4914 | s2io_updt_stats(sp); | 4911 | s2io_updt_stats(sp); |
4915 | 4912 | ||
4916 | /* Using sp->stats as a staging area, because reset (due to mtu | 4913 | /* A device reset will cause the on-adapter statistics to be zero'ed. |
4917 | change, for example) will clear some hardware counters */ | 4914 | * This can be done while running by changing the MTU. To prevent the |
4918 | dev->stats.tx_packets += le32_to_cpu(stats->tmac_frms) - | 4915 | * system from having the stats zero'ed, the driver keeps a copy of the |
4919 | sp->stats.tx_packets; | 4916 | * last update to the system (which is also zero'ed on reset). This |
4920 | sp->stats.tx_packets = le32_to_cpu(stats->tmac_frms); | 4917 | * enables the driver to accurately know the delta between the last |
4921 | 4918 | * update and the current update. | |
4922 | dev->stats.tx_errors += le32_to_cpu(stats->tmac_any_err_frms) - | 4919 | */ |
4923 | sp->stats.tx_errors; | 4920 | delta = ((u64) le32_to_cpu(stats->rmac_vld_frms_oflow) << 32 | |
4924 | sp->stats.tx_errors = le32_to_cpu(stats->tmac_any_err_frms); | 4921 | le32_to_cpu(stats->rmac_vld_frms)) - sp->stats.rx_packets; |
4925 | 4922 | sp->stats.rx_packets += delta; | |
4926 | dev->stats.rx_errors += le64_to_cpu(stats->rmac_drop_frms) - | 4923 | dev->stats.rx_packets += delta; |
4927 | sp->stats.rx_errors; | 4924 | |
4928 | sp->stats.rx_errors = le64_to_cpu(stats->rmac_drop_frms); | 4925 | delta = ((u64) le32_to_cpu(stats->tmac_frms_oflow) << 32 | |
4929 | 4926 | le32_to_cpu(stats->tmac_frms)) - sp->stats.tx_packets; | |
4930 | dev->stats.multicast = le32_to_cpu(stats->rmac_vld_mcst_frms) - | 4927 | sp->stats.tx_packets += delta; |
4931 | sp->stats.multicast; | 4928 | dev->stats.tx_packets += delta; |
4932 | sp->stats.multicast = le32_to_cpu(stats->rmac_vld_mcst_frms); | 4929 | |
4933 | 4930 | delta = ((u64) le32_to_cpu(stats->rmac_data_octets_oflow) << 32 | | |
4934 | dev->stats.rx_length_errors = le64_to_cpu(stats->rmac_long_frms) - | 4931 | le32_to_cpu(stats->rmac_data_octets)) - sp->stats.rx_bytes; |
4935 | sp->stats.rx_length_errors; | 4932 | sp->stats.rx_bytes += delta; |
4936 | sp->stats.rx_length_errors = le64_to_cpu(stats->rmac_long_frms); | 4933 | dev->stats.rx_bytes += delta; |
4934 | |||
4935 | delta = ((u64) le32_to_cpu(stats->tmac_data_octets_oflow) << 32 | | ||
4936 | le32_to_cpu(stats->tmac_data_octets)) - sp->stats.tx_bytes; | ||
4937 | sp->stats.tx_bytes += delta; | ||
4938 | dev->stats.tx_bytes += delta; | ||
4939 | |||
4940 | delta = le64_to_cpu(stats->rmac_drop_frms) - sp->stats.rx_errors; | ||
4941 | sp->stats.rx_errors += delta; | ||
4942 | dev->stats.rx_errors += delta; | ||
4943 | |||
4944 | delta = ((u64) le32_to_cpu(stats->tmac_any_err_frms_oflow) << 32 | | ||
4945 | le32_to_cpu(stats->tmac_any_err_frms)) - sp->stats.tx_errors; | ||
4946 | sp->stats.tx_errors += delta; | ||
4947 | dev->stats.tx_errors += delta; | ||
4948 | |||
4949 | delta = le64_to_cpu(stats->rmac_drop_frms) - sp->stats.rx_dropped; | ||
4950 | sp->stats.rx_dropped += delta; | ||
4951 | dev->stats.rx_dropped += delta; | ||
4952 | |||
4953 | delta = le64_to_cpu(stats->tmac_drop_frms) - sp->stats.tx_dropped; | ||
4954 | sp->stats.tx_dropped += delta; | ||
4955 | dev->stats.tx_dropped += delta; | ||
4956 | |||
4957 | /* The adapter MAC interprets pause frames as multicast packets, but | ||
4958 | * does not pass them up. This erroneously increases the multicast | ||
4959 | * packet count and needs to be deducted when the multicast frame count | ||
4960 | * is queried. | ||
4961 | */ | ||
4962 | delta = (u64) le32_to_cpu(stats->rmac_vld_mcst_frms_oflow) << 32 | | ||
4963 | le32_to_cpu(stats->rmac_vld_mcst_frms); | ||
4964 | delta -= le64_to_cpu(stats->rmac_pause_ctrl_frms); | ||
4965 | delta -= sp->stats.multicast; | ||
4966 | sp->stats.multicast += delta; | ||
4967 | dev->stats.multicast += delta; | ||
4937 | 4968 | ||
4938 | /* collect per-ring rx_packets and rx_bytes */ | 4969 | delta = ((u64) le32_to_cpu(stats->rmac_usized_frms_oflow) << 32 | |
4939 | dev->stats.rx_packets = dev->stats.rx_bytes = 0; | 4970 | le32_to_cpu(stats->rmac_usized_frms)) + |
4940 | for (i = 0; i < config->rx_ring_num; i++) { | 4971 | le64_to_cpu(stats->rmac_long_frms) - sp->stats.rx_length_errors; |
4941 | struct ring_info *ring = &mac_control->rings[i]; | 4972 | sp->stats.rx_length_errors += delta; |
4973 | dev->stats.rx_length_errors += delta; | ||
4942 | 4974 | ||
4943 | dev->stats.rx_packets += ring->rx_packets; | 4975 | delta = le64_to_cpu(stats->rmac_fcs_err_frms) - sp->stats.rx_crc_errors; |
4944 | dev->stats.rx_bytes += ring->rx_bytes; | 4976 | sp->stats.rx_crc_errors += delta; |
4945 | } | 4977 | dev->stats.rx_crc_errors += delta; |
4946 | 4978 | ||
4947 | return &dev->stats; | 4979 | return &dev->stats; |
4948 | } | 4980 | } |
@@ -7455,15 +7487,11 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
7455 | } | 7487 | } |
7456 | } | 7488 | } |
7457 | 7489 | ||
7458 | /* Updating statistics */ | ||
7459 | ring_data->rx_packets++; | ||
7460 | rxdp->Host_Control = 0; | 7490 | rxdp->Host_Control = 0; |
7461 | if (sp->rxd_mode == RXD_MODE_1) { | 7491 | if (sp->rxd_mode == RXD_MODE_1) { |
7462 | int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2); | 7492 | int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2); |
7463 | 7493 | ||
7464 | ring_data->rx_bytes += len; | ||
7465 | skb_put(skb, len); | 7494 | skb_put(skb, len); |
7466 | |||
7467 | } else if (sp->rxd_mode == RXD_MODE_3B) { | 7495 | } else if (sp->rxd_mode == RXD_MODE_3B) { |
7468 | int get_block = ring_data->rx_curr_get_info.block_index; | 7496 | int get_block = ring_data->rx_curr_get_info.block_index; |
7469 | int get_off = ring_data->rx_curr_get_info.offset; | 7497 | int get_off = ring_data->rx_curr_get_info.offset; |
@@ -7472,7 +7500,6 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
7472 | unsigned char *buff = skb_push(skb, buf0_len); | 7500 | unsigned char *buff = skb_push(skb, buf0_len); |
7473 | 7501 | ||
7474 | struct buffAdd *ba = &ring_data->ba[get_block][get_off]; | 7502 | struct buffAdd *ba = &ring_data->ba[get_block][get_off]; |
7475 | ring_data->rx_bytes += buf0_len + buf2_len; | ||
7476 | memcpy(buff, ba->ba_0, buf0_len); | 7503 | memcpy(buff, ba->ba_0, buf0_len); |
7477 | skb_put(skb, buf2_len); | 7504 | skb_put(skb, buf2_len); |
7478 | } | 7505 | } |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 47c36e0994f5..7f3a53dcc6ef 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -65,7 +65,7 @@ static int debug_level = ERR_DBG; | |||
65 | 65 | ||
66 | /* DEBUG message print. */ | 66 | /* DEBUG message print. */ |
67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ | 67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ |
68 | if (dbg_level >= debug_level) \ | 68 | if (dbg_level <= debug_level) \ |
69 | pr_info(fmt, ##args); \ | 69 | pr_info(fmt, ##args); \ |
70 | } while (0) | 70 | } while (0) |
71 | 71 | ||
@@ -745,10 +745,6 @@ struct ring_info { | |||
745 | 745 | ||
746 | /* Buffer Address store. */ | 746 | /* Buffer Address store. */ |
747 | struct buffAdd **ba; | 747 | struct buffAdd **ba; |
748 | |||
749 | /* per-Ring statistics */ | ||
750 | unsigned long rx_packets; | ||
751 | unsigned long rx_bytes; | ||
752 | } ____cacheline_aligned; | 748 | } ____cacheline_aligned; |
753 | 749 | ||
754 | /* Fifo specific structure */ | 750 | /* Fifo specific structure */ |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 1f3acc3a5dfd..79eee3062083 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
@@ -2671,6 +2671,7 @@ static struct platform_driver sbmac_driver = { | |||
2671 | .remove = __exit_p(sbmac_remove), | 2671 | .remove = __exit_p(sbmac_remove), |
2672 | .driver = { | 2672 | .driver = { |
2673 | .name = sbmac_string, | 2673 | .name = sbmac_string, |
2674 | .owner = THIS_MODULE, | ||
2674 | }, | 2675 | }, |
2675 | }; | 2676 | }; |
2676 | 2677 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6ad6fe706312..63042596f0cf 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -736,8 +736,18 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun, | |||
736 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 736 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
737 | else if (sinfo->gso_type & SKB_GSO_UDP) | 737 | else if (sinfo->gso_type & SKB_GSO_UDP) |
738 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; | 738 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; |
739 | else | 739 | else { |
740 | BUG(); | 740 | printk(KERN_ERR "tun: unexpected GSO type: " |
741 | "0x%x, gso_size %d, hdr_len %d\n", | ||
742 | sinfo->gso_type, gso.gso_size, | ||
743 | gso.hdr_len); | ||
744 | print_hex_dump(KERN_ERR, "tun: ", | ||
745 | DUMP_PREFIX_NONE, | ||
746 | 16, 1, skb->head, | ||
747 | min((int)gso.hdr_len, 64), true); | ||
748 | WARN_ON_ONCE(1); | ||
749 | return -EINVAL; | ||
750 | } | ||
741 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) | 751 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) |
742 | gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; | 752 | gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; |
743 | } else | 753 | } else |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 28d3ee175e7b..dd8a4adf48ca 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -104,10 +104,8 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg, | |||
104 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | 104 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) |
105 | { | 105 | { |
106 | struct cdc_state *info = (void *) &dev->data; | 106 | struct cdc_state *info = (void *) &dev->data; |
107 | struct usb_cdc_notification notification; | ||
108 | int master_ifnum; | 107 | int master_ifnum; |
109 | int retval; | 108 | int retval; |
110 | int partial; | ||
111 | unsigned count; | 109 | unsigned count; |
112 | __le32 rsp; | 110 | __le32 rsp; |
113 | u32 xid = 0, msg_len, request_id; | 111 | u32 xid = 0, msg_len, request_id; |
@@ -135,17 +133,13 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
135 | if (unlikely(retval < 0 || xid == 0)) | 133 | if (unlikely(retval < 0 || xid == 0)) |
136 | return retval; | 134 | return retval; |
137 | 135 | ||
138 | /* Some devices don't respond on the control channel until | 136 | // FIXME Seems like some devices discard responses when |
139 | * polled on the status channel, so do that first. */ | 137 | // we time out and cancel our "get response" requests... |
140 | retval = usb_interrupt_msg( | 138 | // so, this is fragile. Probably need to poll for status. |
141 | dev->udev, | ||
142 | usb_rcvintpipe(dev->udev, dev->status->desc.bEndpointAddress), | ||
143 | ¬ification, sizeof(notification), &partial, | ||
144 | RNDIS_CONTROL_TIMEOUT_MS); | ||
145 | if (unlikely(retval < 0)) | ||
146 | return retval; | ||
147 | 139 | ||
148 | /* Poll the control channel; the request probably completed immediately */ | 140 | /* ignore status endpoint, just poll the control channel; |
141 | * the request probably completed immediately | ||
142 | */ | ||
149 | rsp = buf->msg_type | RNDIS_MSG_COMPLETION; | 143 | rsp = buf->msg_type | RNDIS_MSG_COMPLETION; |
150 | for (count = 0; count < 10; count++) { | 144 | for (count = 0; count < 10; count++) { |
151 | memset(buf, 0, CONTROL_BUFFER_SIZE); | 145 | memset(buf, 0, CONTROL_BUFFER_SIZE); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index a95c73de5824..81c76ada8e56 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1293,6 +1293,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1293 | goto out; | 1293 | goto out; |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | /* netdev_printk() needs this so do it as early as possible */ | ||
1297 | SET_NETDEV_DEV(net, &udev->dev); | ||
1298 | |||
1296 | dev = netdev_priv(net); | 1299 | dev = netdev_priv(net); |
1297 | dev->udev = xdev; | 1300 | dev->udev = xdev; |
1298 | dev->intf = udev; | 1301 | dev->intf = udev; |
@@ -1377,8 +1380,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1377 | dev->rx_urb_size = dev->hard_mtu; | 1380 | dev->rx_urb_size = dev->hard_mtu; |
1378 | dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); | 1381 | dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); |
1379 | 1382 | ||
1380 | SET_NETDEV_DEV(net, &udev->dev); | ||
1381 | |||
1382 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) | 1383 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) |
1383 | SET_NETDEV_DEVTYPE(net, &wlan_type); | 1384 | SET_NETDEV_DEVTYPE(net, &wlan_type); |
1384 | if ((dev->driver_info->flags & FLAG_WWAN) != 0) | 1385 | if ((dev->driver_info->flags & FLAG_WWAN) != 0) |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 1edb7a61983c..bb6b67f6b0cc 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -415,7 +415,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp) | |||
415 | static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | 415 | static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) |
416 | { | 416 | { |
417 | int err; | 417 | int err; |
418 | bool oom = false; | 418 | bool oom; |
419 | 419 | ||
420 | do { | 420 | do { |
421 | if (vi->mergeable_rx_bufs) | 421 | if (vi->mergeable_rx_bufs) |
@@ -425,10 +425,9 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | |||
425 | else | 425 | else |
426 | err = add_recvbuf_small(vi, gfp); | 426 | err = add_recvbuf_small(vi, gfp); |
427 | 427 | ||
428 | if (err < 0) { | 428 | oom = err == -ENOMEM; |
429 | oom = true; | 429 | if (err < 0) |
430 | break; | 430 | break; |
431 | } | ||
432 | ++vi->num; | 431 | ++vi->num; |
433 | } while (err > 0); | 432 | } while (err > 0); |
434 | if (unlikely(vi->num > vi->max)) | 433 | if (unlikely(vi->num > vi->max)) |
@@ -563,7 +562,6 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
563 | struct virtnet_info *vi = netdev_priv(dev); | 562 | struct virtnet_info *vi = netdev_priv(dev); |
564 | int capacity; | 563 | int capacity; |
565 | 564 | ||
566 | again: | ||
567 | /* Free up any pending old buffers before queueing new ones. */ | 565 | /* Free up any pending old buffers before queueing new ones. */ |
568 | free_old_xmit_skbs(vi); | 566 | free_old_xmit_skbs(vi); |
569 | 567 | ||
@@ -572,14 +570,20 @@ again: | |||
572 | 570 | ||
573 | /* This can happen with OOM and indirect buffers. */ | 571 | /* This can happen with OOM and indirect buffers. */ |
574 | if (unlikely(capacity < 0)) { | 572 | if (unlikely(capacity < 0)) { |
575 | netif_stop_queue(dev); | 573 | if (net_ratelimit()) { |
576 | dev_warn(&dev->dev, "Unexpected full queue\n"); | 574 | if (likely(capacity == -ENOMEM)) { |
577 | if (unlikely(!virtqueue_enable_cb(vi->svq))) { | 575 | dev_warn(&dev->dev, |
578 | virtqueue_disable_cb(vi->svq); | 576 | "TX queue failure: out of memory\n"); |
579 | netif_start_queue(dev); | 577 | } else { |
580 | goto again; | 578 | dev->stats.tx_fifo_errors++; |
579 | dev_warn(&dev->dev, | ||
580 | "Unexpected TX queue failure: %d\n", | ||
581 | capacity); | ||
582 | } | ||
581 | } | 583 | } |
582 | return NETDEV_TX_BUSY; | 584 | dev->stats.tx_dropped++; |
585 | kfree_skb(skb); | ||
586 | return NETDEV_TX_OK; | ||
583 | } | 587 | } |
584 | virtqueue_kick(vi->svq); | 588 | virtqueue_kick(vi->svq); |
585 | 589 | ||
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index d14e207de1df..fc8b2d7a0919 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -4517,9 +4517,9 @@ vxge_starter(void) | |||
4517 | char version[32]; | 4517 | char version[32]; |
4518 | snprintf(version, 32, "%s", DRV_VERSION); | 4518 | snprintf(version, 32, "%s", DRV_VERSION); |
4519 | 4519 | ||
4520 | printk(KERN_CRIT "%s: Copyright(c) 2002-2009 Neterion Inc\n", | 4520 | printk(KERN_INFO "%s: Copyright(c) 2002-2009 Neterion Inc\n", |
4521 | VXGE_DRIVER_NAME); | 4521 | VXGE_DRIVER_NAME); |
4522 | printk(KERN_CRIT "%s: Driver version: %s\n", | 4522 | printk(KERN_INFO "%s: Driver version: %s\n", |
4523 | VXGE_DRIVER_NAME, version); | 4523 | VXGE_DRIVER_NAME, version); |
4524 | 4524 | ||
4525 | verify_bandwidth(); | 4525 | verify_bandwidth(); |
diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h index 2d7c96d7e865..eb80243e22df 100644 --- a/drivers/net/wimax/i2400m/i2400m-usb.h +++ b/drivers/net/wimax/i2400m/i2400m-usb.h | |||
@@ -152,6 +152,7 @@ enum { | |||
152 | /* Device IDs */ | 152 | /* Device IDs */ |
153 | USB_DEVICE_ID_I6050 = 0x0186, | 153 | USB_DEVICE_ID_I6050 = 0x0186, |
154 | USB_DEVICE_ID_I6050_2 = 0x0188, | 154 | USB_DEVICE_ID_I6050_2 = 0x0188, |
155 | USB_DEVICE_ID_I6250 = 0x0187, | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | 158 | ||
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index 0d5081d77dc0..d3365ac85dde 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -491,6 +491,7 @@ int i2400mu_probe(struct usb_interface *iface, | |||
491 | switch (id->idProduct) { | 491 | switch (id->idProduct) { |
492 | case USB_DEVICE_ID_I6050: | 492 | case USB_DEVICE_ID_I6050: |
493 | case USB_DEVICE_ID_I6050_2: | 493 | case USB_DEVICE_ID_I6050_2: |
494 | case USB_DEVICE_ID_I6250: | ||
494 | i2400mu->i6050 = 1; | 495 | i2400mu->i6050 = 1; |
495 | break; | 496 | break; |
496 | default: | 497 | default: |
@@ -739,6 +740,7 @@ static | |||
739 | struct usb_device_id i2400mu_id_table[] = { | 740 | struct usb_device_id i2400mu_id_table[] = { |
740 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, | 741 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, |
741 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, | 742 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, |
743 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) }, | ||
742 | { USB_DEVICE(0x8086, 0x0181) }, | 744 | { USB_DEVICE(0x8086, 0x0181) }, |
743 | { USB_DEVICE(0x8086, 0x1403) }, | 745 | { USB_DEVICE(0x8086, 0x1403) }, |
744 | { USB_DEVICE(0x8086, 0x1405) }, | 746 | { USB_DEVICE(0x8086, 0x1405) }, |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index fbb7dec6ddeb..5ea87736a6ae 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -445,6 +445,7 @@ void ath_deinit_leds(struct ath_softc *sc); | |||
445 | #define SC_OP_TSF_RESET BIT(11) | 445 | #define SC_OP_TSF_RESET BIT(11) |
446 | #define SC_OP_BT_PRIORITY_DETECTED BIT(12) | 446 | #define SC_OP_BT_PRIORITY_DETECTED BIT(12) |
447 | #define SC_OP_BT_SCAN BIT(13) | 447 | #define SC_OP_BT_SCAN BIT(13) |
448 | #define SC_OP_ANI_RUN BIT(14) | ||
448 | 449 | ||
449 | /* Powersave flags */ | 450 | /* Powersave flags */ |
450 | #define PS_WAIT_FOR_BEACON BIT(0) | 451 | #define PS_WAIT_FOR_BEACON BIT(0) |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 77b359162d6c..23c15aa9fbd5 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -730,13 +730,17 @@ static int ath9k_hif_usb_alloc_urbs(struct hif_device_usb *hif_dev) | |||
730 | 730 | ||
731 | /* RX */ | 731 | /* RX */ |
732 | if (ath9k_hif_usb_alloc_rx_urbs(hif_dev) < 0) | 732 | if (ath9k_hif_usb_alloc_rx_urbs(hif_dev) < 0) |
733 | goto err; | 733 | goto err_rx; |
734 | 734 | ||
735 | /* Register Read */ | 735 | /* Register Read */ |
736 | if (ath9k_hif_usb_alloc_reg_in_urb(hif_dev) < 0) | 736 | if (ath9k_hif_usb_alloc_reg_in_urb(hif_dev) < 0) |
737 | goto err; | 737 | goto err_reg; |
738 | 738 | ||
739 | return 0; | 739 | return 0; |
740 | err_reg: | ||
741 | ath9k_hif_usb_dealloc_rx_urbs(hif_dev); | ||
742 | err_rx: | ||
743 | ath9k_hif_usb_dealloc_tx_urbs(hif_dev); | ||
740 | err: | 744 | err: |
741 | return -ENOMEM; | 745 | return -ENOMEM; |
742 | } | 746 | } |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index abfa0493236f..1e2a68ea9355 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -336,6 +336,10 @@ set_timer: | |||
336 | static void ath_start_ani(struct ath_common *common) | 336 | static void ath_start_ani(struct ath_common *common) |
337 | { | 337 | { |
338 | unsigned long timestamp = jiffies_to_msecs(jiffies); | 338 | unsigned long timestamp = jiffies_to_msecs(jiffies); |
339 | struct ath_softc *sc = (struct ath_softc *) common->priv; | ||
340 | |||
341 | if (!(sc->sc_flags & SC_OP_ANI_RUN)) | ||
342 | return; | ||
339 | 343 | ||
340 | common->ani.longcal_timer = timestamp; | 344 | common->ani.longcal_timer = timestamp; |
341 | common->ani.shortcal_timer = timestamp; | 345 | common->ani.shortcal_timer = timestamp; |
@@ -872,11 +876,13 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
872 | /* Reset rssi stats */ | 876 | /* Reset rssi stats */ |
873 | sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; | 877 | sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; |
874 | 878 | ||
879 | sc->sc_flags |= SC_OP_ANI_RUN; | ||
875 | ath_start_ani(common); | 880 | ath_start_ani(common); |
876 | } else { | 881 | } else { |
877 | ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); | 882 | ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); |
878 | common->curaid = 0; | 883 | common->curaid = 0; |
879 | /* Stop ANI */ | 884 | /* Stop ANI */ |
885 | sc->sc_flags &= ~SC_OP_ANI_RUN; | ||
880 | del_timer_sync(&common->ani.timer); | 886 | del_timer_sync(&common->ani.timer); |
881 | } | 887 | } |
882 | } | 888 | } |
@@ -1478,8 +1484,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1478 | 1484 | ||
1479 | if (vif->type == NL80211_IFTYPE_AP || | 1485 | if (vif->type == NL80211_IFTYPE_AP || |
1480 | vif->type == NL80211_IFTYPE_ADHOC || | 1486 | vif->type == NL80211_IFTYPE_ADHOC || |
1481 | vif->type == NL80211_IFTYPE_MONITOR) | 1487 | vif->type == NL80211_IFTYPE_MONITOR) { |
1488 | sc->sc_flags |= SC_OP_ANI_RUN; | ||
1482 | ath_start_ani(common); | 1489 | ath_start_ani(common); |
1490 | } | ||
1483 | 1491 | ||
1484 | out: | 1492 | out: |
1485 | mutex_unlock(&sc->mutex); | 1493 | mutex_unlock(&sc->mutex); |
@@ -1500,6 +1508,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1500 | mutex_lock(&sc->mutex); | 1508 | mutex_lock(&sc->mutex); |
1501 | 1509 | ||
1502 | /* Stop ANI */ | 1510 | /* Stop ANI */ |
1511 | sc->sc_flags &= ~SC_OP_ANI_RUN; | ||
1503 | del_timer_sync(&common->ani.timer); | 1512 | del_timer_sync(&common->ani.timer); |
1504 | 1513 | ||
1505 | /* Reclaim beacon resources */ | 1514 | /* Reclaim beacon resources */ |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index ca6065b71b46..e3e52913d83a 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -844,9 +844,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
844 | int dma_type; | 844 | int dma_type; |
845 | 845 | ||
846 | if (edma) | 846 | if (edma) |
847 | dma_type = DMA_FROM_DEVICE; | ||
848 | else | ||
849 | dma_type = DMA_BIDIRECTIONAL; | 847 | dma_type = DMA_BIDIRECTIONAL; |
848 | else | ||
849 | dma_type = DMA_FROM_DEVICE; | ||
850 | 850 | ||
851 | qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; | 851 | qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; |
852 | spin_lock_bh(&sc->rx.rxbuflock); | 852 | spin_lock_bh(&sc->rx.rxbuflock); |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index d24dc7dc0723..972a9c3af39e 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
@@ -330,6 +330,7 @@ static int prism2_pci_probe(struct pci_dev *pdev, | |||
330 | 330 | ||
331 | dev->irq = pdev->irq; | 331 | dev->irq = pdev->irq; |
332 | hw_priv->mem_start = mem; | 332 | hw_priv->mem_start = mem; |
333 | dev->base_addr = (unsigned long) mem; | ||
333 | 334 | ||
334 | prism2_pci_cor_sreset(local); | 335 | prism2_pci_cor_sreset(local); |
335 | 336 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c index 44ef5d93befc..01658cf82d39 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | |||
@@ -212,11 +212,7 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv) | |||
212 | static void iwlagn_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 212 | static void iwlagn_rts_tx_cmd_flag(struct ieee80211_tx_info *info, |
213 | __le32 *tx_flags) | 213 | __le32 *tx_flags) |
214 | { | 214 | { |
215 | if ((info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) || | 215 | *tx_flags |= TX_CMD_FLG_RTS_CTS_MSK; |
216 | (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)) | ||
217 | *tx_flags |= TX_CMD_FLG_RTS_CTS_MSK; | ||
218 | else | ||
219 | *tx_flags &= ~TX_CMD_FLG_RTS_CTS_MSK; | ||
220 | } | 216 | } |
221 | 217 | ||
222 | /* Calc max signal level (dBm) among 3 possible receivers */ | 218 | /* Calc max signal level (dBm) among 3 possible receivers */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 426e95567de3..5bbc5298ef96 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1314,7 +1314,6 @@ void iwl_configure_filter(struct ieee80211_hw *hw, | |||
1314 | changed_flags, *total_flags); | 1314 | changed_flags, *total_flags); |
1315 | 1315 | ||
1316 | CHK(FIF_OTHER_BSS | FIF_PROMISC_IN_BSS, RXON_FILTER_PROMISC_MSK); | 1316 | CHK(FIF_OTHER_BSS | FIF_PROMISC_IN_BSS, RXON_FILTER_PROMISC_MSK); |
1317 | CHK(FIF_ALLMULTI, RXON_FILTER_ACCEPT_GRP_MSK); | ||
1318 | CHK(FIF_CONTROL, RXON_FILTER_CTL2HOST_MSK); | 1317 | CHK(FIF_CONTROL, RXON_FILTER_CTL2HOST_MSK); |
1319 | CHK(FIF_BCN_PRBRESP_PROMISC, RXON_FILTER_BCON_AWARE_MSK); | 1318 | CHK(FIF_BCN_PRBRESP_PROMISC, RXON_FILTER_BCON_AWARE_MSK); |
1320 | 1319 | ||
@@ -1329,6 +1328,12 @@ void iwl_configure_filter(struct ieee80211_hw *hw, | |||
1329 | 1328 | ||
1330 | mutex_unlock(&priv->mutex); | 1329 | mutex_unlock(&priv->mutex); |
1331 | 1330 | ||
1331 | /* | ||
1332 | * Receiving all multicast frames is always enabled by the | ||
1333 | * default flags setup in iwl_connection_init_rx_config() | ||
1334 | * since we currently do not support programming multicast | ||
1335 | * filters into the device. | ||
1336 | */ | ||
1332 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS | | 1337 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS | |
1333 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | 1338 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; |
1334 | } | 1339 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h index c2a453a1a991..dc43ebd1f1fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/drivers/net/wireless/iwlwifi/iwl-sta.h | |||
@@ -97,6 +97,17 @@ static inline void iwl_clear_driver_stations(struct iwl_priv *priv) | |||
97 | spin_lock_irqsave(&priv->sta_lock, flags); | 97 | spin_lock_irqsave(&priv->sta_lock, flags); |
98 | memset(priv->stations, 0, sizeof(priv->stations)); | 98 | memset(priv->stations, 0, sizeof(priv->stations)); |
99 | priv->num_stations = 0; | 99 | priv->num_stations = 0; |
100 | |||
101 | /* | ||
102 | * Remove all key information that is not stored as part of station | ||
103 | * information since mac80211 may not have had a | ||
104 | * chance to remove all the keys. When device is reconfigured by | ||
105 | * mac80211 after an error all keys will be reconfigured. | ||
106 | */ | ||
107 | priv->ucode_key_table = 0; | ||
108 | priv->key_mapping_key = 0; | ||
109 | memset(priv->wep_keys, 0, sizeof(priv->wep_keys)); | ||
110 | |||
100 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 111 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
101 | } | 112 | } |
102 | 113 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 3ae468c4d760..f20d3eeeea7f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -854,6 +854,11 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
854 | BIT(NL80211_IFTYPE_WDS); | 854 | BIT(NL80211_IFTYPE_WDS); |
855 | 855 | ||
856 | /* | 856 | /* |
857 | * Initialize configuration work. | ||
858 | */ | ||
859 | INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); | ||
860 | |||
861 | /* | ||
857 | * Let the driver probe the device to detect the capabilities. | 862 | * Let the driver probe the device to detect the capabilities. |
858 | */ | 863 | */ |
859 | retval = rt2x00dev->ops->lib->probe_hw(rt2x00dev); | 864 | retval = rt2x00dev->ops->lib->probe_hw(rt2x00dev); |
@@ -863,11 +868,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
863 | } | 868 | } |
864 | 869 | ||
865 | /* | 870 | /* |
866 | * Initialize configuration work. | ||
867 | */ | ||
868 | INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); | ||
869 | |||
870 | /* | ||
871 | * Allocate queue array. | 871 | * Allocate queue array. |
872 | */ | 872 | */ |
873 | retval = rt2x00queue_allocate(rt2x00dev); | 873 | retval = rt2x00queue_allocate(rt2x00dev); |
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 188bc8496a26..d02be78a4138 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c | |||
@@ -176,16 +176,18 @@ static ssize_t led_proc_write(struct file *file, const char *buf, | |||
176 | size_t count, loff_t *pos) | 176 | size_t count, loff_t *pos) |
177 | { | 177 | { |
178 | void *data = PDE(file->f_path.dentry->d_inode)->data; | 178 | void *data = PDE(file->f_path.dentry->d_inode)->data; |
179 | char *cur, lbuf[count + 1]; | 179 | char *cur, lbuf[32]; |
180 | int d; | 180 | int d; |
181 | 181 | ||
182 | if (!capable(CAP_SYS_ADMIN)) | 182 | if (!capable(CAP_SYS_ADMIN)) |
183 | return -EACCES; | 183 | return -EACCES; |
184 | 184 | ||
185 | memset(lbuf, 0, count + 1); | 185 | if (count >= sizeof(lbuf)) |
186 | count = sizeof(lbuf)-1; | ||
186 | 187 | ||
187 | if (copy_from_user(lbuf, buf, count)) | 188 | if (copy_from_user(lbuf, buf, count)) |
188 | return -EFAULT; | 189 | return -EFAULT; |
190 | lbuf[count] = 0; | ||
189 | 191 | ||
190 | cur = lbuf; | 192 | cur = lbuf; |
191 | 193 | ||
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 92379e2d37e7..2aaa13150de3 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -156,6 +156,38 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, | |||
156 | pcibios_align_resource, dev); | 156 | pcibios_align_resource, dev); |
157 | } | 157 | } |
158 | 158 | ||
159 | if (ret < 0 && dev->fw_addr[resno]) { | ||
160 | struct resource *root, *conflict; | ||
161 | resource_size_t start, end; | ||
162 | |||
163 | /* | ||
164 | * If we failed to assign anything, let's try the address | ||
165 | * where firmware left it. That at least has a chance of | ||
166 | * working, which is better than just leaving it disabled. | ||
167 | */ | ||
168 | |||
169 | if (res->flags & IORESOURCE_IO) | ||
170 | root = &ioport_resource; | ||
171 | else | ||
172 | root = &iomem_resource; | ||
173 | |||
174 | start = res->start; | ||
175 | end = res->end; | ||
176 | res->start = dev->fw_addr[resno]; | ||
177 | res->end = res->start + size - 1; | ||
178 | dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n", | ||
179 | resno, res); | ||
180 | conflict = request_resource_conflict(root, res); | ||
181 | if (conflict) { | ||
182 | dev_info(&dev->dev, | ||
183 | "BAR %d: %pR conflicts with %s %pR\n", resno, | ||
184 | res, conflict->name, conflict); | ||
185 | res->start = start; | ||
186 | res->end = end; | ||
187 | } else | ||
188 | ret = 0; | ||
189 | } | ||
190 | |||
159 | if (!ret) { | 191 | if (!ret) { |
160 | res->flags &= ~IORESOURCE_STARTALIGN; | 192 | res->flags &= ~IORESOURCE_STARTALIGN; |
161 | dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); | 193 | dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 9fc339845538..eac961463be2 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -1356,6 +1356,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev, | |||
1356 | INIT_LIST_HEAD(&socket->devices_list); | 1356 | INIT_LIST_HEAD(&socket->devices_list); |
1357 | memset(&socket->pcmcia_state, 0, sizeof(u8)); | 1357 | memset(&socket->pcmcia_state, 0, sizeof(u8)); |
1358 | socket->device_count = 0; | 1358 | socket->device_count = 0; |
1359 | atomic_set(&socket->present, 0); | ||
1359 | 1360 | ||
1360 | ret = pccard_register_pcmcia(socket, &pcmcia_bus_callback); | 1361 | ret = pccard_register_pcmcia(socket, &pcmcia_bus_callback); |
1361 | if (ret) { | 1362 | if (ret) { |
@@ -1364,8 +1365,6 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev, | |||
1364 | return ret; | 1365 | return ret; |
1365 | } | 1366 | } |
1366 | 1367 | ||
1367 | atomic_set(&socket->present, 0); | ||
1368 | |||
1369 | return 0; | 1368 | return 0; |
1370 | } | 1369 | } |
1371 | 1370 | ||
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 29f91fac1dff..a4cd9adfcbc0 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -857,8 +857,10 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) | |||
857 | { | 857 | { |
858 | pcmcia_release_configuration(p_dev); | 858 | pcmcia_release_configuration(p_dev); |
859 | pcmcia_release_io(p_dev, &p_dev->io); | 859 | pcmcia_release_io(p_dev, &p_dev->io); |
860 | if (p_dev->_irq) | 860 | if (p_dev->_irq) { |
861 | free_irq(p_dev->irq, p_dev->priv); | 861 | free_irq(p_dev->irq, p_dev->priv); |
862 | p_dev->_irq = 0; | ||
863 | } | ||
862 | if (p_dev->win) | 864 | if (p_dev->win) |
863 | pcmcia_release_window(p_dev, p_dev->win); | 865 | pcmcia_release_window(p_dev, p_dev->win); |
864 | } | 866 | } |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index df4532e91b1a..f370476d5417 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
178 | unsigned long val, | 178 | unsigned long val, |
179 | struct cpufreq_freqs *freqs) | 179 | struct cpufreq_freqs *freqs) |
180 | { | 180 | { |
181 | #warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock" | ||
182 | switch (val) { | 181 | switch (val) { |
183 | case CPUFREQ_PRECHANGE: | 182 | case CPUFREQ_PRECHANGE: |
184 | if (freqs->new > freqs->old) { | 183 | if (freqs->new > freqs->old) { |
@@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
186 | "pre-updating\n", | 185 | "pre-updating\n", |
187 | freqs->new / 1000, (freqs->new / 100) % 10, | 186 | freqs->new / 1000, (freqs->new / 100) % 10, |
188 | freqs->old / 1000, (freqs->old / 100) % 10); | 187 | freqs->old / 1000, (freqs->old / 100) % 10); |
189 | pxa2xx_pcmcia_set_mcxx(skt, freqs->new); | 188 | pxa2xx_pcmcia_set_timing(skt); |
190 | } | 189 | } |
191 | break; | 190 | break; |
192 | 191 | ||
@@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
196 | "post-updating\n", | 195 | "post-updating\n", |
197 | freqs->new / 1000, (freqs->new / 100) % 10, | 196 | freqs->new / 1000, (freqs->new / 100) % 10, |
198 | freqs->old / 1000, (freqs->old / 100) % 10); | 197 | freqs->old / 1000, (freqs->old / 100) % 10); |
199 | pxa2xx_pcmcia_set_mcxx(skt, freqs->new); | 198 | pxa2xx_pcmcia_set_timing(skt); |
200 | } | 199 | } |
201 | break; | 200 | break; |
202 | } | 201 | } |
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 40658e3385b4..bb2f1fba637b 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -489,7 +489,7 @@ int intel_scu_ipc_simple_command(int cmd, int sub) | |||
489 | mutex_unlock(&ipclock); | 489 | mutex_unlock(&ipclock); |
490 | return -ENODEV; | 490 | return -ENODEV; |
491 | } | 491 | } |
492 | ipc_command(cmd << 12 | sub); | 492 | ipc_command(sub << 12 | cmd); |
493 | err = busy_loop(); | 493 | err = busy_loop(); |
494 | mutex_unlock(&ipclock); | 494 | mutex_unlock(&ipclock); |
495 | return err; | 495 | return err; |
@@ -501,9 +501,9 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command); | |||
501 | * @cmd: command | 501 | * @cmd: command |
502 | * @sub: sub type | 502 | * @sub: sub type |
503 | * @in: input data | 503 | * @in: input data |
504 | * @inlen: input length | 504 | * @inlen: input length in dwords |
505 | * @out: output data | 505 | * @out: output data |
506 | * @outlein: output length | 506 | * @outlein: output length in dwords |
507 | * | 507 | * |
508 | * Issue a command to the SCU which involves data transfers. Do the | 508 | * Issue a command to the SCU which involves data transfers. Do the |
509 | * data copies under the lock but leave it for the caller to interpret | 509 | * data copies under the lock but leave it for the caller to interpret |
@@ -524,7 +524,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, | |||
524 | for (i = 0; i < inlen; i++) | 524 | for (i = 0; i < inlen; i++) |
525 | ipc_data_writel(*in++, 4 * i); | 525 | ipc_data_writel(*in++, 4 * i); |
526 | 526 | ||
527 | ipc_command((cmd << 12) | sub | (inlen << 18)); | 527 | ipc_command((sub << 12) | cmd | (inlen << 18)); |
528 | err = busy_loop(); | 528 | err = busy_loop(); |
529 | 529 | ||
530 | for (i = 0; i < outlen; i++) | 530 | for (i = 0; i < outlen; i++) |
@@ -556,6 +556,10 @@ int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data) | |||
556 | u32 cmd = 0; | 556 | u32 cmd = 0; |
557 | 557 | ||
558 | mutex_lock(&ipclock); | 558 | mutex_lock(&ipclock); |
559 | if (ipcdev.pdev == NULL) { | ||
560 | mutex_unlock(&ipclock); | ||
561 | return -ENODEV; | ||
562 | } | ||
559 | cmd = (addr >> 24) & 0xFF; | 563 | cmd = (addr >> 24) & 0xFF; |
560 | if (cmd == IPC_I2C_READ) { | 564 | if (cmd == IPC_I2C_READ) { |
561 | writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR); | 565 | writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR); |
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c index d762a0cbc6af..84d3c43cf2bc 100644 --- a/drivers/power/ds2782_battery.c +++ b/drivers/power/ds2782_battery.c | |||
@@ -43,10 +43,9 @@ | |||
43 | struct ds278x_info; | 43 | struct ds278x_info; |
44 | 44 | ||
45 | struct ds278x_battery_ops { | 45 | struct ds278x_battery_ops { |
46 | int (*get_current)(struct ds278x_info *info, int *current_uA); | 46 | int (*get_battery_current)(struct ds278x_info *info, int *current_uA); |
47 | int (*get_voltage)(struct ds278x_info *info, int *voltage_uA); | 47 | int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA); |
48 | int (*get_capacity)(struct ds278x_info *info, int *capacity_uA); | 48 | int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA); |
49 | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) | 51 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) |
@@ -163,7 +162,7 @@ static int ds2782_get_capacity(struct ds278x_info *info, int *capacity) | |||
163 | if (err) | 162 | if (err) |
164 | return err; | 163 | return err; |
165 | *capacity = raw; | 164 | *capacity = raw; |
166 | return raw; | 165 | return 0; |
167 | } | 166 | } |
168 | 167 | ||
169 | static int ds2786_get_current(struct ds278x_info *info, int *current_uA) | 168 | static int ds2786_get_current(struct ds278x_info *info, int *current_uA) |
@@ -213,11 +212,11 @@ static int ds278x_get_status(struct ds278x_info *info, int *status) | |||
213 | int current_uA; | 212 | int current_uA; |
214 | int capacity; | 213 | int capacity; |
215 | 214 | ||
216 | err = info->ops->get_current(info, ¤t_uA); | 215 | err = info->ops->get_battery_current(info, ¤t_uA); |
217 | if (err) | 216 | if (err) |
218 | return err; | 217 | return err; |
219 | 218 | ||
220 | err = info->ops->get_capacity(info, &capacity); | 219 | err = info->ops->get_battery_capacity(info, &capacity); |
221 | if (err) | 220 | if (err) |
222 | return err; | 221 | return err; |
223 | 222 | ||
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy, | |||
246 | break; | 245 | break; |
247 | 246 | ||
248 | case POWER_SUPPLY_PROP_CAPACITY: | 247 | case POWER_SUPPLY_PROP_CAPACITY: |
249 | ret = info->ops->get_capacity(info, &val->intval); | 248 | ret = info->ops->get_battery_capacity(info, &val->intval); |
250 | break; | 249 | break; |
251 | 250 | ||
252 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | 251 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: |
253 | ret = info->ops->get_voltage(info, &val->intval); | 252 | ret = info->ops->get_battery_voltage(info, &val->intval); |
254 | break; | 253 | break; |
255 | 254 | ||
256 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 255 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
257 | ret = info->ops->get_current(info, &val->intval); | 256 | ret = info->ops->get_battery_current(info, &val->intval); |
258 | break; | 257 | break; |
259 | 258 | ||
260 | case POWER_SUPPLY_PROP_TEMP: | 259 | case POWER_SUPPLY_PROP_TEMP: |
@@ -307,14 +306,14 @@ enum ds278x_num_id { | |||
307 | 306 | ||
308 | static struct ds278x_battery_ops ds278x_ops[] = { | 307 | static struct ds278x_battery_ops ds278x_ops[] = { |
309 | [DS2782] = { | 308 | [DS2782] = { |
310 | .get_current = ds2782_get_current, | 309 | .get_battery_current = ds2782_get_current, |
311 | .get_voltage = ds2782_get_voltage, | 310 | .get_battery_voltage = ds2782_get_voltage, |
312 | .get_capacity = ds2782_get_capacity, | 311 | .get_battery_capacity = ds2782_get_capacity, |
313 | }, | 312 | }, |
314 | [DS2786] = { | 313 | [DS2786] = { |
315 | .get_current = ds2786_get_current, | 314 | .get_battery_current = ds2786_get_current, |
316 | .get_voltage = ds2786_get_voltage, | 315 | .get_battery_voltage = ds2786_get_voltage, |
317 | .get_capacity = ds2786_get_capacity, | 316 | .get_battery_capacity = ds2786_get_capacity, |
318 | } | 317 | } |
319 | }; | 318 | }; |
320 | 319 | ||
diff --git a/drivers/power/z2_battery.c b/drivers/power/z2_battery.c index 9cca465436e3..85064a9f649e 100644 --- a/drivers/power/z2_battery.c +++ b/drivers/power/z2_battery.c | |||
@@ -9,19 +9,13 @@ | |||
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/module.h> | 12 | #include <linux/module.h> |
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/power_supply.h> | ||
17 | #include <linux/i2c.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | #include <linux/interrupt.h> | ||
20 | #include <linux/gpio.h> | 13 | #include <linux/gpio.h> |
14 | #include <linux/i2c.h> | ||
21 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
22 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
23 | #include <asm/irq.h> | 17 | #include <linux/power_supply.h> |
24 | #include <asm/mach/irq.h> | 18 | #include <linux/slab.h> |
25 | #include <linux/z2_battery.h> | 19 | #include <linux/z2_battery.h> |
26 | 20 | ||
27 | #define Z2_DEFAULT_NAME "Z2" | 21 | #define Z2_DEFAULT_NAME "Z2" |
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 7b14a67bdca2..11790990277a 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -286,7 +286,7 @@ static int ab3100_list_voltage_regulator(struct regulator_dev *reg, | |||
286 | { | 286 | { |
287 | struct ab3100_regulator *abreg = reg->reg_data; | 287 | struct ab3100_regulator *abreg = reg->reg_data; |
288 | 288 | ||
289 | if (selector > abreg->voltages_len) | 289 | if (selector >= abreg->voltages_len) |
290 | return -EINVAL; | 290 | return -EINVAL; |
291 | return abreg->typ_voltages[selector]; | 291 | return abreg->typ_voltages[selector]; |
292 | } | 292 | } |
@@ -318,7 +318,7 @@ static int ab3100_get_voltage_regulator(struct regulator_dev *reg) | |||
318 | regval &= 0xE0; | 318 | regval &= 0xE0; |
319 | regval >>= 5; | 319 | regval >>= 5; |
320 | 320 | ||
321 | if (regval > abreg->voltages_len) { | 321 | if (regval >= abreg->voltages_len) { |
322 | dev_err(®->dev, | 322 | dev_err(®->dev, |
323 | "regulator register %02x contains an illegal voltage setting\n", | 323 | "regulator register %02x contains an illegal voltage setting\n", |
324 | abreg->regreg); | 324 | abreg->regreg); |
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 14b4576281c5..8152d65220f5 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/regulator/driver.h> | 23 | #include <linux/regulator/driver.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/regulator/tps6507x.h> | ||
25 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | #include <linux/mfd/tps6507x.h> | 28 | #include <linux/mfd/tps6507x.h> |
@@ -101,9 +102,12 @@ struct tps_info { | |||
101 | unsigned max_uV; | 102 | unsigned max_uV; |
102 | u8 table_len; | 103 | u8 table_len; |
103 | const u16 *table; | 104 | const u16 *table; |
105 | |||
106 | /* Does DCDC high or the low register defines output voltage? */ | ||
107 | bool defdcdc_default; | ||
104 | }; | 108 | }; |
105 | 109 | ||
106 | static const struct tps_info tps6507x_pmic_regs[] = { | 110 | static struct tps_info tps6507x_pmic_regs[] = { |
107 | { | 111 | { |
108 | .name = "VDCDC1", | 112 | .name = "VDCDC1", |
109 | .min_uV = 725000, | 113 | .min_uV = 725000, |
@@ -145,7 +149,7 @@ struct tps6507x_pmic { | |||
145 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; | 149 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; |
146 | struct tps6507x_dev *mfd; | 150 | struct tps6507x_dev *mfd; |
147 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; | 151 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; |
148 | const struct tps_info *info[TPS6507X_NUM_REGULATOR]; | 152 | struct tps_info *info[TPS6507X_NUM_REGULATOR]; |
149 | struct mutex io_lock; | 153 | struct mutex io_lock; |
150 | }; | 154 | }; |
151 | static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) | 155 | static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) |
@@ -341,10 +345,16 @@ static int tps6507x_pmic_dcdc_get_voltage(struct regulator_dev *dev) | |||
341 | reg = TPS6507X_REG_DEFDCDC1; | 345 | reg = TPS6507X_REG_DEFDCDC1; |
342 | break; | 346 | break; |
343 | case TPS6507X_DCDC_2: | 347 | case TPS6507X_DCDC_2: |
344 | reg = TPS6507X_REG_DEFDCDC2_LOW; | 348 | if (tps->info[dcdc]->defdcdc_default) |
349 | reg = TPS6507X_REG_DEFDCDC2_HIGH; | ||
350 | else | ||
351 | reg = TPS6507X_REG_DEFDCDC2_LOW; | ||
345 | break; | 352 | break; |
346 | case TPS6507X_DCDC_3: | 353 | case TPS6507X_DCDC_3: |
347 | reg = TPS6507X_REG_DEFDCDC3_LOW; | 354 | if (tps->info[dcdc]->defdcdc_default) |
355 | reg = TPS6507X_REG_DEFDCDC3_HIGH; | ||
356 | else | ||
357 | reg = TPS6507X_REG_DEFDCDC3_LOW; | ||
348 | break; | 358 | break; |
349 | default: | 359 | default: |
350 | return -EINVAL; | 360 | return -EINVAL; |
@@ -370,10 +380,16 @@ static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev, | |||
370 | reg = TPS6507X_REG_DEFDCDC1; | 380 | reg = TPS6507X_REG_DEFDCDC1; |
371 | break; | 381 | break; |
372 | case TPS6507X_DCDC_2: | 382 | case TPS6507X_DCDC_2: |
373 | reg = TPS6507X_REG_DEFDCDC2_LOW; | 383 | if (tps->info[dcdc]->defdcdc_default) |
384 | reg = TPS6507X_REG_DEFDCDC2_HIGH; | ||
385 | else | ||
386 | reg = TPS6507X_REG_DEFDCDC2_LOW; | ||
374 | break; | 387 | break; |
375 | case TPS6507X_DCDC_3: | 388 | case TPS6507X_DCDC_3: |
376 | reg = TPS6507X_REG_DEFDCDC3_LOW; | 389 | if (tps->info[dcdc]->defdcdc_default) |
390 | reg = TPS6507X_REG_DEFDCDC3_HIGH; | ||
391 | else | ||
392 | reg = TPS6507X_REG_DEFDCDC3_LOW; | ||
377 | break; | 393 | break; |
378 | default: | 394 | default: |
379 | return -EINVAL; | 395 | return -EINVAL; |
@@ -532,7 +548,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev) | |||
532 | { | 548 | { |
533 | struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); | 549 | struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); |
534 | static int desc_id; | 550 | static int desc_id; |
535 | const struct tps_info *info = &tps6507x_pmic_regs[0]; | 551 | struct tps_info *info = &tps6507x_pmic_regs[0]; |
536 | struct regulator_init_data *init_data; | 552 | struct regulator_init_data *init_data; |
537 | struct regulator_dev *rdev; | 553 | struct regulator_dev *rdev; |
538 | struct tps6507x_pmic *tps; | 554 | struct tps6507x_pmic *tps; |
@@ -569,6 +585,12 @@ int tps6507x_pmic_probe(struct platform_device *pdev) | |||
569 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { | 585 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { |
570 | /* Register the regulators */ | 586 | /* Register the regulators */ |
571 | tps->info[i] = info; | 587 | tps->info[i] = info; |
588 | if (init_data->driver_data) { | ||
589 | struct tps6507x_reg_platform_data *data = | ||
590 | init_data->driver_data; | ||
591 | tps->info[i]->defdcdc_default = data->defdcdc_default; | ||
592 | } | ||
593 | |||
572 | tps->desc[i].name = info->name; | 594 | tps->desc[i].name = info->name; |
573 | tps->desc[i].id = desc_id++; | 595 | tps->desc[i].id = desc_id++; |
574 | tps->desc[i].n_voltages = num_voltages[i]; | 596 | tps->desc[i].n_voltages = num_voltages[i]; |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 723cd1fb4867..0e6ed7db9364 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | |||
1495 | if (ret != 0) { | 1495 | if (ret != 0) { |
1496 | dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", | 1496 | dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", |
1497 | reg, ret); | 1497 | reg, ret); |
1498 | platform_device_del(pdev); | 1498 | platform_device_put(pdev); |
1499 | wm8350->pmic.pdev[reg] = NULL; | 1499 | wm8350->pmic.pdev[reg] = NULL; |
1500 | } | 1500 | } |
1501 | 1501 | ||
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 3587d9922f28..71bbefc3544e 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
@@ -456,7 +456,7 @@ static struct rtc_class_ops stv2_pl031_ops = { | |||
456 | .irq_set_freq = pl031_irq_set_freq, | 456 | .irq_set_freq = pl031_irq_set_freq, |
457 | }; | 457 | }; |
458 | 458 | ||
459 | static struct amba_id pl031_ids[] __initdata = { | 459 | static struct amba_id pl031_ids[] = { |
460 | { | 460 | { |
461 | .id = 0x00041031, | 461 | .id = 0x00041031, |
462 | .mask = 0x000fffff, | 462 | .mask = 0x000fffff, |
diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c index 9718aaaa8215..600b890a3c15 100644 --- a/drivers/rtc/rtc-rx8581.c +++ b/drivers/rtc/rtc-rx8581.c | |||
@@ -168,7 +168,7 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
168 | return -EIO; | 168 | return -EIO; |
169 | } | 169 | } |
170 | 170 | ||
171 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | 171 | err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL, |
172 | (data | RX8581_CTRL_STOP)); | 172 | (data | RX8581_CTRL_STOP)); |
173 | if (err < 0) { | 173 | if (err < 0) { |
174 | dev_err(&client->dev, "Unable to write control register\n"); | 174 | dev_err(&client->dev, "Unable to write control register\n"); |
@@ -182,6 +182,20 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
182 | return -EIO; | 182 | return -EIO; |
183 | } | 183 | } |
184 | 184 | ||
185 | /* get VLF and clear it */ | ||
186 | data = i2c_smbus_read_byte_data(client, RX8581_REG_FLAG); | ||
187 | if (data < 0) { | ||
188 | dev_err(&client->dev, "Unable to read flag register\n"); | ||
189 | return -EIO; | ||
190 | } | ||
191 | |||
192 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | ||
193 | (data & ~(RX8581_FLAG_VLF))); | ||
194 | if (err != 0) { | ||
195 | dev_err(&client->dev, "Unable to write flag register\n"); | ||
196 | return -EIO; | ||
197 | } | ||
198 | |||
185 | /* Restart the clock */ | 199 | /* Restart the clock */ |
186 | data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL); | 200 | data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL); |
187 | if (data < 0) { | 201 | if (data < 0) { |
@@ -189,8 +203,8 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
189 | return -EIO; | 203 | return -EIO; |
190 | } | 204 | } |
191 | 205 | ||
192 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | 206 | err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL, |
193 | (data | ~(RX8581_CTRL_STOP))); | 207 | (data & ~(RX8581_CTRL_STOP))); |
194 | if (err != 0) { | 208 | if (err != 0) { |
195 | dev_err(&client->dev, "Unable to write control register\n"); | 209 | dev_err(&client->dev, "Unable to write control register\n"); |
196 | return -EIO; | 210 | return -EIO; |
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 34d51dd4c539..bed7b4634ccd 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c | |||
@@ -948,8 +948,10 @@ static ssize_t dasd_alias_show(struct device *dev, | |||
948 | if (device->discipline && device->discipline->get_uid && | 948 | if (device->discipline && device->discipline->get_uid && |
949 | !device->discipline->get_uid(device, &uid)) { | 949 | !device->discipline->get_uid(device, &uid)) { |
950 | if (uid.type == UA_BASE_PAV_ALIAS || | 950 | if (uid.type == UA_BASE_PAV_ALIAS || |
951 | uid.type == UA_HYPER_PAV_ALIAS) | 951 | uid.type == UA_HYPER_PAV_ALIAS) { |
952 | dasd_put_device(device); | ||
952 | return sprintf(buf, "1\n"); | 953 | return sprintf(buf, "1\n"); |
954 | } | ||
953 | } | 955 | } |
954 | dasd_put_device(device); | 956 | dasd_put_device(device); |
955 | 957 | ||
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index ce7cb87479fe..407d0e9adfaf 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -713,7 +713,7 @@ int chsc_determine_base_channel_path_desc(struct chp_id chpid, | |||
713 | ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp); | 713 | ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp); |
714 | if (ret) | 714 | if (ret) |
715 | goto out_free; | 715 | goto out_free; |
716 | memcpy(desc, &chsc_resp->data, chsc_resp->length); | 716 | memcpy(desc, &chsc_resp->data, sizeof(*desc)); |
717 | out_free: | 717 | out_free: |
718 | kfree(chsc_resp); | 718 | kfree(chsc_resp); |
719 | return ret; | 719 | return ret; |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index e3dbeda97179..fd068bc1bd0a 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act) | |||
714 | if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) | 714 | if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) |
715 | return ZFCP_ERP_FAILED; | 715 | return ZFCP_ERP_FAILED; |
716 | 716 | ||
717 | if (mempool_resize(act->adapter->pool.status_read_data, | ||
718 | act->adapter->stat_read_buf_num, GFP_KERNEL)) | ||
719 | return ZFCP_ERP_FAILED; | ||
720 | |||
721 | if (mempool_resize(act->adapter->pool.status_read_req, | ||
722 | act->adapter->stat_read_buf_num, GFP_KERNEL)) | ||
723 | return ZFCP_ERP_FAILED; | ||
724 | |||
717 | atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); | 725 | atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); |
718 | if (zfcp_status_read_refill(act->adapter)) | 726 | if (zfcp_status_read_refill(act->adapter)) |
719 | return ZFCP_ERP_FAILED; | 727 | return ZFCP_ERP_FAILED; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 9ac6a6e4a604..71663fb77310 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) | |||
496 | 496 | ||
497 | adapter->hydra_version = bottom->adapter_type; | 497 | adapter->hydra_version = bottom->adapter_type; |
498 | adapter->timer_ticks = bottom->timer_interval; | 498 | adapter->timer_ticks = bottom->timer_interval; |
499 | adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16); | 499 | adapter->stat_read_buf_num = max(bottom->status_read_buf_num, |
500 | (u16)FSF_STATUS_READS_RECOM); | ||
500 | 501 | ||
501 | if (fc_host_permanent_port_name(shost) == -1) | 502 | if (fc_host_permanent_port_name(shost) == -1) |
502 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); | 503 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); |
@@ -719,11 +720,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio, | |||
719 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, | 720 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, |
720 | req->qtcb, sizeof(struct fsf_qtcb)); | 721 | req->qtcb, sizeof(struct fsf_qtcb)); |
721 | 722 | ||
722 | if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) { | ||
723 | zfcp_fsf_req_free(req); | ||
724 | return ERR_PTR(-EIO); | ||
725 | } | ||
726 | |||
727 | return req; | 723 | return req; |
728 | } | 724 | } |
729 | 725 | ||
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, | |||
981 | } | 977 | } |
982 | 978 | ||
983 | /* use single, unchained SBAL if it can hold the request */ | 979 | /* use single, unchained SBAL if it can hold the request */ |
984 | if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) { | 980 | if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) { |
985 | zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, | 981 | zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, |
986 | sg_req, sg_resp); | 982 | sg_req, sg_resp); |
987 | return 0; | 983 | return 0; |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 28117e130e2c..6fa5e0453176 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio) | |||
251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; | 251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; |
252 | 252 | ||
253 | spin_lock_bh(&qdio->req_q_lock); | 253 | spin_lock_bh(&qdio->req_q_lock); |
254 | if (atomic_read(&req_q->count)) | 254 | if (atomic_read(&req_q->count) || |
255 | !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) | ||
255 | return 1; | 256 | return 1; |
256 | spin_unlock_bh(&qdio->req_q_lock); | 257 | spin_unlock_bh(&qdio->req_q_lock); |
257 | return 0; | 258 | return 0; |
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio) | |||
274 | spin_unlock_bh(&qdio->req_q_lock); | 275 | spin_unlock_bh(&qdio->req_q_lock); |
275 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, | 276 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, |
276 | zfcp_qdio_sbal_check(qdio), 5 * HZ); | 277 | zfcp_qdio_sbal_check(qdio), 5 * HZ); |
278 | |||
279 | if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) | ||
280 | return -EIO; | ||
281 | |||
277 | if (ret > 0) | 282 | if (ret > 0) |
278 | return 0; | 283 | return 0; |
284 | |||
279 | if (!ret) { | 285 | if (!ret) { |
280 | atomic_inc(&qdio->req_q_full); | 286 | atomic_inc(&qdio->req_q_full); |
281 | /* assume hanging outbound queue, try queue recovery */ | 287 | /* assume hanging outbound queue, try queue recovery */ |
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio) | |||
375 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); | 381 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); |
376 | spin_unlock_bh(&qdio->req_q_lock); | 382 | spin_unlock_bh(&qdio->req_q_lock); |
377 | 383 | ||
384 | wake_up(&qdio->req_q_wq); | ||
385 | |||
378 | qdio_shutdown(qdio->adapter->ccw_device, | 386 | qdio_shutdown(qdio->adapter->ccw_device, |
379 | QDIO_FLAG_CLEANUP_USING_CLEAR); | 387 | QDIO_FLAG_CLEANUP_USING_CLEAR); |
380 | 388 | ||
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index d53e62ab09da..aacbe14e2e7a 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -554,7 +554,7 @@ static int opiocgetnext(unsigned int cmd, void __user *argp) | |||
554 | static int openprom_bsd_ioctl(struct file * file, | 554 | static int openprom_bsd_ioctl(struct file * file, |
555 | unsigned int cmd, unsigned long arg) | 555 | unsigned int cmd, unsigned long arg) |
556 | { | 556 | { |
557 | DATA *data = (DATA *) file->private_data; | 557 | DATA *data = file->private_data; |
558 | void __user *argp = (void __user *)arg; | 558 | void __user *argp = (void __user *)arg; |
559 | int err; | 559 | int err; |
560 | 560 | ||
@@ -601,7 +601,7 @@ static int openprom_bsd_ioctl(struct file * file, | |||
601 | static long openprom_ioctl(struct file * file, | 601 | static long openprom_ioctl(struct file * file, |
602 | unsigned int cmd, unsigned long arg) | 602 | unsigned int cmd, unsigned long arg) |
603 | { | 603 | { |
604 | DATA *data = (DATA *) file->private_data; | 604 | DATA *data = file->private_data; |
605 | 605 | ||
606 | switch (cmd) { | 606 | switch (cmd) { |
607 | case OPROMGETOPT: | 607 | case OPROMGETOPT: |
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index a864ccc0a342..989b9a8ba72d 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c | |||
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
277 | goto reg_crq_failed; | 277 | goto reg_crq_failed; |
278 | } | 278 | } |
279 | 279 | ||
280 | queue->cur = 0; | ||
281 | spin_lock_init(&queue->lock); | ||
282 | |||
283 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
284 | (unsigned long)hostdata); | ||
285 | |||
280 | if (request_irq(vdev->irq, | 286 | if (request_irq(vdev->irq, |
281 | rpavscsi_handle_event, | 287 | rpavscsi_handle_event, |
282 | 0, "ibmvscsi", (void *)hostdata) != 0) { | 288 | 0, "ibmvscsi", (void *)hostdata) != 0) { |
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
291 | goto req_irq_failed; | 297 | goto req_irq_failed; |
292 | } | 298 | } |
293 | 299 | ||
294 | queue->cur = 0; | ||
295 | spin_lock_init(&queue->lock); | ||
296 | |||
297 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
298 | (unsigned long)hostdata); | ||
299 | |||
300 | return retrc; | 300 | return retrc; |
301 | 301 | ||
302 | req_irq_failed: | 302 | req_irq_failed: |
303 | tasklet_kill(&hostdata->srp_task); | ||
303 | do { | 304 | do { |
304 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); | 305 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); |
305 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); | 306 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 82ea4a8226b0..f820cffb7f00 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res, | |||
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | /** | 1131 | /** |
1132 | * ipr_format_resource_path - Format the resource path for printing. | 1132 | * ipr_format_res_path - Format the resource path for printing. |
1133 | * @res_path: resource path | 1133 | * @res_path: resource path |
1134 | * @buf: buffer | 1134 | * @buf: buffer |
1135 | * | 1135 | * |
1136 | * Return value: | 1136 | * Return value: |
1137 | * pointer to buffer | 1137 | * pointer to buffer |
1138 | **/ | 1138 | **/ |
1139 | static char *ipr_format_resource_path(u8 *res_path, char *buffer) | 1139 | static char *ipr_format_res_path(u8 *res_path, char *buffer, int len) |
1140 | { | 1140 | { |
1141 | int i; | 1141 | int i; |
1142 | char *p = buffer; | ||
1142 | 1143 | ||
1143 | sprintf(buffer, "%02X", res_path[0]); | 1144 | res_path[0] = '\0'; |
1144 | for (i=1; res_path[i] != 0xff; i++) | 1145 | p += snprintf(p, buffer + len - p, "%02X", res_path[0]); |
1145 | sprintf(buffer, "%s-%02X", buffer, res_path[i]); | 1146 | for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++) |
1147 | p += snprintf(p, buffer + len - p, "-%02X", res_path[i]); | ||
1146 | 1148 | ||
1147 | return buffer; | 1149 | return buffer; |
1148 | } | 1150 | } |
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res, | |||
1187 | 1189 | ||
1188 | if (res->sdev && new_path) | 1190 | if (res->sdev && new_path) |
1189 | sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", | 1191 | sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", |
1190 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 1192 | ipr_format_res_path(res->res_path, buffer, |
1193 | sizeof(buffer))); | ||
1191 | } else { | 1194 | } else { |
1192 | res->flags = cfgtew->u.cfgte->flags; | 1195 | res->flags = cfgtew->u.cfgte->flags; |
1193 | if (res->flags & IPR_IS_IOA_RESOURCE) | 1196 | if (res->flags & IPR_IS_IOA_RESOURCE) |
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1573 | ipr_err_separator; | 1576 | ipr_err_separator; |
1574 | 1577 | ||
1575 | ipr_err("Device %d : %s", i + 1, | 1578 | ipr_err("Device %d : %s", i + 1, |
1576 | ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0])); | 1579 | ipr_format_res_path(dev_entry->res_path, buffer, |
1580 | sizeof(buffer))); | ||
1577 | ipr_log_ext_vpd(&dev_entry->vpd); | 1581 | ipr_log_ext_vpd(&dev_entry->vpd); |
1578 | 1582 | ||
1579 | ipr_err("-----New Device Information-----\n"); | 1583 | ipr_err("-----New Device Information-----\n"); |
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb, | |||
1919 | 1923 | ||
1920 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", | 1924 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", |
1921 | path_active_desc[i].desc, path_state_desc[j].desc, | 1925 | path_active_desc[i].desc, path_state_desc[j].desc, |
1922 | ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); | 1926 | ipr_format_res_path(fabric->res_path, buffer, |
1927 | sizeof(buffer))); | ||
1923 | return; | 1928 | return; |
1924 | } | 1929 | } |
1925 | } | 1930 | } |
1926 | 1931 | ||
1927 | ipr_err("Path state=%02X Resource Path=%s\n", path_state, | 1932 | ipr_err("Path state=%02X Resource Path=%s\n", path_state, |
1928 | ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); | 1933 | ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer))); |
1929 | } | 1934 | } |
1930 | 1935 | ||
1931 | static const struct { | 1936 | static const struct { |
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb, | |||
2066 | 2071 | ||
2067 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", | 2072 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", |
2068 | path_status_desc[j].desc, path_type_desc[i].desc, | 2073 | path_status_desc[j].desc, path_type_desc[i].desc, |
2069 | ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), | 2074 | ipr_format_res_path(cfg->res_path, buffer, |
2075 | sizeof(buffer)), | ||
2070 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], | 2076 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], |
2071 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); | 2077 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); |
2072 | return; | 2078 | return; |
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb, | |||
2074 | } | 2080 | } |
2075 | ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " | 2081 | ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " |
2076 | "WWN=%08X%08X\n", cfg->type_status, | 2082 | "WWN=%08X%08X\n", cfg->type_status, |
2077 | ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), | 2083 | ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)), |
2078 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], | 2084 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], |
2079 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); | 2085 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); |
2080 | } | 2086 | } |
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2139 | 2145 | ||
2140 | ipr_err("RAID %s Array Configuration: %s\n", | 2146 | ipr_err("RAID %s Array Configuration: %s\n", |
2141 | error->protection_level, | 2147 | error->protection_level, |
2142 | ipr_format_resource_path(&error->last_res_path[0], &buffer[0])); | 2148 | ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer))); |
2143 | 2149 | ||
2144 | ipr_err_separator; | 2150 | ipr_err_separator; |
2145 | 2151 | ||
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2160 | ipr_err("Array Member %d:\n", i); | 2166 | ipr_err("Array Member %d:\n", i); |
2161 | ipr_log_ext_vpd(&array_entry->vpd); | 2167 | ipr_log_ext_vpd(&array_entry->vpd); |
2162 | ipr_err("Current Location: %s", | 2168 | ipr_err("Current Location: %s", |
2163 | ipr_format_resource_path(&array_entry->res_path[0], &buffer[0])); | 2169 | ipr_format_res_path(array_entry->res_path, buffer, |
2170 | sizeof(buffer))); | ||
2164 | ipr_err("Expected Location: %s", | 2171 | ipr_err("Expected Location: %s", |
2165 | ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0])); | 2172 | ipr_format_res_path(array_entry->expected_res_path, |
2173 | buffer, sizeof(buffer))); | ||
2166 | 2174 | ||
2167 | ipr_err_separator; | 2175 | ipr_err_separator; |
2168 | } | 2176 | } |
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = { | |||
4079 | }; | 4087 | }; |
4080 | 4088 | ||
4081 | /** | 4089 | /** |
4082 | * ipr_show_resource_path - Show the resource path for this device. | 4090 | * ipr_show_resource_path - Show the resource path or the resource address for |
4091 | * this device. | ||
4083 | * @dev: device struct | 4092 | * @dev: device struct |
4084 | * @buf: buffer | 4093 | * @buf: buffer |
4085 | * | 4094 | * |
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut | |||
4097 | 4106 | ||
4098 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); | 4107 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); |
4099 | res = (struct ipr_resource_entry *)sdev->hostdata; | 4108 | res = (struct ipr_resource_entry *)sdev->hostdata; |
4100 | if (res) | 4109 | if (res && ioa_cfg->sis64) |
4101 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 4110 | len = snprintf(buf, PAGE_SIZE, "%s\n", |
4102 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 4111 | ipr_format_res_path(res->res_path, buffer, |
4112 | sizeof(buffer))); | ||
4113 | else if (res) | ||
4114 | len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no, | ||
4115 | res->bus, res->target, res->lun); | ||
4116 | |||
4103 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4117 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
4104 | return len; | 4118 | return len; |
4105 | } | 4119 | } |
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev) | |||
4351 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); | 4365 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); |
4352 | if (ioa_cfg->sis64) | 4366 | if (ioa_cfg->sis64) |
4353 | sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", | 4367 | sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", |
4354 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 4368 | ipr_format_res_path(res->res_path, buffer, |
4369 | sizeof(buffer))); | ||
4355 | return 0; | 4370 | return 0; |
4356 | } | 4371 | } |
4357 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4372 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 9ecd2259eb39..b965f3587c9d 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header { | |||
1684 | if (ipr_is_device(hostrcb)) { \ | 1684 | if (ipr_is_device(hostrcb)) { \ |
1685 | if ((hostrcb)->ioa_cfg->sis64) { \ | 1685 | if ((hostrcb)->ioa_cfg->sis64) { \ |
1686 | printk(KERN_ERR IPR_NAME ": %s: " fmt, \ | 1686 | printk(KERN_ERR IPR_NAME ": %s: " fmt, \ |
1687 | ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \ | 1687 | ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \ |
1688 | &hostrcb->rp_buffer[0]), \ | 1688 | hostrcb->rp_buffer, \ |
1689 | sizeof(hostrcb->rp_buffer)), \ | ||
1689 | __VA_ARGS__); \ | 1690 | __VA_ARGS__); \ |
1690 | } else { \ | 1691 | } else { \ |
1691 | ipr_ra_err((hostrcb)->ioa_cfg, \ | 1692 | ipr_ra_err((hostrcb)->ioa_cfg, \ |
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index b09a638d051f..50441ffe8e38 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c | |||
@@ -782,7 +782,7 @@ static int pl010_resume(struct amba_device *dev) | |||
782 | return 0; | 782 | return 0; |
783 | } | 783 | } |
784 | 784 | ||
785 | static struct amba_id pl010_ids[] __initdata = { | 785 | static struct amba_id pl010_ids[] = { |
786 | { | 786 | { |
787 | .id = 0x00041010, | 787 | .id = 0x00041010, |
788 | .mask = 0x000fffff, | 788 | .mask = 0x000fffff, |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index eb4cb480b93e..6ca7a44f29c2 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -69,9 +69,12 @@ | |||
69 | struct uart_amba_port { | 69 | struct uart_amba_port { |
70 | struct uart_port port; | 70 | struct uart_port port; |
71 | struct clk *clk; | 71 | struct clk *clk; |
72 | unsigned int im; /* interrupt mask */ | 72 | unsigned int im; /* interrupt mask */ |
73 | unsigned int old_status; | 73 | unsigned int old_status; |
74 | unsigned int ifls; /* vendor-specific */ | 74 | unsigned int ifls; /* vendor-specific */ |
75 | unsigned int lcrh_tx; /* vendor-specific */ | ||
76 | unsigned int lcrh_rx; /* vendor-specific */ | ||
77 | bool oversampling; /* vendor-specific */ | ||
75 | bool autorts; | 78 | bool autorts; |
76 | }; | 79 | }; |
77 | 80 | ||
@@ -79,16 +82,25 @@ struct uart_amba_port { | |||
79 | struct vendor_data { | 82 | struct vendor_data { |
80 | unsigned int ifls; | 83 | unsigned int ifls; |
81 | unsigned int fifosize; | 84 | unsigned int fifosize; |
85 | unsigned int lcrh_tx; | ||
86 | unsigned int lcrh_rx; | ||
87 | bool oversampling; | ||
82 | }; | 88 | }; |
83 | 89 | ||
84 | static struct vendor_data vendor_arm = { | 90 | static struct vendor_data vendor_arm = { |
85 | .ifls = UART011_IFLS_RX4_8|UART011_IFLS_TX4_8, | 91 | .ifls = UART011_IFLS_RX4_8|UART011_IFLS_TX4_8, |
86 | .fifosize = 16, | 92 | .fifosize = 16, |
93 | .lcrh_tx = UART011_LCRH, | ||
94 | .lcrh_rx = UART011_LCRH, | ||
95 | .oversampling = false, | ||
87 | }; | 96 | }; |
88 | 97 | ||
89 | static struct vendor_data vendor_st = { | 98 | static struct vendor_data vendor_st = { |
90 | .ifls = UART011_IFLS_RX_HALF|UART011_IFLS_TX_HALF, | 99 | .ifls = UART011_IFLS_RX_HALF|UART011_IFLS_TX_HALF, |
91 | .fifosize = 64, | 100 | .fifosize = 64, |
101 | .lcrh_tx = ST_UART011_LCRH_TX, | ||
102 | .lcrh_rx = ST_UART011_LCRH_RX, | ||
103 | .oversampling = true, | ||
92 | }; | 104 | }; |
93 | 105 | ||
94 | static void pl011_stop_tx(struct uart_port *port) | 106 | static void pl011_stop_tx(struct uart_port *port) |
@@ -327,12 +339,12 @@ static void pl011_break_ctl(struct uart_port *port, int break_state) | |||
327 | unsigned int lcr_h; | 339 | unsigned int lcr_h; |
328 | 340 | ||
329 | spin_lock_irqsave(&uap->port.lock, flags); | 341 | spin_lock_irqsave(&uap->port.lock, flags); |
330 | lcr_h = readw(uap->port.membase + UART011_LCRH); | 342 | lcr_h = readw(uap->port.membase + uap->lcrh_tx); |
331 | if (break_state == -1) | 343 | if (break_state == -1) |
332 | lcr_h |= UART01x_LCRH_BRK; | 344 | lcr_h |= UART01x_LCRH_BRK; |
333 | else | 345 | else |
334 | lcr_h &= ~UART01x_LCRH_BRK; | 346 | lcr_h &= ~UART01x_LCRH_BRK; |
335 | writew(lcr_h, uap->port.membase + UART011_LCRH); | 347 | writew(lcr_h, uap->port.membase + uap->lcrh_tx); |
336 | spin_unlock_irqrestore(&uap->port.lock, flags); | 348 | spin_unlock_irqrestore(&uap->port.lock, flags); |
337 | } | 349 | } |
338 | 350 | ||
@@ -393,7 +405,17 @@ static int pl011_startup(struct uart_port *port) | |||
393 | writew(cr, uap->port.membase + UART011_CR); | 405 | writew(cr, uap->port.membase + UART011_CR); |
394 | writew(0, uap->port.membase + UART011_FBRD); | 406 | writew(0, uap->port.membase + UART011_FBRD); |
395 | writew(1, uap->port.membase + UART011_IBRD); | 407 | writew(1, uap->port.membase + UART011_IBRD); |
396 | writew(0, uap->port.membase + UART011_LCRH); | 408 | writew(0, uap->port.membase + uap->lcrh_rx); |
409 | if (uap->lcrh_tx != uap->lcrh_rx) { | ||
410 | int i; | ||
411 | /* | ||
412 | * Wait 10 PCLKs before writing LCRH_TX register, | ||
413 | * to get this delay write read only register 10 times | ||
414 | */ | ||
415 | for (i = 0; i < 10; ++i) | ||
416 | writew(0xff, uap->port.membase + UART011_MIS); | ||
417 | writew(0, uap->port.membase + uap->lcrh_tx); | ||
418 | } | ||
397 | writew(0, uap->port.membase + UART01x_DR); | 419 | writew(0, uap->port.membase + UART01x_DR); |
398 | while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_BUSY) | 420 | while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_BUSY) |
399 | barrier(); | 421 | barrier(); |
@@ -422,10 +444,19 @@ static int pl011_startup(struct uart_port *port) | |||
422 | return retval; | 444 | return retval; |
423 | } | 445 | } |
424 | 446 | ||
447 | static void pl011_shutdown_channel(struct uart_amba_port *uap, | ||
448 | unsigned int lcrh) | ||
449 | { | ||
450 | unsigned long val; | ||
451 | |||
452 | val = readw(uap->port.membase + lcrh); | ||
453 | val &= ~(UART01x_LCRH_BRK | UART01x_LCRH_FEN); | ||
454 | writew(val, uap->port.membase + lcrh); | ||
455 | } | ||
456 | |||
425 | static void pl011_shutdown(struct uart_port *port) | 457 | static void pl011_shutdown(struct uart_port *port) |
426 | { | 458 | { |
427 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 459 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
428 | unsigned long val; | ||
429 | 460 | ||
430 | /* | 461 | /* |
431 | * disable all interrupts | 462 | * disable all interrupts |
@@ -450,9 +481,9 @@ static void pl011_shutdown(struct uart_port *port) | |||
450 | /* | 481 | /* |
451 | * disable break condition and fifos | 482 | * disable break condition and fifos |
452 | */ | 483 | */ |
453 | val = readw(uap->port.membase + UART011_LCRH); | 484 | pl011_shutdown_channel(uap, uap->lcrh_rx); |
454 | val &= ~(UART01x_LCRH_BRK | UART01x_LCRH_FEN); | 485 | if (uap->lcrh_rx != uap->lcrh_tx) |
455 | writew(val, uap->port.membase + UART011_LCRH); | 486 | pl011_shutdown_channel(uap, uap->lcrh_tx); |
456 | 487 | ||
457 | /* | 488 | /* |
458 | * Shut down the clock producer | 489 | * Shut down the clock producer |
@@ -472,8 +503,13 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
472 | /* | 503 | /* |
473 | * Ask the core to calculate the divisor for us. | 504 | * Ask the core to calculate the divisor for us. |
474 | */ | 505 | */ |
475 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | 506 | baud = uart_get_baud_rate(port, termios, old, 0, |
476 | quot = port->uartclk * 4 / baud; | 507 | port->uartclk/(uap->oversampling ? 8 : 16)); |
508 | |||
509 | if (baud > port->uartclk/16) | ||
510 | quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud); | ||
511 | else | ||
512 | quot = DIV_ROUND_CLOSEST(port->uartclk * 4, baud); | ||
477 | 513 | ||
478 | switch (termios->c_cflag & CSIZE) { | 514 | switch (termios->c_cflag & CSIZE) { |
479 | case CS5: | 515 | case CS5: |
@@ -552,6 +588,13 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
552 | uap->autorts = false; | 588 | uap->autorts = false; |
553 | } | 589 | } |
554 | 590 | ||
591 | if (uap->oversampling) { | ||
592 | if (baud > port->uartclk/16) | ||
593 | old_cr |= ST_UART011_CR_OVSFACT; | ||
594 | else | ||
595 | old_cr &= ~ST_UART011_CR_OVSFACT; | ||
596 | } | ||
597 | |||
555 | /* Set baud rate */ | 598 | /* Set baud rate */ |
556 | writew(quot & 0x3f, port->membase + UART011_FBRD); | 599 | writew(quot & 0x3f, port->membase + UART011_FBRD); |
557 | writew(quot >> 6, port->membase + UART011_IBRD); | 600 | writew(quot >> 6, port->membase + UART011_IBRD); |
@@ -561,7 +604,17 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
561 | * NOTE: MUST BE WRITTEN AFTER UARTLCR_M & UARTLCR_L | 604 | * NOTE: MUST BE WRITTEN AFTER UARTLCR_M & UARTLCR_L |
562 | * ----------^----------^----------^----------^----- | 605 | * ----------^----------^----------^----------^----- |
563 | */ | 606 | */ |
564 | writew(lcr_h, port->membase + UART011_LCRH); | 607 | writew(lcr_h, port->membase + uap->lcrh_rx); |
608 | if (uap->lcrh_rx != uap->lcrh_tx) { | ||
609 | int i; | ||
610 | /* | ||
611 | * Wait 10 PCLKs before writing LCRH_TX register, | ||
612 | * to get this delay write read only register 10 times | ||
613 | */ | ||
614 | for (i = 0; i < 10; ++i) | ||
615 | writew(0xff, uap->port.membase + UART011_MIS); | ||
616 | writew(lcr_h, port->membase + uap->lcrh_tx); | ||
617 | } | ||
565 | writew(old_cr, port->membase + UART011_CR); | 618 | writew(old_cr, port->membase + UART011_CR); |
566 | 619 | ||
567 | spin_unlock_irqrestore(&port->lock, flags); | 620 | spin_unlock_irqrestore(&port->lock, flags); |
@@ -688,7 +741,7 @@ pl011_console_get_options(struct uart_amba_port *uap, int *baud, | |||
688 | if (readw(uap->port.membase + UART011_CR) & UART01x_CR_UARTEN) { | 741 | if (readw(uap->port.membase + UART011_CR) & UART01x_CR_UARTEN) { |
689 | unsigned int lcr_h, ibrd, fbrd; | 742 | unsigned int lcr_h, ibrd, fbrd; |
690 | 743 | ||
691 | lcr_h = readw(uap->port.membase + UART011_LCRH); | 744 | lcr_h = readw(uap->port.membase + uap->lcrh_tx); |
692 | 745 | ||
693 | *parity = 'n'; | 746 | *parity = 'n'; |
694 | if (lcr_h & UART01x_LCRH_PEN) { | 747 | if (lcr_h & UART01x_LCRH_PEN) { |
@@ -707,6 +760,12 @@ pl011_console_get_options(struct uart_amba_port *uap, int *baud, | |||
707 | fbrd = readw(uap->port.membase + UART011_FBRD); | 760 | fbrd = readw(uap->port.membase + UART011_FBRD); |
708 | 761 | ||
709 | *baud = uap->port.uartclk * 4 / (64 * ibrd + fbrd); | 762 | *baud = uap->port.uartclk * 4 / (64 * ibrd + fbrd); |
763 | |||
764 | if (uap->oversampling) { | ||
765 | if (readw(uap->port.membase + UART011_CR) | ||
766 | & ST_UART011_CR_OVSFACT) | ||
767 | *baud *= 2; | ||
768 | } | ||
710 | } | 769 | } |
711 | } | 770 | } |
712 | 771 | ||
@@ -800,6 +859,9 @@ static int pl011_probe(struct amba_device *dev, struct amba_id *id) | |||
800 | } | 859 | } |
801 | 860 | ||
802 | uap->ifls = vendor->ifls; | 861 | uap->ifls = vendor->ifls; |
862 | uap->lcrh_rx = vendor->lcrh_rx; | ||
863 | uap->lcrh_tx = vendor->lcrh_tx; | ||
864 | uap->oversampling = vendor->oversampling; | ||
803 | uap->port.dev = &dev->dev; | 865 | uap->port.dev = &dev->dev; |
804 | uap->port.mapbase = dev->res.start; | 866 | uap->port.mapbase = dev->res.start; |
805 | uap->port.membase = base; | 867 | uap->port.membase = base; |
@@ -868,7 +930,7 @@ static int pl011_resume(struct amba_device *dev) | |||
868 | } | 930 | } |
869 | #endif | 931 | #endif |
870 | 932 | ||
871 | static struct amba_id pl011_ids[] __initdata = { | 933 | static struct amba_id pl011_ids[] = { |
872 | { | 934 | { |
873 | .id = 0x00041011, | 935 | .id = 0x00041011, |
874 | .mask = 0x000fffff, | 936 | .mask = 0x000fffff, |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index eed3c2d8dd1c..a182def7007d 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/uaccess.h> | 41 | #include <linux/uaccess.h> |
42 | 42 | ||
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/ioctls.h> | ||
44 | 45 | ||
45 | #include <asm/mach/serial_at91.h> | 46 | #include <asm/mach/serial_at91.h> |
46 | #include <mach/board.h> | 47 | #include <mach/board.h> |
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c index ed7d958b0a01..544f2e25d0e5 100644 --- a/drivers/serial/suncore.c +++ b/drivers/serial/suncore.c | |||
@@ -71,7 +71,9 @@ int sunserial_console_match(struct console *con, struct device_node *dp, | |||
71 | 71 | ||
72 | con->index = line; | 72 | con->index = line; |
73 | drv->cons = con; | 73 | drv->cons = con; |
74 | add_preferred_console(con->name, line, NULL); | 74 | |
75 | if (!console_set_on_cmdline) | ||
76 | add_preferred_console(con->name, line, NULL); | ||
75 | 77 | ||
76 | return 1; | 78 | return 1; |
77 | } | 79 | } |
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 234459c2f012..ffbf4553f665 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -1500,20 +1500,25 @@ out_unmap: | |||
1500 | static int __devexit su_remove(struct of_device *op) | 1500 | static int __devexit su_remove(struct of_device *op) |
1501 | { | 1501 | { |
1502 | struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); | 1502 | struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); |
1503 | bool kbdms = false; | ||
1503 | 1504 | ||
1504 | if (up->su_type == SU_PORT_MS || | 1505 | if (up->su_type == SU_PORT_MS || |
1505 | up->su_type == SU_PORT_KBD) { | 1506 | up->su_type == SU_PORT_KBD) |
1507 | kbdms = true; | ||
1508 | |||
1509 | if (kbdms) { | ||
1506 | #ifdef CONFIG_SERIO | 1510 | #ifdef CONFIG_SERIO |
1507 | serio_unregister_port(&up->serio); | 1511 | serio_unregister_port(&up->serio); |
1508 | #endif | 1512 | #endif |
1509 | kfree(up); | 1513 | } else if (up->port.type != PORT_UNKNOWN) |
1510 | } else if (up->port.type != PORT_UNKNOWN) { | ||
1511 | uart_remove_one_port(&sunsu_reg, &up->port); | 1514 | uart_remove_one_port(&sunsu_reg, &up->port); |
1512 | } | ||
1513 | 1515 | ||
1514 | if (up->port.membase) | 1516 | if (up->port.membase) |
1515 | of_iounmap(&op->resource[0], up->port.membase, up->reg_size); | 1517 | of_iounmap(&op->resource[0], up->port.membase, up->reg_size); |
1516 | 1518 | ||
1519 | if (kbdms) | ||
1520 | kfree(up); | ||
1521 | |||
1517 | dev_set_drvdata(&op->dev, NULL); | 1522 | dev_set_drvdata(&op->dev, NULL); |
1518 | 1523 | ||
1519 | return 0; | 1524 | return 0; |
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c index ffa111a7e9d4..97ab0a81338a 100644 --- a/drivers/spi/spi_mpc8xxx.c +++ b/drivers/spi/spi_mpc8xxx.c | |||
@@ -66,28 +66,6 @@ struct mpc8xxx_spi_reg { | |||
66 | __be32 receive; | 66 | __be32 receive; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | /* SPI Parameter RAM */ | ||
70 | struct spi_pram { | ||
71 | __be16 rbase; /* Rx Buffer descriptor base address */ | ||
72 | __be16 tbase; /* Tx Buffer descriptor base address */ | ||
73 | u8 rfcr; /* Rx function code */ | ||
74 | u8 tfcr; /* Tx function code */ | ||
75 | __be16 mrblr; /* Max receive buffer length */ | ||
76 | __be32 rstate; /* Internal */ | ||
77 | __be32 rdp; /* Internal */ | ||
78 | __be16 rbptr; /* Internal */ | ||
79 | __be16 rbc; /* Internal */ | ||
80 | __be32 rxtmp; /* Internal */ | ||
81 | __be32 tstate; /* Internal */ | ||
82 | __be32 tdp; /* Internal */ | ||
83 | __be16 tbptr; /* Internal */ | ||
84 | __be16 tbc; /* Internal */ | ||
85 | __be32 txtmp; /* Internal */ | ||
86 | __be32 res; /* Tx temp. */ | ||
87 | __be16 rpbase; /* Relocation pointer (CPM1 only) */ | ||
88 | __be16 res1; /* Reserved */ | ||
89 | }; | ||
90 | |||
91 | /* SPI Controller mode register definitions */ | 69 | /* SPI Controller mode register definitions */ |
92 | #define SPMODE_LOOP (1 << 30) | 70 | #define SPMODE_LOOP (1 << 30) |
93 | #define SPMODE_CI_INACTIVEHIGH (1 << 29) | 71 | #define SPMODE_CI_INACTIVEHIGH (1 << 29) |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 61d75507d5d0..162c95a088ed 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1596,6 +1596,7 @@ static const struct usb_device_id acm_ids[] = { | |||
1596 | { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */ | 1596 | { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */ |
1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ | 1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ |
1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ | 1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ |
1599 | { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */ | ||
1599 | 1600 | ||
1600 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ | 1601 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ |
1601 | 1602 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 83e7bbbe97fa..70cccc75a362 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1982,6 +1982,8 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
1982 | (portstatus & USB_PORT_STAT_ENABLE)) { | 1982 | (portstatus & USB_PORT_STAT_ENABLE)) { |
1983 | if (hub_is_wusb(hub)) | 1983 | if (hub_is_wusb(hub)) |
1984 | udev->speed = USB_SPEED_WIRELESS; | 1984 | udev->speed = USB_SPEED_WIRELESS; |
1985 | else if (portstatus & USB_PORT_STAT_SUPER_SPEED) | ||
1986 | udev->speed = USB_SPEED_SUPER; | ||
1985 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) | 1987 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) |
1986 | udev->speed = USB_SPEED_HIGH; | 1988 | udev->speed = USB_SPEED_HIGH; |
1987 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) | 1989 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index f22d03df8b17..db99c084df92 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -41,6 +41,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
41 | /* Philips PSC805 audio device */ | 41 | /* Philips PSC805 audio device */ |
42 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, | 42 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, |
43 | 43 | ||
44 | /* Artisman Watchdog Dongle */ | ||
45 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = | ||
46 | USB_QUIRK_CONFIG_INTF_STRINGS }, | ||
47 | |||
44 | /* Roland SC-8820 */ | 48 | /* Roland SC-8820 */ |
45 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, | 49 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, |
46 | 50 | ||
@@ -64,6 +68,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
64 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ | 68 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ |
65 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, | 69 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, |
66 | 70 | ||
71 | /* Broadcom BCM92035DGROM BT dongle */ | ||
72 | { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, | ||
73 | |||
67 | /* Action Semiconductor flash disk */ | 74 | /* Action Semiconductor flash disk */ |
68 | { USB_DEVICE(0x10d6, 0x2200), .driver_info = | 75 | { USB_DEVICE(0x10d6, 0x2200), .driver_info = |
69 | USB_QUIRK_STRING_FETCH_255 }, | 76 | USB_QUIRK_STRING_FETCH_255 }, |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index eaa79c8a9b8c..93ead19507b6 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -76,11 +76,12 @@ | |||
76 | static const char driver_name [] = "at91_udc"; | 76 | static const char driver_name [] = "at91_udc"; |
77 | static const char ep0name[] = "ep0"; | 77 | static const char ep0name[] = "ep0"; |
78 | 78 | ||
79 | #define VBUS_POLL_TIMEOUT msecs_to_jiffies(1000) | ||
79 | 80 | ||
80 | #define at91_udp_read(dev, reg) \ | 81 | #define at91_udp_read(udc, reg) \ |
81 | __raw_readl((dev)->udp_baseaddr + (reg)) | 82 | __raw_readl((udc)->udp_baseaddr + (reg)) |
82 | #define at91_udp_write(dev, reg, val) \ | 83 | #define at91_udp_write(udc, reg, val) \ |
83 | __raw_writel((val), (dev)->udp_baseaddr + (reg)) | 84 | __raw_writel((val), (udc)->udp_baseaddr + (reg)) |
84 | 85 | ||
85 | /*-------------------------------------------------------------------------*/ | 86 | /*-------------------------------------------------------------------------*/ |
86 | 87 | ||
@@ -102,8 +103,9 @@ static void proc_ep_show(struct seq_file *s, struct at91_ep *ep) | |||
102 | u32 csr; | 103 | u32 csr; |
103 | struct at91_request *req; | 104 | struct at91_request *req; |
104 | unsigned long flags; | 105 | unsigned long flags; |
106 | struct at91_udc *udc = ep->udc; | ||
105 | 107 | ||
106 | local_irq_save(flags); | 108 | spin_lock_irqsave(&udc->lock, flags); |
107 | 109 | ||
108 | csr = __raw_readl(ep->creg); | 110 | csr = __raw_readl(ep->creg); |
109 | 111 | ||
@@ -147,7 +149,7 @@ static void proc_ep_show(struct seq_file *s, struct at91_ep *ep) | |||
147 | &req->req, length, | 149 | &req->req, length, |
148 | req->req.length, req->req.buf); | 150 | req->req.length, req->req.buf); |
149 | } | 151 | } |
150 | local_irq_restore(flags); | 152 | spin_unlock_irqrestore(&udc->lock, flags); |
151 | } | 153 | } |
152 | 154 | ||
153 | static void proc_irq_show(struct seq_file *s, const char *label, u32 mask) | 155 | static void proc_irq_show(struct seq_file *s, const char *label, u32 mask) |
@@ -272,7 +274,9 @@ static void done(struct at91_ep *ep, struct at91_request *req, int status) | |||
272 | VDBG("%s done %p, status %d\n", ep->ep.name, req, status); | 274 | VDBG("%s done %p, status %d\n", ep->ep.name, req, status); |
273 | 275 | ||
274 | ep->stopped = 1; | 276 | ep->stopped = 1; |
277 | spin_unlock(&udc->lock); | ||
275 | req->req.complete(&ep->ep, &req->req); | 278 | req->req.complete(&ep->ep, &req->req); |
279 | spin_lock(&udc->lock); | ||
276 | ep->stopped = stopped; | 280 | ep->stopped = stopped; |
277 | 281 | ||
278 | /* ep0 is always ready; other endpoints need a non-empty queue */ | 282 | /* ep0 is always ready; other endpoints need a non-empty queue */ |
@@ -472,7 +476,7 @@ static int at91_ep_enable(struct usb_ep *_ep, | |||
472 | const struct usb_endpoint_descriptor *desc) | 476 | const struct usb_endpoint_descriptor *desc) |
473 | { | 477 | { |
474 | struct at91_ep *ep = container_of(_ep, struct at91_ep, ep); | 478 | struct at91_ep *ep = container_of(_ep, struct at91_ep, ep); |
475 | struct at91_udc *dev = ep->udc; | 479 | struct at91_udc *udc = ep->udc; |
476 | u16 maxpacket; | 480 | u16 maxpacket; |
477 | u32 tmp; | 481 | u32 tmp; |
478 | unsigned long flags; | 482 | unsigned long flags; |
@@ -487,7 +491,7 @@ static int at91_ep_enable(struct usb_ep *_ep, | |||
487 | return -EINVAL; | 491 | return -EINVAL; |
488 | } | 492 | } |
489 | 493 | ||
490 | if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) { | 494 | if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) { |
491 | DBG("bogus device state\n"); | 495 | DBG("bogus device state\n"); |
492 | return -ESHUTDOWN; | 496 | return -ESHUTDOWN; |
493 | } | 497 | } |
@@ -521,7 +525,7 @@ bogus_max: | |||
521 | } | 525 | } |
522 | 526 | ||
523 | ok: | 527 | ok: |
524 | local_irq_save(flags); | 528 | spin_lock_irqsave(&udc->lock, flags); |
525 | 529 | ||
526 | /* initialize endpoint to match this descriptor */ | 530 | /* initialize endpoint to match this descriptor */ |
527 | ep->is_in = usb_endpoint_dir_in(desc); | 531 | ep->is_in = usb_endpoint_dir_in(desc); |
@@ -540,10 +544,10 @@ ok: | |||
540 | * reset/init endpoint fifo. NOTE: leaves fifo_bank alone, | 544 | * reset/init endpoint fifo. NOTE: leaves fifo_bank alone, |
541 | * since endpoint resets don't reset hw pingpong state. | 545 | * since endpoint resets don't reset hw pingpong state. |
542 | */ | 546 | */ |
543 | at91_udp_write(dev, AT91_UDP_RST_EP, ep->int_mask); | 547 | at91_udp_write(udc, AT91_UDP_RST_EP, ep->int_mask); |
544 | at91_udp_write(dev, AT91_UDP_RST_EP, 0); | 548 | at91_udp_write(udc, AT91_UDP_RST_EP, 0); |
545 | 549 | ||
546 | local_irq_restore(flags); | 550 | spin_unlock_irqrestore(&udc->lock, flags); |
547 | return 0; | 551 | return 0; |
548 | } | 552 | } |
549 | 553 | ||
@@ -556,7 +560,7 @@ static int at91_ep_disable (struct usb_ep * _ep) | |||
556 | if (ep == &ep->udc->ep[0]) | 560 | if (ep == &ep->udc->ep[0]) |
557 | return -EINVAL; | 561 | return -EINVAL; |
558 | 562 | ||
559 | local_irq_save(flags); | 563 | spin_lock_irqsave(&udc->lock, flags); |
560 | 564 | ||
561 | nuke(ep, -ESHUTDOWN); | 565 | nuke(ep, -ESHUTDOWN); |
562 | 566 | ||
@@ -571,7 +575,7 @@ static int at91_ep_disable (struct usb_ep * _ep) | |||
571 | __raw_writel(0, ep->creg); | 575 | __raw_writel(0, ep->creg); |
572 | } | 576 | } |
573 | 577 | ||
574 | local_irq_restore(flags); | 578 | spin_unlock_irqrestore(&udc->lock, flags); |
575 | return 0; | 579 | return 0; |
576 | } | 580 | } |
577 | 581 | ||
@@ -607,7 +611,7 @@ static int at91_ep_queue(struct usb_ep *_ep, | |||
607 | { | 611 | { |
608 | struct at91_request *req; | 612 | struct at91_request *req; |
609 | struct at91_ep *ep; | 613 | struct at91_ep *ep; |
610 | struct at91_udc *dev; | 614 | struct at91_udc *udc; |
611 | int status; | 615 | int status; |
612 | unsigned long flags; | 616 | unsigned long flags; |
613 | 617 | ||
@@ -625,9 +629,9 @@ static int at91_ep_queue(struct usb_ep *_ep, | |||
625 | return -EINVAL; | 629 | return -EINVAL; |
626 | } | 630 | } |
627 | 631 | ||
628 | dev = ep->udc; | 632 | udc = ep->udc; |
629 | 633 | ||
630 | if (!dev || !dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) { | 634 | if (!udc || !udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) { |
631 | DBG("invalid device\n"); | 635 | DBG("invalid device\n"); |
632 | return -EINVAL; | 636 | return -EINVAL; |
633 | } | 637 | } |
@@ -635,7 +639,7 @@ static int at91_ep_queue(struct usb_ep *_ep, | |||
635 | _req->status = -EINPROGRESS; | 639 | _req->status = -EINPROGRESS; |
636 | _req->actual = 0; | 640 | _req->actual = 0; |
637 | 641 | ||
638 | local_irq_save(flags); | 642 | spin_lock_irqsave(&udc->lock, flags); |
639 | 643 | ||
640 | /* try to kickstart any empty and idle queue */ | 644 | /* try to kickstart any empty and idle queue */ |
641 | if (list_empty(&ep->queue) && !ep->stopped) { | 645 | if (list_empty(&ep->queue) && !ep->stopped) { |
@@ -653,7 +657,7 @@ static int at91_ep_queue(struct usb_ep *_ep, | |||
653 | if (is_ep0) { | 657 | if (is_ep0) { |
654 | u32 tmp; | 658 | u32 tmp; |
655 | 659 | ||
656 | if (!dev->req_pending) { | 660 | if (!udc->req_pending) { |
657 | status = -EINVAL; | 661 | status = -EINVAL; |
658 | goto done; | 662 | goto done; |
659 | } | 663 | } |
@@ -662,11 +666,11 @@ static int at91_ep_queue(struct usb_ep *_ep, | |||
662 | * defer changing CONFG until after the gadget driver | 666 | * defer changing CONFG until after the gadget driver |
663 | * reconfigures the endpoints. | 667 | * reconfigures the endpoints. |
664 | */ | 668 | */ |
665 | if (dev->wait_for_config_ack) { | 669 | if (udc->wait_for_config_ack) { |
666 | tmp = at91_udp_read(dev, AT91_UDP_GLB_STAT); | 670 | tmp = at91_udp_read(udc, AT91_UDP_GLB_STAT); |
667 | tmp ^= AT91_UDP_CONFG; | 671 | tmp ^= AT91_UDP_CONFG; |
668 | VDBG("toggle config\n"); | 672 | VDBG("toggle config\n"); |
669 | at91_udp_write(dev, AT91_UDP_GLB_STAT, tmp); | 673 | at91_udp_write(udc, AT91_UDP_GLB_STAT, tmp); |
670 | } | 674 | } |
671 | if (req->req.length == 0) { | 675 | if (req->req.length == 0) { |
672 | ep0_in_status: | 676 | ep0_in_status: |
@@ -676,7 +680,7 @@ ep0_in_status: | |||
676 | tmp &= ~SET_FX; | 680 | tmp &= ~SET_FX; |
677 | tmp |= CLR_FX | AT91_UDP_TXPKTRDY; | 681 | tmp |= CLR_FX | AT91_UDP_TXPKTRDY; |
678 | __raw_writel(tmp, ep->creg); | 682 | __raw_writel(tmp, ep->creg); |
679 | dev->req_pending = 0; | 683 | udc->req_pending = 0; |
680 | goto done; | 684 | goto done; |
681 | } | 685 | } |
682 | } | 686 | } |
@@ -695,31 +699,40 @@ ep0_in_status: | |||
695 | 699 | ||
696 | if (req && !status) { | 700 | if (req && !status) { |
697 | list_add_tail (&req->queue, &ep->queue); | 701 | list_add_tail (&req->queue, &ep->queue); |
698 | at91_udp_write(dev, AT91_UDP_IER, ep->int_mask); | 702 | at91_udp_write(udc, AT91_UDP_IER, ep->int_mask); |
699 | } | 703 | } |
700 | done: | 704 | done: |
701 | local_irq_restore(flags); | 705 | spin_unlock_irqrestore(&udc->lock, flags); |
702 | return (status < 0) ? status : 0; | 706 | return (status < 0) ? status : 0; |
703 | } | 707 | } |
704 | 708 | ||
705 | static int at91_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) | 709 | static int at91_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) |
706 | { | 710 | { |
707 | struct at91_ep *ep; | 711 | struct at91_ep *ep; |
708 | struct at91_request *req; | 712 | struct at91_request *req; |
713 | unsigned long flags; | ||
714 | struct at91_udc *udc; | ||
709 | 715 | ||
710 | ep = container_of(_ep, struct at91_ep, ep); | 716 | ep = container_of(_ep, struct at91_ep, ep); |
711 | if (!_ep || ep->ep.name == ep0name) | 717 | if (!_ep || ep->ep.name == ep0name) |
712 | return -EINVAL; | 718 | return -EINVAL; |
713 | 719 | ||
720 | udc = ep->udc; | ||
721 | |||
722 | spin_lock_irqsave(&udc->lock, flags); | ||
723 | |||
714 | /* make sure it's actually queued on this endpoint */ | 724 | /* make sure it's actually queued on this endpoint */ |
715 | list_for_each_entry (req, &ep->queue, queue) { | 725 | list_for_each_entry (req, &ep->queue, queue) { |
716 | if (&req->req == _req) | 726 | if (&req->req == _req) |
717 | break; | 727 | break; |
718 | } | 728 | } |
719 | if (&req->req != _req) | 729 | if (&req->req != _req) { |
730 | spin_unlock_irqrestore(&udc->lock, flags); | ||
720 | return -EINVAL; | 731 | return -EINVAL; |
732 | } | ||
721 | 733 | ||
722 | done(ep, req, -ECONNRESET); | 734 | done(ep, req, -ECONNRESET); |
735 | spin_unlock_irqrestore(&udc->lock, flags); | ||
723 | return 0; | 736 | return 0; |
724 | } | 737 | } |
725 | 738 | ||
@@ -736,7 +749,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value) | |||
736 | return -EINVAL; | 749 | return -EINVAL; |
737 | 750 | ||
738 | creg = ep->creg; | 751 | creg = ep->creg; |
739 | local_irq_save(flags); | 752 | spin_lock_irqsave(&udc->lock, flags); |
740 | 753 | ||
741 | csr = __raw_readl(creg); | 754 | csr = __raw_readl(creg); |
742 | 755 | ||
@@ -761,7 +774,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value) | |||
761 | __raw_writel(csr, creg); | 774 | __raw_writel(csr, creg); |
762 | } | 775 | } |
763 | 776 | ||
764 | local_irq_restore(flags); | 777 | spin_unlock_irqrestore(&udc->lock, flags); |
765 | return status; | 778 | return status; |
766 | } | 779 | } |
767 | 780 | ||
@@ -795,7 +808,7 @@ static int at91_wakeup(struct usb_gadget *gadget) | |||
795 | unsigned long flags; | 808 | unsigned long flags; |
796 | 809 | ||
797 | DBG("%s\n", __func__ ); | 810 | DBG("%s\n", __func__ ); |
798 | local_irq_save(flags); | 811 | spin_lock_irqsave(&udc->lock, flags); |
799 | 812 | ||
800 | if (!udc->clocked || !udc->suspended) | 813 | if (!udc->clocked || !udc->suspended) |
801 | goto done; | 814 | goto done; |
@@ -809,7 +822,7 @@ static int at91_wakeup(struct usb_gadget *gadget) | |||
809 | at91_udp_write(udc, AT91_UDP_GLB_STAT, glbstate); | 822 | at91_udp_write(udc, AT91_UDP_GLB_STAT, glbstate); |
810 | 823 | ||
811 | done: | 824 | done: |
812 | local_irq_restore(flags); | 825 | spin_unlock_irqrestore(&udc->lock, flags); |
813 | return status; | 826 | return status; |
814 | } | 827 | } |
815 | 828 | ||
@@ -851,8 +864,11 @@ static void stop_activity(struct at91_udc *udc) | |||
851 | ep->stopped = 1; | 864 | ep->stopped = 1; |
852 | nuke(ep, -ESHUTDOWN); | 865 | nuke(ep, -ESHUTDOWN); |
853 | } | 866 | } |
854 | if (driver) | 867 | if (driver) { |
868 | spin_unlock(&udc->lock); | ||
855 | driver->disconnect(&udc->gadget); | 869 | driver->disconnect(&udc->gadget); |
870 | spin_lock(&udc->lock); | ||
871 | } | ||
856 | 872 | ||
857 | udc_reinit(udc); | 873 | udc_reinit(udc); |
858 | } | 874 | } |
@@ -935,13 +951,13 @@ static int at91_vbus_session(struct usb_gadget *gadget, int is_active) | |||
935 | unsigned long flags; | 951 | unsigned long flags; |
936 | 952 | ||
937 | // VDBG("vbus %s\n", is_active ? "on" : "off"); | 953 | // VDBG("vbus %s\n", is_active ? "on" : "off"); |
938 | local_irq_save(flags); | 954 | spin_lock_irqsave(&udc->lock, flags); |
939 | udc->vbus = (is_active != 0); | 955 | udc->vbus = (is_active != 0); |
940 | if (udc->driver) | 956 | if (udc->driver) |
941 | pullup(udc, is_active); | 957 | pullup(udc, is_active); |
942 | else | 958 | else |
943 | pullup(udc, 0); | 959 | pullup(udc, 0); |
944 | local_irq_restore(flags); | 960 | spin_unlock_irqrestore(&udc->lock, flags); |
945 | return 0; | 961 | return 0; |
946 | } | 962 | } |
947 | 963 | ||
@@ -950,10 +966,10 @@ static int at91_pullup(struct usb_gadget *gadget, int is_on) | |||
950 | struct at91_udc *udc = to_udc(gadget); | 966 | struct at91_udc *udc = to_udc(gadget); |
951 | unsigned long flags; | 967 | unsigned long flags; |
952 | 968 | ||
953 | local_irq_save(flags); | 969 | spin_lock_irqsave(&udc->lock, flags); |
954 | udc->enabled = is_on = !!is_on; | 970 | udc->enabled = is_on = !!is_on; |
955 | pullup(udc, is_on); | 971 | pullup(udc, is_on); |
956 | local_irq_restore(flags); | 972 | spin_unlock_irqrestore(&udc->lock, flags); |
957 | return 0; | 973 | return 0; |
958 | } | 974 | } |
959 | 975 | ||
@@ -962,9 +978,9 @@ static int at91_set_selfpowered(struct usb_gadget *gadget, int is_on) | |||
962 | struct at91_udc *udc = to_udc(gadget); | 978 | struct at91_udc *udc = to_udc(gadget); |
963 | unsigned long flags; | 979 | unsigned long flags; |
964 | 980 | ||
965 | local_irq_save(flags); | 981 | spin_lock_irqsave(&udc->lock, flags); |
966 | udc->selfpowered = (is_on != 0); | 982 | udc->selfpowered = (is_on != 0); |
967 | local_irq_restore(flags); | 983 | spin_unlock_irqrestore(&udc->lock, flags); |
968 | return 0; | 984 | return 0; |
969 | } | 985 | } |
970 | 986 | ||
@@ -1226,8 +1242,11 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1226 | #undef w_length | 1242 | #undef w_length |
1227 | 1243 | ||
1228 | /* pass request up to the gadget driver */ | 1244 | /* pass request up to the gadget driver */ |
1229 | if (udc->driver) | 1245 | if (udc->driver) { |
1246 | spin_unlock(&udc->lock); | ||
1230 | status = udc->driver->setup(&udc->gadget, &pkt.r); | 1247 | status = udc->driver->setup(&udc->gadget, &pkt.r); |
1248 | spin_lock(&udc->lock); | ||
1249 | } | ||
1231 | else | 1250 | else |
1232 | status = -ENODEV; | 1251 | status = -ENODEV; |
1233 | if (status < 0) { | 1252 | if (status < 0) { |
@@ -1378,6 +1397,9 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc) | |||
1378 | struct at91_udc *udc = _udc; | 1397 | struct at91_udc *udc = _udc; |
1379 | u32 rescans = 5; | 1398 | u32 rescans = 5; |
1380 | int disable_clock = 0; | 1399 | int disable_clock = 0; |
1400 | unsigned long flags; | ||
1401 | |||
1402 | spin_lock_irqsave(&udc->lock, flags); | ||
1381 | 1403 | ||
1382 | if (!udc->clocked) { | 1404 | if (!udc->clocked) { |
1383 | clk_on(udc); | 1405 | clk_on(udc); |
@@ -1433,8 +1455,11 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc) | |||
1433 | * and then into standby to avoid drawing more than | 1455 | * and then into standby to avoid drawing more than |
1434 | * 500uA power (2500uA for some high-power configs). | 1456 | * 500uA power (2500uA for some high-power configs). |
1435 | */ | 1457 | */ |
1436 | if (udc->driver && udc->driver->suspend) | 1458 | if (udc->driver && udc->driver->suspend) { |
1459 | spin_unlock(&udc->lock); | ||
1437 | udc->driver->suspend(&udc->gadget); | 1460 | udc->driver->suspend(&udc->gadget); |
1461 | spin_lock(&udc->lock); | ||
1462 | } | ||
1438 | 1463 | ||
1439 | /* host initiated resume */ | 1464 | /* host initiated resume */ |
1440 | } else if (status & AT91_UDP_RXRSM) { | 1465 | } else if (status & AT91_UDP_RXRSM) { |
@@ -1451,8 +1476,11 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc) | |||
1451 | * would normally want to switch out of slow clock | 1476 | * would normally want to switch out of slow clock |
1452 | * mode into normal mode. | 1477 | * mode into normal mode. |
1453 | */ | 1478 | */ |
1454 | if (udc->driver && udc->driver->resume) | 1479 | if (udc->driver && udc->driver->resume) { |
1480 | spin_unlock(&udc->lock); | ||
1455 | udc->driver->resume(&udc->gadget); | 1481 | udc->driver->resume(&udc->gadget); |
1482 | spin_lock(&udc->lock); | ||
1483 | } | ||
1456 | 1484 | ||
1457 | /* endpoint IRQs are cleared by handling them */ | 1485 | /* endpoint IRQs are cleared by handling them */ |
1458 | } else { | 1486 | } else { |
@@ -1474,6 +1502,8 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc) | |||
1474 | if (disable_clock) | 1502 | if (disable_clock) |
1475 | clk_off(udc); | 1503 | clk_off(udc); |
1476 | 1504 | ||
1505 | spin_unlock_irqrestore(&udc->lock, flags); | ||
1506 | |||
1477 | return IRQ_HANDLED; | 1507 | return IRQ_HANDLED; |
1478 | } | 1508 | } |
1479 | 1509 | ||
@@ -1556,24 +1586,53 @@ static struct at91_udc controller = { | |||
1556 | /* ep6 and ep7 are also reserved (custom silicon might use them) */ | 1586 | /* ep6 and ep7 are also reserved (custom silicon might use them) */ |
1557 | }; | 1587 | }; |
1558 | 1588 | ||
1589 | static void at91_vbus_update(struct at91_udc *udc, unsigned value) | ||
1590 | { | ||
1591 | value ^= udc->board.vbus_active_low; | ||
1592 | if (value != udc->vbus) | ||
1593 | at91_vbus_session(&udc->gadget, value); | ||
1594 | } | ||
1595 | |||
1559 | static irqreturn_t at91_vbus_irq(int irq, void *_udc) | 1596 | static irqreturn_t at91_vbus_irq(int irq, void *_udc) |
1560 | { | 1597 | { |
1561 | struct at91_udc *udc = _udc; | 1598 | struct at91_udc *udc = _udc; |
1562 | unsigned value; | ||
1563 | 1599 | ||
1564 | /* vbus needs at least brief debouncing */ | 1600 | /* vbus needs at least brief debouncing */ |
1565 | udelay(10); | 1601 | udelay(10); |
1566 | value = gpio_get_value(udc->board.vbus_pin); | 1602 | at91_vbus_update(udc, gpio_get_value(udc->board.vbus_pin)); |
1567 | if (value != udc->vbus) | ||
1568 | at91_vbus_session(&udc->gadget, value); | ||
1569 | 1603 | ||
1570 | return IRQ_HANDLED; | 1604 | return IRQ_HANDLED; |
1571 | } | 1605 | } |
1572 | 1606 | ||
1607 | static void at91_vbus_timer_work(struct work_struct *work) | ||
1608 | { | ||
1609 | struct at91_udc *udc = container_of(work, struct at91_udc, | ||
1610 | vbus_timer_work); | ||
1611 | |||
1612 | at91_vbus_update(udc, gpio_get_value_cansleep(udc->board.vbus_pin)); | ||
1613 | |||
1614 | if (!timer_pending(&udc->vbus_timer)) | ||
1615 | mod_timer(&udc->vbus_timer, jiffies + VBUS_POLL_TIMEOUT); | ||
1616 | } | ||
1617 | |||
1618 | static void at91_vbus_timer(unsigned long data) | ||
1619 | { | ||
1620 | struct at91_udc *udc = (struct at91_udc *)data; | ||
1621 | |||
1622 | /* | ||
1623 | * If we are polling vbus it is likely that the gpio is on an | ||
1624 | * bus such as i2c or spi which may sleep, so schedule some work | ||
1625 | * to read the vbus gpio | ||
1626 | */ | ||
1627 | if (!work_pending(&udc->vbus_timer_work)) | ||
1628 | schedule_work(&udc->vbus_timer_work); | ||
1629 | } | ||
1630 | |||
1573 | int usb_gadget_register_driver (struct usb_gadget_driver *driver) | 1631 | int usb_gadget_register_driver (struct usb_gadget_driver *driver) |
1574 | { | 1632 | { |
1575 | struct at91_udc *udc = &controller; | 1633 | struct at91_udc *udc = &controller; |
1576 | int retval; | 1634 | int retval; |
1635 | unsigned long flags; | ||
1577 | 1636 | ||
1578 | if (!driver | 1637 | if (!driver |
1579 | || driver->speed < USB_SPEED_FULL | 1638 | || driver->speed < USB_SPEED_FULL |
@@ -1605,9 +1664,9 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
1605 | return retval; | 1664 | return retval; |
1606 | } | 1665 | } |
1607 | 1666 | ||
1608 | local_irq_disable(); | 1667 | spin_lock_irqsave(&udc->lock, flags); |
1609 | pullup(udc, 1); | 1668 | pullup(udc, 1); |
1610 | local_irq_enable(); | 1669 | spin_unlock_irqrestore(&udc->lock, flags); |
1611 | 1670 | ||
1612 | DBG("bound to %s\n", driver->driver.name); | 1671 | DBG("bound to %s\n", driver->driver.name); |
1613 | return 0; | 1672 | return 0; |
@@ -1617,15 +1676,16 @@ EXPORT_SYMBOL (usb_gadget_register_driver); | |||
1617 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) | 1676 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) |
1618 | { | 1677 | { |
1619 | struct at91_udc *udc = &controller; | 1678 | struct at91_udc *udc = &controller; |
1679 | unsigned long flags; | ||
1620 | 1680 | ||
1621 | if (!driver || driver != udc->driver || !driver->unbind) | 1681 | if (!driver || driver != udc->driver || !driver->unbind) |
1622 | return -EINVAL; | 1682 | return -EINVAL; |
1623 | 1683 | ||
1624 | local_irq_disable(); | 1684 | spin_lock_irqsave(&udc->lock, flags); |
1625 | udc->enabled = 0; | 1685 | udc->enabled = 0; |
1626 | at91_udp_write(udc, AT91_UDP_IDR, ~0); | 1686 | at91_udp_write(udc, AT91_UDP_IDR, ~0); |
1627 | pullup(udc, 0); | 1687 | pullup(udc, 0); |
1628 | local_irq_enable(); | 1688 | spin_unlock_irqrestore(&udc->lock, flags); |
1629 | 1689 | ||
1630 | driver->unbind(&udc->gadget); | 1690 | driver->unbind(&udc->gadget); |
1631 | udc->gadget.dev.driver = NULL; | 1691 | udc->gadget.dev.driver = NULL; |
@@ -1641,8 +1701,13 @@ EXPORT_SYMBOL (usb_gadget_unregister_driver); | |||
1641 | 1701 | ||
1642 | static void at91udc_shutdown(struct platform_device *dev) | 1702 | static void at91udc_shutdown(struct platform_device *dev) |
1643 | { | 1703 | { |
1704 | struct at91_udc *udc = platform_get_drvdata(dev); | ||
1705 | unsigned long flags; | ||
1706 | |||
1644 | /* force disconnect on reboot */ | 1707 | /* force disconnect on reboot */ |
1708 | spin_lock_irqsave(&udc->lock, flags); | ||
1645 | pullup(platform_get_drvdata(dev), 0); | 1709 | pullup(platform_get_drvdata(dev), 0); |
1710 | spin_unlock_irqrestore(&udc->lock, flags); | ||
1646 | } | 1711 | } |
1647 | 1712 | ||
1648 | static int __init at91udc_probe(struct platform_device *pdev) | 1713 | static int __init at91udc_probe(struct platform_device *pdev) |
@@ -1683,6 +1748,7 @@ static int __init at91udc_probe(struct platform_device *pdev) | |||
1683 | udc->board = *(struct at91_udc_data *) dev->platform_data; | 1748 | udc->board = *(struct at91_udc_data *) dev->platform_data; |
1684 | udc->pdev = pdev; | 1749 | udc->pdev = pdev; |
1685 | udc->enabled = 0; | 1750 | udc->enabled = 0; |
1751 | spin_lock_init(&udc->lock); | ||
1686 | 1752 | ||
1687 | /* rm9200 needs manual D+ pullup; off by default */ | 1753 | /* rm9200 needs manual D+ pullup; off by default */ |
1688 | if (cpu_is_at91rm9200()) { | 1754 | if (cpu_is_at91rm9200()) { |
@@ -1763,13 +1829,23 @@ static int __init at91udc_probe(struct platform_device *pdev) | |||
1763 | * Get the initial state of VBUS - we cannot expect | 1829 | * Get the initial state of VBUS - we cannot expect |
1764 | * a pending interrupt. | 1830 | * a pending interrupt. |
1765 | */ | 1831 | */ |
1766 | udc->vbus = gpio_get_value(udc->board.vbus_pin); | 1832 | udc->vbus = gpio_get_value_cansleep(udc->board.vbus_pin) ^ |
1767 | if (request_irq(udc->board.vbus_pin, at91_vbus_irq, | 1833 | udc->board.vbus_active_low; |
1768 | IRQF_DISABLED, driver_name, udc)) { | 1834 | |
1769 | DBG("request vbus irq %d failed\n", | 1835 | if (udc->board.vbus_polled) { |
1770 | udc->board.vbus_pin); | 1836 | INIT_WORK(&udc->vbus_timer_work, at91_vbus_timer_work); |
1771 | retval = -EBUSY; | 1837 | setup_timer(&udc->vbus_timer, at91_vbus_timer, |
1772 | goto fail3; | 1838 | (unsigned long)udc); |
1839 | mod_timer(&udc->vbus_timer, | ||
1840 | jiffies + VBUS_POLL_TIMEOUT); | ||
1841 | } else { | ||
1842 | if (request_irq(udc->board.vbus_pin, at91_vbus_irq, | ||
1843 | IRQF_DISABLED, driver_name, udc)) { | ||
1844 | DBG("request vbus irq %d failed\n", | ||
1845 | udc->board.vbus_pin); | ||
1846 | retval = -EBUSY; | ||
1847 | goto fail3; | ||
1848 | } | ||
1773 | } | 1849 | } |
1774 | } else { | 1850 | } else { |
1775 | DBG("no VBUS detection, assuming always-on\n"); | 1851 | DBG("no VBUS detection, assuming always-on\n"); |
@@ -1804,13 +1880,16 @@ static int __exit at91udc_remove(struct platform_device *pdev) | |||
1804 | { | 1880 | { |
1805 | struct at91_udc *udc = platform_get_drvdata(pdev); | 1881 | struct at91_udc *udc = platform_get_drvdata(pdev); |
1806 | struct resource *res; | 1882 | struct resource *res; |
1883 | unsigned long flags; | ||
1807 | 1884 | ||
1808 | DBG("remove\n"); | 1885 | DBG("remove\n"); |
1809 | 1886 | ||
1810 | if (udc->driver) | 1887 | if (udc->driver) |
1811 | return -EBUSY; | 1888 | return -EBUSY; |
1812 | 1889 | ||
1890 | spin_lock_irqsave(&udc->lock, flags); | ||
1813 | pullup(udc, 0); | 1891 | pullup(udc, 0); |
1892 | spin_unlock_irqrestore(&udc->lock, flags); | ||
1814 | 1893 | ||
1815 | device_init_wakeup(&pdev->dev, 0); | 1894 | device_init_wakeup(&pdev->dev, 0); |
1816 | remove_debug_file(udc); | 1895 | remove_debug_file(udc); |
@@ -1840,6 +1919,7 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
1840 | { | 1919 | { |
1841 | struct at91_udc *udc = platform_get_drvdata(pdev); | 1920 | struct at91_udc *udc = platform_get_drvdata(pdev); |
1842 | int wake = udc->driver && device_may_wakeup(&pdev->dev); | 1921 | int wake = udc->driver && device_may_wakeup(&pdev->dev); |
1922 | unsigned long flags; | ||
1843 | 1923 | ||
1844 | /* Unless we can act normally to the host (letting it wake us up | 1924 | /* Unless we can act normally to the host (letting it wake us up |
1845 | * whenever it has work for us) force disconnect. Wakeup requires | 1925 | * whenever it has work for us) force disconnect. Wakeup requires |
@@ -1849,13 +1929,15 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
1849 | if ((!udc->suspended && udc->addr) | 1929 | if ((!udc->suspended && udc->addr) |
1850 | || !wake | 1930 | || !wake |
1851 | || at91_suspend_entering_slow_clock()) { | 1931 | || at91_suspend_entering_slow_clock()) { |
1932 | spin_lock_irqsave(&udc->lock, flags); | ||
1852 | pullup(udc, 0); | 1933 | pullup(udc, 0); |
1853 | wake = 0; | 1934 | wake = 0; |
1935 | spin_unlock_irqrestore(&udc->lock, flags); | ||
1854 | } else | 1936 | } else |
1855 | enable_irq_wake(udc->udp_irq); | 1937 | enable_irq_wake(udc->udp_irq); |
1856 | 1938 | ||
1857 | udc->active_suspend = wake; | 1939 | udc->active_suspend = wake; |
1858 | if (udc->board.vbus_pin > 0 && wake) | 1940 | if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && wake) |
1859 | enable_irq_wake(udc->board.vbus_pin); | 1941 | enable_irq_wake(udc->board.vbus_pin); |
1860 | return 0; | 1942 | return 0; |
1861 | } | 1943 | } |
@@ -1863,15 +1945,20 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
1863 | static int at91udc_resume(struct platform_device *pdev) | 1945 | static int at91udc_resume(struct platform_device *pdev) |
1864 | { | 1946 | { |
1865 | struct at91_udc *udc = platform_get_drvdata(pdev); | 1947 | struct at91_udc *udc = platform_get_drvdata(pdev); |
1948 | unsigned long flags; | ||
1866 | 1949 | ||
1867 | if (udc->board.vbus_pin > 0 && udc->active_suspend) | 1950 | if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && |
1951 | udc->active_suspend) | ||
1868 | disable_irq_wake(udc->board.vbus_pin); | 1952 | disable_irq_wake(udc->board.vbus_pin); |
1869 | 1953 | ||
1870 | /* maybe reconnect to host; if so, clocks on */ | 1954 | /* maybe reconnect to host; if so, clocks on */ |
1871 | if (udc->active_suspend) | 1955 | if (udc->active_suspend) |
1872 | disable_irq_wake(udc->udp_irq); | 1956 | disable_irq_wake(udc->udp_irq); |
1873 | else | 1957 | else { |
1958 | spin_lock_irqsave(&udc->lock, flags); | ||
1874 | pullup(udc, 1); | 1959 | pullup(udc, 1); |
1960 | spin_unlock_irqrestore(&udc->lock, flags); | ||
1961 | } | ||
1875 | return 0; | 1962 | return 0; |
1876 | } | 1963 | } |
1877 | #else | 1964 | #else |
diff --git a/drivers/usb/gadget/at91_udc.h b/drivers/usb/gadget/at91_udc.h index c65d62295890..108ca54f9092 100644 --- a/drivers/usb/gadget/at91_udc.h +++ b/drivers/usb/gadget/at91_udc.h | |||
@@ -144,6 +144,9 @@ struct at91_udc { | |||
144 | struct proc_dir_entry *pde; | 144 | struct proc_dir_entry *pde; |
145 | void __iomem *udp_baseaddr; | 145 | void __iomem *udp_baseaddr; |
146 | int udp_irq; | 146 | int udp_irq; |
147 | spinlock_t lock; | ||
148 | struct timer_list vbus_timer; | ||
149 | struct work_struct vbus_timer_work; | ||
147 | }; | 150 | }; |
148 | 151 | ||
149 | static inline struct at91_udc *to_udc(struct usb_gadget *g) | 152 | static inline struct at91_udc *to_udc(struct usb_gadget *g) |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index d69eccf5f197..2aaa0f75c6cf 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -136,7 +136,7 @@ struct ffs_data { | |||
136 | * handling setup requests immidiatelly user space may be so | 136 | * handling setup requests immidiatelly user space may be so |
137 | * slow that another setup will be sent to the gadget but this | 137 | * slow that another setup will be sent to the gadget but this |
138 | * time not to us but another function and then there could be | 138 | * time not to us but another function and then there could be |
139 | * a race. Is taht the case? Or maybe we can use cdev->req | 139 | * a race. Is that the case? Or maybe we can use cdev->req |
140 | * after all, maybe we just need some spinlock for that? */ | 140 | * after all, maybe we just need some spinlock for that? */ |
141 | struct usb_request *ep0req; /* P: mutex */ | 141 | struct usb_request *ep0req; /* P: mutex */ |
142 | struct completion ep0req_completion; /* P: mutex */ | 142 | struct completion ep0req_completion; /* P: mutex */ |
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c index fc2611f8b326..dbe6db0184fd 100644 --- a/drivers/usb/gadget/f_uvc.c +++ b/drivers/usb/gadget/f_uvc.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #include "uvc.h" | 29 | #include "uvc.h" |
30 | 30 | ||
31 | unsigned int uvc_trace_param; | 31 | unsigned int uvc_gadget_trace_param; |
32 | 32 | ||
33 | /* -------------------------------------------------------------------------- | 33 | /* -------------------------------------------------------------------------- |
34 | * Function descriptors | 34 | * Function descriptors |
@@ -656,6 +656,6 @@ error: | |||
656 | return ret; | 656 | return ret; |
657 | } | 657 | } |
658 | 658 | ||
659 | module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR); | 659 | module_param_named(trace, uvc_gadget_trace_param, uint, S_IRUGO|S_IWUSR); |
660 | MODULE_PARM_DESC(trace, "Trace level bitmask"); | 660 | MODULE_PARM_DESC(trace, "Trace level bitmask"); |
661 | 661 | ||
diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c index d0b8bde59e59..eafa6d2c5ed7 100644 --- a/drivers/usb/gadget/fsl_mxc_udc.c +++ b/drivers/usb/gadget/fsl_mxc_udc.c | |||
@@ -30,7 +30,7 @@ int fsl_udc_clk_init(struct platform_device *pdev) | |||
30 | 30 | ||
31 | pdata = pdev->dev.platform_data; | 31 | pdata = pdev->dev.platform_data; |
32 | 32 | ||
33 | if (!cpu_is_mx35()) { | 33 | if (!cpu_is_mx35() && !cpu_is_mx25()) { |
34 | mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); | 34 | mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); |
35 | if (IS_ERR(mxc_ahb_clk)) | 35 | if (IS_ERR(mxc_ahb_clk)) |
36 | return PTR_ERR(mxc_ahb_clk); | 36 | return PTR_ERR(mxc_ahb_clk); |
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index 85b0d8921eae..980762453a9c 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -2561,7 +2561,7 @@ static void pxa_udc_shutdown(struct platform_device *_dev) | |||
2561 | udc_disable(udc); | 2561 | udc_disable(udc); |
2562 | } | 2562 | } |
2563 | 2563 | ||
2564 | #ifdef CONFIG_CPU_PXA27x | 2564 | #ifdef CONFIG_PXA27x |
2565 | extern void pxa27x_clear_otgph(void); | 2565 | extern void pxa27x_clear_otgph(void); |
2566 | #else | 2566 | #else |
2567 | #define pxa27x_clear_otgph() do {} while (0) | 2567 | #define pxa27x_clear_otgph() do {} while (0) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index e724a051bfdd..ea2b3c7ebee5 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -735,6 +735,10 @@ static void s3c2410_udc_handle_ep0_idle(struct s3c2410_udc *dev, | |||
735 | else | 735 | else |
736 | dev->ep0state = EP0_OUT_DATA_PHASE; | 736 | dev->ep0state = EP0_OUT_DATA_PHASE; |
737 | 737 | ||
738 | if (!dev->driver) | ||
739 | return; | ||
740 | |||
741 | /* deliver the request to the gadget driver */ | ||
738 | ret = dev->driver->setup(&dev->gadget, crq); | 742 | ret = dev->driver->setup(&dev->gadget, crq); |
739 | if (ret < 0) { | 743 | if (ret < 0) { |
740 | if (dev->req_config) { | 744 | if (dev->req_config) { |
diff --git a/drivers/usb/gadget/uvc.h b/drivers/usb/gadget/uvc.h index 0a705e63c936..e92454cddd7d 100644 --- a/drivers/usb/gadget/uvc.h +++ b/drivers/usb/gadget/uvc.h | |||
@@ -107,11 +107,11 @@ struct uvc_streaming_control { | |||
107 | #define UVC_WARN_MINMAX 0 | 107 | #define UVC_WARN_MINMAX 0 |
108 | #define UVC_WARN_PROBE_DEF 1 | 108 | #define UVC_WARN_PROBE_DEF 1 |
109 | 109 | ||
110 | extern unsigned int uvc_trace_param; | 110 | extern unsigned int uvc_gadget_trace_param; |
111 | 111 | ||
112 | #define uvc_trace(flag, msg...) \ | 112 | #define uvc_trace(flag, msg...) \ |
113 | do { \ | 113 | do { \ |
114 | if (uvc_trace_param & flag) \ | 114 | if (uvc_gadget_trace_param & flag) \ |
115 | printk(KERN_DEBUG "uvcvideo: " msg); \ | 115 | printk(KERN_DEBUG "uvcvideo: " msg); \ |
116 | } while (0) | 116 | } while (0) |
117 | 117 | ||
@@ -220,16 +220,10 @@ struct uvc_file_handle | |||
220 | #define to_uvc_file_handle(handle) \ | 220 | #define to_uvc_file_handle(handle) \ |
221 | container_of(handle, struct uvc_file_handle, vfh) | 221 | container_of(handle, struct uvc_file_handle, vfh) |
222 | 222 | ||
223 | extern struct v4l2_file_operations uvc_v4l2_fops; | ||
224 | |||
225 | /* ------------------------------------------------------------------------ | 223 | /* ------------------------------------------------------------------------ |
226 | * Functions | 224 | * Functions |
227 | */ | 225 | */ |
228 | 226 | ||
229 | extern int uvc_video_enable(struct uvc_video *video, int enable); | ||
230 | extern int uvc_video_init(struct uvc_video *video); | ||
231 | extern int uvc_video_pump(struct uvc_video *video); | ||
232 | |||
233 | extern void uvc_endpoint_stream(struct uvc_device *dev); | 227 | extern void uvc_endpoint_stream(struct uvc_device *dev); |
234 | 228 | ||
235 | extern void uvc_function_connect(struct uvc_device *uvc); | 229 | extern void uvc_function_connect(struct uvc_device *uvc); |
diff --git a/drivers/usb/gadget/uvc_queue.c b/drivers/usb/gadget/uvc_queue.c index 43891991bf21..f7395ac5dc17 100644 --- a/drivers/usb/gadget/uvc_queue.c +++ b/drivers/usb/gadget/uvc_queue.c | |||
@@ -78,7 +78,8 @@ | |||
78 | * | 78 | * |
79 | */ | 79 | */ |
80 | 80 | ||
81 | void uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type) | 81 | static void |
82 | uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type) | ||
82 | { | 83 | { |
83 | mutex_init(&queue->mutex); | 84 | mutex_init(&queue->mutex); |
84 | spin_lock_init(&queue->irqlock); | 85 | spin_lock_init(&queue->irqlock); |
@@ -88,6 +89,28 @@ void uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type) | |||
88 | } | 89 | } |
89 | 90 | ||
90 | /* | 91 | /* |
92 | * Free the video buffers. | ||
93 | * | ||
94 | * This function must be called with the queue lock held. | ||
95 | */ | ||
96 | static int uvc_free_buffers(struct uvc_video_queue *queue) | ||
97 | { | ||
98 | unsigned int i; | ||
99 | |||
100 | for (i = 0; i < queue->count; ++i) { | ||
101 | if (queue->buffer[i].vma_use_count != 0) | ||
102 | return -EBUSY; | ||
103 | } | ||
104 | |||
105 | if (queue->count) { | ||
106 | vfree(queue->mem); | ||
107 | queue->count = 0; | ||
108 | } | ||
109 | |||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | /* | ||
91 | * Allocate the video buffers. | 114 | * Allocate the video buffers. |
92 | * | 115 | * |
93 | * Pages are reserved to make sure they will not be swapped, as they will be | 116 | * Pages are reserved to make sure they will not be swapped, as they will be |
@@ -95,8 +118,9 @@ void uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type) | |||
95 | * | 118 | * |
96 | * Buffers will be individually mapped, so they must all be page aligned. | 119 | * Buffers will be individually mapped, so they must all be page aligned. |
97 | */ | 120 | */ |
98 | int uvc_alloc_buffers(struct uvc_video_queue *queue, unsigned int nbuffers, | 121 | static int |
99 | unsigned int buflength) | 122 | uvc_alloc_buffers(struct uvc_video_queue *queue, unsigned int nbuffers, |
123 | unsigned int buflength) | ||
100 | { | 124 | { |
101 | unsigned int bufsize = PAGE_ALIGN(buflength); | 125 | unsigned int bufsize = PAGE_ALIGN(buflength); |
102 | unsigned int i; | 126 | unsigned int i; |
@@ -150,28 +174,6 @@ done: | |||
150 | return ret; | 174 | return ret; |
151 | } | 175 | } |
152 | 176 | ||
153 | /* | ||
154 | * Free the video buffers. | ||
155 | * | ||
156 | * This function must be called with the queue lock held. | ||
157 | */ | ||
158 | int uvc_free_buffers(struct uvc_video_queue *queue) | ||
159 | { | ||
160 | unsigned int i; | ||
161 | |||
162 | for (i = 0; i < queue->count; ++i) { | ||
163 | if (queue->buffer[i].vma_use_count != 0) | ||
164 | return -EBUSY; | ||
165 | } | ||
166 | |||
167 | if (queue->count) { | ||
168 | vfree(queue->mem); | ||
169 | queue->count = 0; | ||
170 | } | ||
171 | |||
172 | return 0; | ||
173 | } | ||
174 | |||
175 | static void __uvc_query_buffer(struct uvc_buffer *buf, | 177 | static void __uvc_query_buffer(struct uvc_buffer *buf, |
176 | struct v4l2_buffer *v4l2_buf) | 178 | struct v4l2_buffer *v4l2_buf) |
177 | { | 179 | { |
@@ -195,8 +197,8 @@ static void __uvc_query_buffer(struct uvc_buffer *buf, | |||
195 | } | 197 | } |
196 | } | 198 | } |
197 | 199 | ||
198 | int uvc_query_buffer(struct uvc_video_queue *queue, | 200 | static int |
199 | struct v4l2_buffer *v4l2_buf) | 201 | uvc_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *v4l2_buf) |
200 | { | 202 | { |
201 | int ret = 0; | 203 | int ret = 0; |
202 | 204 | ||
@@ -217,8 +219,8 @@ done: | |||
217 | * Queue a video buffer. Attempting to queue a buffer that has already been | 219 | * Queue a video buffer. Attempting to queue a buffer that has already been |
218 | * queued will return -EINVAL. | 220 | * queued will return -EINVAL. |
219 | */ | 221 | */ |
220 | int uvc_queue_buffer(struct uvc_video_queue *queue, | 222 | static int |
221 | struct v4l2_buffer *v4l2_buf) | 223 | uvc_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *v4l2_buf) |
222 | { | 224 | { |
223 | struct uvc_buffer *buf; | 225 | struct uvc_buffer *buf; |
224 | unsigned long flags; | 226 | unsigned long flags; |
@@ -298,8 +300,9 @@ static int uvc_queue_waiton(struct uvc_buffer *buf, int nonblocking) | |||
298 | * Dequeue a video buffer. If nonblocking is false, block until a buffer is | 300 | * Dequeue a video buffer. If nonblocking is false, block until a buffer is |
299 | * available. | 301 | * available. |
300 | */ | 302 | */ |
301 | int uvc_dequeue_buffer(struct uvc_video_queue *queue, | 303 | static int |
302 | struct v4l2_buffer *v4l2_buf, int nonblocking) | 304 | uvc_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *v4l2_buf, |
305 | int nonblocking) | ||
303 | { | 306 | { |
304 | struct uvc_buffer *buf; | 307 | struct uvc_buffer *buf; |
305 | int ret = 0; | 308 | int ret = 0; |
@@ -359,8 +362,9 @@ done: | |||
359 | * This function implements video queue polling and is intended to be used by | 362 | * This function implements video queue polling and is intended to be used by |
360 | * the device poll handler. | 363 | * the device poll handler. |
361 | */ | 364 | */ |
362 | unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, | 365 | static unsigned int |
363 | poll_table *wait) | 366 | uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, |
367 | poll_table *wait) | ||
364 | { | 368 | { |
365 | struct uvc_buffer *buf; | 369 | struct uvc_buffer *buf; |
366 | unsigned int mask = 0; | 370 | unsigned int mask = 0; |
@@ -407,7 +411,8 @@ static struct vm_operations_struct uvc_vm_ops = { | |||
407 | * This function implements video buffer memory mapping and is intended to be | 411 | * This function implements video buffer memory mapping and is intended to be |
408 | * used by the device mmap handler. | 412 | * used by the device mmap handler. |
409 | */ | 413 | */ |
410 | int uvc_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma) | 414 | static int |
415 | uvc_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma) | ||
411 | { | 416 | { |
412 | struct uvc_buffer *uninitialized_var(buffer); | 417 | struct uvc_buffer *uninitialized_var(buffer); |
413 | struct page *page; | 418 | struct page *page; |
@@ -458,6 +463,42 @@ done: | |||
458 | } | 463 | } |
459 | 464 | ||
460 | /* | 465 | /* |
466 | * Cancel the video buffers queue. | ||
467 | * | ||
468 | * Cancelling the queue marks all buffers on the irq queue as erroneous, | ||
469 | * wakes them up and removes them from the queue. | ||
470 | * | ||
471 | * If the disconnect parameter is set, further calls to uvc_queue_buffer will | ||
472 | * fail with -ENODEV. | ||
473 | * | ||
474 | * This function acquires the irq spinlock and can be called from interrupt | ||
475 | * context. | ||
476 | */ | ||
477 | static void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect) | ||
478 | { | ||
479 | struct uvc_buffer *buf; | ||
480 | unsigned long flags; | ||
481 | |||
482 | spin_lock_irqsave(&queue->irqlock, flags); | ||
483 | while (!list_empty(&queue->irqqueue)) { | ||
484 | buf = list_first_entry(&queue->irqqueue, struct uvc_buffer, | ||
485 | queue); | ||
486 | list_del(&buf->queue); | ||
487 | buf->state = UVC_BUF_STATE_ERROR; | ||
488 | wake_up(&buf->wait); | ||
489 | } | ||
490 | /* This must be protected by the irqlock spinlock to avoid race | ||
491 | * conditions between uvc_queue_buffer and the disconnection event that | ||
492 | * could result in an interruptible wait in uvc_dequeue_buffer. Do not | ||
493 | * blindly replace this logic by checking for the UVC_DEV_DISCONNECTED | ||
494 | * state outside the queue code. | ||
495 | */ | ||
496 | if (disconnect) | ||
497 | queue->flags |= UVC_QUEUE_DISCONNECTED; | ||
498 | spin_unlock_irqrestore(&queue->irqlock, flags); | ||
499 | } | ||
500 | |||
501 | /* | ||
461 | * Enable or disable the video buffers queue. | 502 | * Enable or disable the video buffers queue. |
462 | * | 503 | * |
463 | * The queue must be enabled before starting video acquisition and must be | 504 | * The queue must be enabled before starting video acquisition and must be |
@@ -474,7 +515,7 @@ done: | |||
474 | * This function can't be called from interrupt context. Use | 515 | * This function can't be called from interrupt context. Use |
475 | * uvc_queue_cancel() instead. | 516 | * uvc_queue_cancel() instead. |
476 | */ | 517 | */ |
477 | int uvc_queue_enable(struct uvc_video_queue *queue, int enable) | 518 | static int uvc_queue_enable(struct uvc_video_queue *queue, int enable) |
478 | { | 519 | { |
479 | unsigned int i; | 520 | unsigned int i; |
480 | int ret = 0; | 521 | int ret = 0; |
@@ -503,44 +544,8 @@ done: | |||
503 | return ret; | 544 | return ret; |
504 | } | 545 | } |
505 | 546 | ||
506 | /* | 547 | static struct uvc_buffer * |
507 | * Cancel the video buffers queue. | 548 | uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) |
508 | * | ||
509 | * Cancelling the queue marks all buffers on the irq queue as erroneous, | ||
510 | * wakes them up and removes them from the queue. | ||
511 | * | ||
512 | * If the disconnect parameter is set, further calls to uvc_queue_buffer will | ||
513 | * fail with -ENODEV. | ||
514 | * | ||
515 | * This function acquires the irq spinlock and can be called from interrupt | ||
516 | * context. | ||
517 | */ | ||
518 | void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect) | ||
519 | { | ||
520 | struct uvc_buffer *buf; | ||
521 | unsigned long flags; | ||
522 | |||
523 | spin_lock_irqsave(&queue->irqlock, flags); | ||
524 | while (!list_empty(&queue->irqqueue)) { | ||
525 | buf = list_first_entry(&queue->irqqueue, struct uvc_buffer, | ||
526 | queue); | ||
527 | list_del(&buf->queue); | ||
528 | buf->state = UVC_BUF_STATE_ERROR; | ||
529 | wake_up(&buf->wait); | ||
530 | } | ||
531 | /* This must be protected by the irqlock spinlock to avoid race | ||
532 | * conditions between uvc_queue_buffer and the disconnection event that | ||
533 | * could result in an interruptible wait in uvc_dequeue_buffer. Do not | ||
534 | * blindly replace this logic by checking for the UVC_DEV_DISCONNECTED | ||
535 | * state outside the queue code. | ||
536 | */ | ||
537 | if (disconnect) | ||
538 | queue->flags |= UVC_QUEUE_DISCONNECTED; | ||
539 | spin_unlock_irqrestore(&queue->irqlock, flags); | ||
540 | } | ||
541 | |||
542 | struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, | ||
543 | struct uvc_buffer *buf) | ||
544 | { | 549 | { |
545 | struct uvc_buffer *nextbuf; | 550 | struct uvc_buffer *nextbuf; |
546 | unsigned long flags; | 551 | unsigned long flags; |
@@ -568,7 +573,7 @@ struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, | |||
568 | return nextbuf; | 573 | return nextbuf; |
569 | } | 574 | } |
570 | 575 | ||
571 | struct uvc_buffer *uvc_queue_head(struct uvc_video_queue *queue) | 576 | static struct uvc_buffer *uvc_queue_head(struct uvc_video_queue *queue) |
572 | { | 577 | { |
573 | struct uvc_buffer *buf = NULL; | 578 | struct uvc_buffer *buf = NULL; |
574 | 579 | ||
diff --git a/drivers/usb/gadget/uvc_queue.h b/drivers/usb/gadget/uvc_queue.h index 7f5a33fe7ae2..1812a8ecc5d0 100644 --- a/drivers/usb/gadget/uvc_queue.h +++ b/drivers/usb/gadget/uvc_queue.h | |||
@@ -58,30 +58,10 @@ struct uvc_video_queue { | |||
58 | struct list_head irqqueue; | 58 | struct list_head irqqueue; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | extern void uvc_queue_init(struct uvc_video_queue *queue, | ||
62 | enum v4l2_buf_type type); | ||
63 | extern int uvc_alloc_buffers(struct uvc_video_queue *queue, | ||
64 | unsigned int nbuffers, unsigned int buflength); | ||
65 | extern int uvc_free_buffers(struct uvc_video_queue *queue); | ||
66 | extern int uvc_query_buffer(struct uvc_video_queue *queue, | ||
67 | struct v4l2_buffer *v4l2_buf); | ||
68 | extern int uvc_queue_buffer(struct uvc_video_queue *queue, | ||
69 | struct v4l2_buffer *v4l2_buf); | ||
70 | extern int uvc_dequeue_buffer(struct uvc_video_queue *queue, | ||
71 | struct v4l2_buffer *v4l2_buf, int nonblocking); | ||
72 | extern int uvc_queue_enable(struct uvc_video_queue *queue, int enable); | ||
73 | extern void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect); | ||
74 | extern struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, | ||
75 | struct uvc_buffer *buf); | ||
76 | extern unsigned int uvc_queue_poll(struct uvc_video_queue *queue, | ||
77 | struct file *file, poll_table *wait); | ||
78 | extern int uvc_queue_mmap(struct uvc_video_queue *queue, | ||
79 | struct vm_area_struct *vma); | ||
80 | static inline int uvc_queue_streaming(struct uvc_video_queue *queue) | 61 | static inline int uvc_queue_streaming(struct uvc_video_queue *queue) |
81 | { | 62 | { |
82 | return queue->flags & UVC_QUEUE_STREAMING; | 63 | return queue->flags & UVC_QUEUE_STREAMING; |
83 | } | 64 | } |
84 | extern struct uvc_buffer *uvc_queue_head(struct uvc_video_queue *queue); | ||
85 | 65 | ||
86 | #endif /* __KERNEL__ */ | 66 | #endif /* __KERNEL__ */ |
87 | 67 | ||
diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c index a7989f29837e..2dcffdac86d2 100644 --- a/drivers/usb/gadget/uvc_v4l2.c +++ b/drivers/usb/gadget/uvc_v4l2.c | |||
@@ -363,7 +363,7 @@ uvc_v4l2_poll(struct file *file, poll_table *wait) | |||
363 | return mask; | 363 | return mask; |
364 | } | 364 | } |
365 | 365 | ||
366 | struct v4l2_file_operations uvc_v4l2_fops = { | 366 | static struct v4l2_file_operations uvc_v4l2_fops = { |
367 | .owner = THIS_MODULE, | 367 | .owner = THIS_MODULE, |
368 | .open = uvc_v4l2_open, | 368 | .open = uvc_v4l2_open, |
369 | .release = uvc_v4l2_release, | 369 | .release = uvc_v4l2_release, |
diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c index de8cbc46518d..b08f35438d70 100644 --- a/drivers/usb/gadget/uvc_video.c +++ b/drivers/usb/gadget/uvc_video.c | |||
@@ -271,7 +271,7 @@ error: | |||
271 | * This function fills the available USB requests (listed in req_free) with | 271 | * This function fills the available USB requests (listed in req_free) with |
272 | * video data from the queued buffers. | 272 | * video data from the queued buffers. |
273 | */ | 273 | */ |
274 | int | 274 | static int |
275 | uvc_video_pump(struct uvc_video *video) | 275 | uvc_video_pump(struct uvc_video *video) |
276 | { | 276 | { |
277 | struct usb_request *req; | 277 | struct usb_request *req; |
@@ -328,7 +328,7 @@ uvc_video_pump(struct uvc_video *video) | |||
328 | /* | 328 | /* |
329 | * Enable or disable the video stream. | 329 | * Enable or disable the video stream. |
330 | */ | 330 | */ |
331 | int | 331 | static int |
332 | uvc_video_enable(struct uvc_video *video, int enable) | 332 | uvc_video_enable(struct uvc_video *video, int enable) |
333 | { | 333 | { |
334 | unsigned int i; | 334 | unsigned int i; |
@@ -367,7 +367,7 @@ uvc_video_enable(struct uvc_video *video, int enable) | |||
367 | /* | 367 | /* |
368 | * Initialize the UVC video stream. | 368 | * Initialize the UVC video stream. |
369 | */ | 369 | */ |
370 | int | 370 | static int |
371 | uvc_video_init(struct uvc_video *video) | 371 | uvc_video_init(struct uvc_video *video) |
372 | { | 372 | { |
373 | INIT_LIST_HEAD(&video->req_free); | 373 | INIT_LIST_HEAD(&video->req_free); |
diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index 417fd6887698..f5f3030cc416 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c | |||
@@ -28,10 +28,10 @@ | |||
28 | #include "config.c" | 28 | #include "config.c" |
29 | #include "epautoconf.c" | 29 | #include "epautoconf.c" |
30 | 30 | ||
31 | #include "f_uvc.c" | ||
32 | #include "uvc_queue.c" | 31 | #include "uvc_queue.c" |
33 | #include "uvc_v4l2.c" | ||
34 | #include "uvc_video.c" | 32 | #include "uvc_video.c" |
33 | #include "uvc_v4l2.c" | ||
34 | #include "f_uvc.c" | ||
35 | 35 | ||
36 | /* -------------------------------------------------------------------------- | 36 | /* -------------------------------------------------------------------------- |
37 | * Device descriptor | 37 | * Device descriptor |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index bd4027745aa7..a8ad8ac120a2 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -182,7 +182,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
182 | } | 182 | } |
183 | clk_enable(priv->usbclk); | 183 | clk_enable(priv->usbclk); |
184 | 184 | ||
185 | if (!cpu_is_mx35()) { | 185 | if (!cpu_is_mx35() && !cpu_is_mx25()) { |
186 | priv->ahbclk = clk_get(dev, "usb_ahb"); | 186 | priv->ahbclk = clk_get(dev, "usb_ahb"); |
187 | if (IS_ERR(priv->ahbclk)) { | 187 | if (IS_ERR(priv->ahbclk)) { |
188 | ret = PTR_ERR(priv->ahbclk); | 188 | ret = PTR_ERR(priv->ahbclk); |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index a18debdd79b8..418163894775 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -203,7 +203,7 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci *ohci) | |||
203 | __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR); | 203 | __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR); |
204 | } | 204 | } |
205 | 205 | ||
206 | #ifdef CONFIG_CPU_PXA27x | 206 | #ifdef CONFIG_PXA27x |
207 | extern void pxa27x_clear_otgph(void); | 207 | extern void pxa27x_clear_otgph(void); |
208 | #else | 208 | #else |
209 | #define pxa27x_clear_otgph() do {} while (0) | 209 | #define pxa27x_clear_otgph() do {} while (0) |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index fd9e03afd91c..2eb658d26394 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -835,6 +835,27 @@ fail: | |||
835 | return 0; | 835 | return 0; |
836 | } | 836 | } |
837 | 837 | ||
838 | void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | ||
839 | struct usb_device *udev) | ||
840 | { | ||
841 | struct xhci_virt_device *virt_dev; | ||
842 | struct xhci_ep_ctx *ep0_ctx; | ||
843 | struct xhci_ring *ep_ring; | ||
844 | |||
845 | virt_dev = xhci->devs[udev->slot_id]; | ||
846 | ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0); | ||
847 | ep_ring = virt_dev->eps[0].ring; | ||
848 | /* | ||
849 | * FIXME we don't keep track of the dequeue pointer very well after a | ||
850 | * Set TR dequeue pointer, so we're setting the dequeue pointer of the | ||
851 | * host to our enqueue pointer. This should only be called after a | ||
852 | * configured device has reset, so all control transfers should have | ||
853 | * been completed or cancelled before the reset. | ||
854 | */ | ||
855 | ep0_ctx->deq = xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue); | ||
856 | ep0_ctx->deq |= ep_ring->cycle_state; | ||
857 | } | ||
858 | |||
838 | /* Setup an xHCI virtual device for a Set Address command */ | 859 | /* Setup an xHCI virtual device for a Set Address command */ |
839 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) | 860 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) |
840 | { | 861 | { |
@@ -1002,7 +1023,7 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1002 | return EP_INTERVAL(interval); | 1023 | return EP_INTERVAL(interval); |
1003 | } | 1024 | } |
1004 | 1025 | ||
1005 | /* The "Mult" field in the endpoint context is only set for SuperSpeed devices. | 1026 | /* The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps. |
1006 | * High speed endpoint descriptors can define "the number of additional | 1027 | * High speed endpoint descriptors can define "the number of additional |
1007 | * transaction opportunities per microframe", but that goes in the Max Burst | 1028 | * transaction opportunities per microframe", but that goes in the Max Burst |
1008 | * endpoint context field. | 1029 | * endpoint context field. |
@@ -1010,7 +1031,8 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1010 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | 1031 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, |
1011 | struct usb_host_endpoint *ep) | 1032 | struct usb_host_endpoint *ep) |
1012 | { | 1033 | { |
1013 | if (udev->speed != USB_SPEED_SUPER) | 1034 | if (udev->speed != USB_SPEED_SUPER || |
1035 | !usb_endpoint_xfer_isoc(&ep->desc)) | ||
1014 | return 0; | 1036 | return 0; |
1015 | return ep->ss_ep_comp.bmAttributes; | 1037 | return ep->ss_ep_comp.bmAttributes; |
1016 | } | 1038 | } |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 94e6934edb09..bfc99a939455 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -2380,16 +2380,19 @@ static int queue_command(struct xhci_hcd *xhci, u32 field1, u32 field2, | |||
2380 | u32 field3, u32 field4, bool command_must_succeed) | 2380 | u32 field3, u32 field4, bool command_must_succeed) |
2381 | { | 2381 | { |
2382 | int reserved_trbs = xhci->cmd_ring_reserved_trbs; | 2382 | int reserved_trbs = xhci->cmd_ring_reserved_trbs; |
2383 | int ret; | ||
2384 | |||
2383 | if (!command_must_succeed) | 2385 | if (!command_must_succeed) |
2384 | reserved_trbs++; | 2386 | reserved_trbs++; |
2385 | 2387 | ||
2386 | if (!room_on_ring(xhci, xhci->cmd_ring, reserved_trbs)) { | 2388 | ret = prepare_ring(xhci, xhci->cmd_ring, EP_STATE_RUNNING, |
2387 | if (!in_interrupt()) | 2389 | reserved_trbs, GFP_ATOMIC); |
2388 | xhci_err(xhci, "ERR: No room for command on command ring\n"); | 2390 | if (ret < 0) { |
2391 | xhci_err(xhci, "ERR: No room for command on command ring\n"); | ||
2389 | if (command_must_succeed) | 2392 | if (command_must_succeed) |
2390 | xhci_err(xhci, "ERR: Reserved TRB counting for " | 2393 | xhci_err(xhci, "ERR: Reserved TRB counting for " |
2391 | "unfailable commands failed.\n"); | 2394 | "unfailable commands failed.\n"); |
2392 | return -ENOMEM; | 2395 | return ret; |
2393 | } | 2396 | } |
2394 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, | 2397 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, |
2395 | field4 | xhci->cmd_ring->cycle_state); | 2398 | field4 | xhci->cmd_ring->cycle_state); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 27345cd04da0..3998f72cd0c4 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2134,6 +2134,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2134 | /* If this is a Set Address to an unconfigured device, setup ep 0 */ | 2134 | /* If this is a Set Address to an unconfigured device, setup ep 0 */ |
2135 | if (!udev->config) | 2135 | if (!udev->config) |
2136 | xhci_setup_addressable_virt_dev(xhci, udev); | 2136 | xhci_setup_addressable_virt_dev(xhci, udev); |
2137 | else | ||
2138 | xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev); | ||
2137 | /* Otherwise, assume the core has the device configured how it wants */ | 2139 | /* Otherwise, assume the core has the device configured how it wants */ |
2138 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); | 2140 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); |
2139 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); | 2141 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 8b4b7d39f79c..6c7e3430ec93 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1292,6 +1292,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags); | |||
1292 | void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); | 1292 | void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); |
1293 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); | 1293 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); |
1294 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); | 1294 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); |
1295 | void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | ||
1296 | struct usb_device *udev); | ||
1295 | unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); | 1297 | unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); |
1296 | unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc); | 1298 | unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc); |
1297 | unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index); | 1299 | unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index); |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 30d930386b65..d25814c172b2 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -2436,7 +2436,8 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2436 | } | 2436 | } |
2437 | 2437 | ||
2438 | if (!sisusb->devinit) { | 2438 | if (!sisusb->devinit) { |
2439 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) { | 2439 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH || |
2440 | sisusb->sisusb_dev->speed == USB_SPEED_SUPER) { | ||
2440 | if (sisusb_init_gfxdevice(sisusb, 0)) { | 2441 | if (sisusb_init_gfxdevice(sisusb, 0)) { |
2441 | mutex_unlock(&sisusb->lock); | 2442 | mutex_unlock(&sisusb->lock); |
2442 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); | 2443 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); |
@@ -3166,7 +3167,7 @@ static int sisusb_probe(struct usb_interface *intf, | |||
3166 | 3167 | ||
3167 | sisusb->present = 1; | 3168 | sisusb->present = 1; |
3168 | 3169 | ||
3169 | if (dev->speed == USB_SPEED_HIGH) { | 3170 | if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) { |
3170 | int initscreen = 1; | 3171 | int initscreen = 1; |
3171 | #ifdef INCL_SISUSB_CON | 3172 | #ifdef INCL_SISUSB_CON |
3172 | if (sisusb_first_vc > 0 && | 3173 | if (sisusb_first_vc > 0 && |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 05c077f8f9ac..3c48e77a0aa2 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -29,19 +29,6 @@ static void tusb_source_power(struct musb *musb, int is_on); | |||
29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) | 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) |
30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) | 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) |
31 | 31 | ||
32 | #ifdef CONFIG_PM | ||
33 | /* REVISIT: These should be only needed if somebody implements off idle */ | ||
34 | void musb_platform_save_context(struct musb *musb, | ||
35 | struct musb_context_registers *musb_context) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void musb_platform_restore_context(struct musb *musb, | ||
40 | struct musb_context_registers *musb_context) | ||
41 | { | ||
42 | } | ||
43 | #endif | ||
44 | |||
45 | /* | 32 | /* |
46 | * Checks the revision. We need to use the DMA register as 3.0 does not | 33 | * Checks the revision. We need to use the DMA register as 3.0 does not |
47 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. | 34 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index da7e334b0407..e298dc4baed7 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -691,6 +691,7 @@ static struct usb_device_id id_table_combined [] = { | |||
691 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), | 691 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), |
692 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, | 692 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, |
693 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 693 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
694 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | ||
694 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 695 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
695 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 696 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
696 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 697 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
@@ -737,6 +738,14 @@ static struct usb_device_id id_table_combined [] = { | |||
737 | { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, | 738 | { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, |
738 | { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, | 739 | { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, |
739 | { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, | 740 | { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, |
741 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), | ||
742 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
743 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), | ||
744 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
745 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), | ||
746 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
747 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), | ||
748 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
740 | { }, /* Optional parameter entry */ | 749 | { }, /* Optional parameter entry */ |
741 | { } /* Terminating entry */ | 750 | { } /* Terminating entry */ |
742 | }; | 751 | }; |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index bbc159a1df45..d01946db8fac 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -696,6 +696,12 @@ | |||
696 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ | 696 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ |
697 | 697 | ||
698 | /* | 698 | /* |
699 | * RT Systems programming cables for various ham radios | ||
700 | */ | ||
701 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | ||
702 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | ||
703 | |||
704 | /* | ||
699 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. | 705 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. |
700 | * http://winglucofacts.com/cables/ | 706 | * http://winglucofacts.com/cables/ |
701 | */ | 707 | */ |
@@ -1017,3 +1023,12 @@ | |||
1017 | #define MJSG_SR_RADIO_PID 0x9379 | 1023 | #define MJSG_SR_RADIO_PID 0x9379 |
1018 | #define MJSG_XM_RADIO_PID 0x937A | 1024 | #define MJSG_XM_RADIO_PID 0x937A |
1019 | #define MJSG_HD_RADIO_PID 0x937C | 1025 | #define MJSG_HD_RADIO_PID 0x937C |
1026 | |||
1027 | /* | ||
1028 | * Xverve Signalyzer tools (http://www.signalyzer.com/) | ||
1029 | */ | ||
1030 | #define XVERVE_SIGNALYZER_ST_PID 0xBCA0 | ||
1031 | #define XVERVE_SIGNALYZER_SLITE_PID 0xBCA1 | ||
1032 | #define XVERVE_SIGNALYZER_SH2_PID 0xBCA2 | ||
1033 | #define XVERVE_SIGNALYZER_SH4_PID 0xBCA4 | ||
1034 | |||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index e280ad8e12f7..5cd30e4345c6 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -206,6 +206,7 @@ static void option_instat_callback(struct urb *urb); | |||
206 | #define AMOI_PRODUCT_H01 0x0800 | 206 | #define AMOI_PRODUCT_H01 0x0800 |
207 | #define AMOI_PRODUCT_H01A 0x7002 | 207 | #define AMOI_PRODUCT_H01A 0x7002 |
208 | #define AMOI_PRODUCT_H02 0x0802 | 208 | #define AMOI_PRODUCT_H02 0x0802 |
209 | #define AMOI_PRODUCT_SKYPEPHONE_S2 0x0407 | ||
209 | 210 | ||
210 | #define DELL_VENDOR_ID 0x413C | 211 | #define DELL_VENDOR_ID 0x413C |
211 | 212 | ||
@@ -302,6 +303,7 @@ static void option_instat_callback(struct urb *urb); | |||
302 | #define QISDA_PRODUCT_H21_4512 0x4512 | 303 | #define QISDA_PRODUCT_H21_4512 0x4512 |
303 | #define QISDA_PRODUCT_H21_4523 0x4523 | 304 | #define QISDA_PRODUCT_H21_4523 0x4523 |
304 | #define QISDA_PRODUCT_H20_4515 0x4515 | 305 | #define QISDA_PRODUCT_H20_4515 0x4515 |
306 | #define QISDA_PRODUCT_H20_4518 0x4518 | ||
305 | #define QISDA_PRODUCT_H20_4519 0x4519 | 307 | #define QISDA_PRODUCT_H20_4519 0x4519 |
306 | 308 | ||
307 | /* TLAYTECH PRODUCTS */ | 309 | /* TLAYTECH PRODUCTS */ |
@@ -516,6 +518,7 @@ static const struct usb_device_id option_ids[] = { | |||
516 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 518 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
517 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 519 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
518 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, | 520 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, |
521 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) }, | ||
519 | 522 | ||
520 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ | 523 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ |
521 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | 524 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ |
@@ -852,6 +855,7 @@ static const struct usb_device_id option_ids[] = { | |||
852 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, | 855 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, |
853 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, | 856 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, |
854 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, | 857 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, |
858 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) }, | ||
855 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, | 859 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, |
856 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, | 860 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, |
857 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ | 861 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 93d72eb8cafc..cde67cacb2c3 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -51,6 +51,8 @@ static const struct usb_device_id id_table[] = { | |||
51 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | 51 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ |
52 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ | 52 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ |
53 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 53 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
54 | {USB_DEVICE(0x05c6, 0x9208)}, /* Generic Gobi 2000 QDL device */ | ||
55 | {USB_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | ||
54 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ | 56 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ |
55 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 57 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
56 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ | 58 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ef0bdb08d788..d47b56e9e8ce 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -245,6 +245,7 @@ static const struct usb_device_id id_table[] = { | |||
245 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ | 245 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ |
246 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ | 246 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ |
247 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ | 247 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ |
248 | { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U */ | ||
248 | /* Sierra Wireless C597 */ | 249 | /* Sierra Wireless C597 */ |
249 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, | 250 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, |
250 | /* Sierra Wireless T598 */ | 251 | /* Sierra Wireless T598 */ |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 44716427c51c..64ec073e89de 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -139,9 +139,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) | |||
139 | 139 | ||
140 | /* fill the common fields in the URB */ | 140 | /* fill the common fields in the URB */ |
141 | us->current_urb->context = &urb_done; | 141 | us->current_urb->context = &urb_done; |
142 | us->current_urb->actual_length = 0; | 142 | us->current_urb->transfer_flags = 0; |
143 | us->current_urb->error_count = 0; | ||
144 | us->current_urb->status = 0; | ||
145 | 143 | ||
146 | /* we assume that if transfer_buffer isn't us->iobuf then it | 144 | /* we assume that if transfer_buffer isn't us->iobuf then it |
147 | * hasn't been mapped for DMA. Yes, this is clunky, but it's | 145 | * hasn't been mapped for DMA. Yes, this is clunky, but it's |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index df5b6b971f26..d219070fed3d 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -98,7 +98,8 @@ static void tx_poll_start(struct vhost_net *net, struct socket *sock) | |||
98 | static void handle_tx(struct vhost_net *net) | 98 | static void handle_tx(struct vhost_net *net) |
99 | { | 99 | { |
100 | struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; | 100 | struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; |
101 | unsigned head, out, in, s; | 101 | unsigned out, in, s; |
102 | int head; | ||
102 | struct msghdr msg = { | 103 | struct msghdr msg = { |
103 | .msg_name = NULL, | 104 | .msg_name = NULL, |
104 | .msg_namelen = 0, | 105 | .msg_namelen = 0, |
@@ -135,6 +136,9 @@ static void handle_tx(struct vhost_net *net) | |||
135 | ARRAY_SIZE(vq->iov), | 136 | ARRAY_SIZE(vq->iov), |
136 | &out, &in, | 137 | &out, &in, |
137 | NULL, NULL); | 138 | NULL, NULL); |
139 | /* On error, stop handling until the next kick. */ | ||
140 | if (unlikely(head < 0)) | ||
141 | break; | ||
138 | /* Nothing new? Wait for eventfd to tell us they refilled. */ | 142 | /* Nothing new? Wait for eventfd to tell us they refilled. */ |
139 | if (head == vq->num) { | 143 | if (head == vq->num) { |
140 | wmem = atomic_read(&sock->sk->sk_wmem_alloc); | 144 | wmem = atomic_read(&sock->sk->sk_wmem_alloc); |
@@ -173,8 +177,8 @@ static void handle_tx(struct vhost_net *net) | |||
173 | break; | 177 | break; |
174 | } | 178 | } |
175 | if (err != len) | 179 | if (err != len) |
176 | pr_err("Truncated TX packet: " | 180 | pr_debug("Truncated TX packet: " |
177 | " len %d != %zd\n", err, len); | 181 | " len %d != %zd\n", err, len); |
178 | vhost_add_used_and_signal(&net->dev, vq, head, 0); | 182 | vhost_add_used_and_signal(&net->dev, vq, head, 0); |
179 | total_len += len; | 183 | total_len += len; |
180 | if (unlikely(total_len >= VHOST_NET_WEIGHT)) { | 184 | if (unlikely(total_len >= VHOST_NET_WEIGHT)) { |
@@ -192,7 +196,8 @@ static void handle_tx(struct vhost_net *net) | |||
192 | static void handle_rx(struct vhost_net *net) | 196 | static void handle_rx(struct vhost_net *net) |
193 | { | 197 | { |
194 | struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_RX]; | 198 | struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_RX]; |
195 | unsigned head, out, in, log, s; | 199 | unsigned out, in, log, s; |
200 | int head; | ||
196 | struct vhost_log *vq_log; | 201 | struct vhost_log *vq_log; |
197 | struct msghdr msg = { | 202 | struct msghdr msg = { |
198 | .msg_name = NULL, | 203 | .msg_name = NULL, |
@@ -228,6 +233,9 @@ static void handle_rx(struct vhost_net *net) | |||
228 | ARRAY_SIZE(vq->iov), | 233 | ARRAY_SIZE(vq->iov), |
229 | &out, &in, | 234 | &out, &in, |
230 | vq_log, &log); | 235 | vq_log, &log); |
236 | /* On error, stop handling until the next kick. */ | ||
237 | if (unlikely(head < 0)) | ||
238 | break; | ||
231 | /* OK, now we need to know about added descriptors. */ | 239 | /* OK, now we need to know about added descriptors. */ |
232 | if (head == vq->num) { | 240 | if (head == vq->num) { |
233 | if (unlikely(vhost_enable_notify(vq))) { | 241 | if (unlikely(vhost_enable_notify(vq))) { |
@@ -267,8 +275,8 @@ static void handle_rx(struct vhost_net *net) | |||
267 | } | 275 | } |
268 | /* TODO: Should check and handle checksum. */ | 276 | /* TODO: Should check and handle checksum. */ |
269 | if (err > len) { | 277 | if (err > len) { |
270 | pr_err("Discarded truncated rx packet: " | 278 | pr_debug("Discarded truncated rx packet: " |
271 | " len %d > %zd\n", err, len); | 279 | " len %d > %zd\n", err, len); |
272 | vhost_discard_vq_desc(vq); | 280 | vhost_discard_vq_desc(vq); |
273 | continue; | 281 | continue; |
274 | } | 282 | } |
@@ -526,11 +534,16 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
526 | rcu_assign_pointer(vq->private_data, sock); | 534 | rcu_assign_pointer(vq->private_data, sock); |
527 | vhost_net_enable_vq(n, vq); | 535 | vhost_net_enable_vq(n, vq); |
528 | done: | 536 | done: |
537 | mutex_unlock(&vq->mutex); | ||
538 | |||
529 | if (oldsock) { | 539 | if (oldsock) { |
530 | vhost_net_flush_vq(n, index); | 540 | vhost_net_flush_vq(n, index); |
531 | fput(oldsock->file); | 541 | fput(oldsock->file); |
532 | } | 542 | } |
533 | 543 | ||
544 | mutex_unlock(&n->dev.mutex); | ||
545 | return 0; | ||
546 | |||
534 | err_vq: | 547 | err_vq: |
535 | mutex_unlock(&vq->mutex); | 548 | mutex_unlock(&vq->mutex); |
536 | err: | 549 | err: |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 3b83382e06eb..0b99783083f6 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -736,12 +736,12 @@ static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, | |||
736 | mem = rcu_dereference(dev->memory); | 736 | mem = rcu_dereference(dev->memory); |
737 | while ((u64)len > s) { | 737 | while ((u64)len > s) { |
738 | u64 size; | 738 | u64 size; |
739 | if (ret >= iov_size) { | 739 | if (unlikely(ret >= iov_size)) { |
740 | ret = -ENOBUFS; | 740 | ret = -ENOBUFS; |
741 | break; | 741 | break; |
742 | } | 742 | } |
743 | reg = find_region(mem, addr, len); | 743 | reg = find_region(mem, addr, len); |
744 | if (!reg) { | 744 | if (unlikely(!reg)) { |
745 | ret = -EFAULT; | 745 | ret = -EFAULT; |
746 | break; | 746 | break; |
747 | } | 747 | } |
@@ -780,18 +780,18 @@ static unsigned next_desc(struct vring_desc *desc) | |||
780 | return next; | 780 | return next; |
781 | } | 781 | } |
782 | 782 | ||
783 | static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | 783 | static int get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, |
784 | struct iovec iov[], unsigned int iov_size, | 784 | struct iovec iov[], unsigned int iov_size, |
785 | unsigned int *out_num, unsigned int *in_num, | 785 | unsigned int *out_num, unsigned int *in_num, |
786 | struct vhost_log *log, unsigned int *log_num, | 786 | struct vhost_log *log, unsigned int *log_num, |
787 | struct vring_desc *indirect) | 787 | struct vring_desc *indirect) |
788 | { | 788 | { |
789 | struct vring_desc desc; | 789 | struct vring_desc desc; |
790 | unsigned int i = 0, count, found = 0; | 790 | unsigned int i = 0, count, found = 0; |
791 | int ret; | 791 | int ret; |
792 | 792 | ||
793 | /* Sanity check */ | 793 | /* Sanity check */ |
794 | if (indirect->len % sizeof desc) { | 794 | if (unlikely(indirect->len % sizeof desc)) { |
795 | vq_err(vq, "Invalid length in indirect descriptor: " | 795 | vq_err(vq, "Invalid length in indirect descriptor: " |
796 | "len 0x%llx not multiple of 0x%zx\n", | 796 | "len 0x%llx not multiple of 0x%zx\n", |
797 | (unsigned long long)indirect->len, | 797 | (unsigned long long)indirect->len, |
@@ -801,7 +801,7 @@ static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
801 | 801 | ||
802 | ret = translate_desc(dev, indirect->addr, indirect->len, vq->indirect, | 802 | ret = translate_desc(dev, indirect->addr, indirect->len, vq->indirect, |
803 | ARRAY_SIZE(vq->indirect)); | 803 | ARRAY_SIZE(vq->indirect)); |
804 | if (ret < 0) { | 804 | if (unlikely(ret < 0)) { |
805 | vq_err(vq, "Translation failure %d in indirect.\n", ret); | 805 | vq_err(vq, "Translation failure %d in indirect.\n", ret); |
806 | return ret; | 806 | return ret; |
807 | } | 807 | } |
@@ -813,7 +813,7 @@ static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
813 | count = indirect->len / sizeof desc; | 813 | count = indirect->len / sizeof desc; |
814 | /* Buffers are chained via a 16 bit next field, so | 814 | /* Buffers are chained via a 16 bit next field, so |
815 | * we can have at most 2^16 of these. */ | 815 | * we can have at most 2^16 of these. */ |
816 | if (count > USHRT_MAX + 1) { | 816 | if (unlikely(count > USHRT_MAX + 1)) { |
817 | vq_err(vq, "Indirect buffer length too big: %d\n", | 817 | vq_err(vq, "Indirect buffer length too big: %d\n", |
818 | indirect->len); | 818 | indirect->len); |
819 | return -E2BIG; | 819 | return -E2BIG; |
@@ -821,19 +821,19 @@ static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
821 | 821 | ||
822 | do { | 822 | do { |
823 | unsigned iov_count = *in_num + *out_num; | 823 | unsigned iov_count = *in_num + *out_num; |
824 | if (++found > count) { | 824 | if (unlikely(++found > count)) { |
825 | vq_err(vq, "Loop detected: last one at %u " | 825 | vq_err(vq, "Loop detected: last one at %u " |
826 | "indirect size %u\n", | 826 | "indirect size %u\n", |
827 | i, count); | 827 | i, count); |
828 | return -EINVAL; | 828 | return -EINVAL; |
829 | } | 829 | } |
830 | if (memcpy_fromiovec((unsigned char *)&desc, vq->indirect, | 830 | if (unlikely(memcpy_fromiovec((unsigned char *)&desc, vq->indirect, |
831 | sizeof desc)) { | 831 | sizeof desc))) { |
832 | vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n", | 832 | vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n", |
833 | i, (size_t)indirect->addr + i * sizeof desc); | 833 | i, (size_t)indirect->addr + i * sizeof desc); |
834 | return -EINVAL; | 834 | return -EINVAL; |
835 | } | 835 | } |
836 | if (desc.flags & VRING_DESC_F_INDIRECT) { | 836 | if (unlikely(desc.flags & VRING_DESC_F_INDIRECT)) { |
837 | vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", | 837 | vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", |
838 | i, (size_t)indirect->addr + i * sizeof desc); | 838 | i, (size_t)indirect->addr + i * sizeof desc); |
839 | return -EINVAL; | 839 | return -EINVAL; |
@@ -841,7 +841,7 @@ static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
841 | 841 | ||
842 | ret = translate_desc(dev, desc.addr, desc.len, iov + iov_count, | 842 | ret = translate_desc(dev, desc.addr, desc.len, iov + iov_count, |
843 | iov_size - iov_count); | 843 | iov_size - iov_count); |
844 | if (ret < 0) { | 844 | if (unlikely(ret < 0)) { |
845 | vq_err(vq, "Translation failure %d indirect idx %d\n", | 845 | vq_err(vq, "Translation failure %d indirect idx %d\n", |
846 | ret, i); | 846 | ret, i); |
847 | return ret; | 847 | return ret; |
@@ -857,7 +857,7 @@ static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
857 | } else { | 857 | } else { |
858 | /* If it's an output descriptor, they're all supposed | 858 | /* If it's an output descriptor, they're all supposed |
859 | * to come before any input descriptors. */ | 859 | * to come before any input descriptors. */ |
860 | if (*in_num) { | 860 | if (unlikely(*in_num)) { |
861 | vq_err(vq, "Indirect descriptor " | 861 | vq_err(vq, "Indirect descriptor " |
862 | "has out after in: idx %d\n", i); | 862 | "has out after in: idx %d\n", i); |
863 | return -EINVAL; | 863 | return -EINVAL; |
@@ -873,12 +873,13 @@ static unsigned get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
873 | * number of output then some number of input descriptors, it's actually two | 873 | * number of output then some number of input descriptors, it's actually two |
874 | * iovecs, but we pack them into one and note how many of each there were. | 874 | * iovecs, but we pack them into one and note how many of each there were. |
875 | * | 875 | * |
876 | * This function returns the descriptor number found, or vq->num (which | 876 | * This function returns the descriptor number found, or vq->num (which is |
877 | * is never a valid descriptor number) if none was found. */ | 877 | * never a valid descriptor number) if none was found. A negative code is |
878 | unsigned vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, | 878 | * returned on error. */ |
879 | struct iovec iov[], unsigned int iov_size, | 879 | int vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, |
880 | unsigned int *out_num, unsigned int *in_num, | 880 | struct iovec iov[], unsigned int iov_size, |
881 | struct vhost_log *log, unsigned int *log_num) | 881 | unsigned int *out_num, unsigned int *in_num, |
882 | struct vhost_log *log, unsigned int *log_num) | ||
882 | { | 883 | { |
883 | struct vring_desc desc; | 884 | struct vring_desc desc; |
884 | unsigned int i, head, found = 0; | 885 | unsigned int i, head, found = 0; |
@@ -887,16 +888,16 @@ unsigned vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
887 | 888 | ||
888 | /* Check it isn't doing very strange things with descriptor numbers. */ | 889 | /* Check it isn't doing very strange things with descriptor numbers. */ |
889 | last_avail_idx = vq->last_avail_idx; | 890 | last_avail_idx = vq->last_avail_idx; |
890 | if (get_user(vq->avail_idx, &vq->avail->idx)) { | 891 | if (unlikely(get_user(vq->avail_idx, &vq->avail->idx))) { |
891 | vq_err(vq, "Failed to access avail idx at %p\n", | 892 | vq_err(vq, "Failed to access avail idx at %p\n", |
892 | &vq->avail->idx); | 893 | &vq->avail->idx); |
893 | return vq->num; | 894 | return -EFAULT; |
894 | } | 895 | } |
895 | 896 | ||
896 | if ((u16)(vq->avail_idx - last_avail_idx) > vq->num) { | 897 | if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) { |
897 | vq_err(vq, "Guest moved used index from %u to %u", | 898 | vq_err(vq, "Guest moved used index from %u to %u", |
898 | last_avail_idx, vq->avail_idx); | 899 | last_avail_idx, vq->avail_idx); |
899 | return vq->num; | 900 | return -EFAULT; |
900 | } | 901 | } |
901 | 902 | ||
902 | /* If there's nothing new since last we looked, return invalid. */ | 903 | /* If there's nothing new since last we looked, return invalid. */ |
@@ -908,18 +909,19 @@ unsigned vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
908 | 909 | ||
909 | /* Grab the next descriptor number they're advertising, and increment | 910 | /* Grab the next descriptor number they're advertising, and increment |
910 | * the index we've seen. */ | 911 | * the index we've seen. */ |
911 | if (get_user(head, &vq->avail->ring[last_avail_idx % vq->num])) { | 912 | if (unlikely(get_user(head, |
913 | &vq->avail->ring[last_avail_idx % vq->num]))) { | ||
912 | vq_err(vq, "Failed to read head: idx %d address %p\n", | 914 | vq_err(vq, "Failed to read head: idx %d address %p\n", |
913 | last_avail_idx, | 915 | last_avail_idx, |
914 | &vq->avail->ring[last_avail_idx % vq->num]); | 916 | &vq->avail->ring[last_avail_idx % vq->num]); |
915 | return vq->num; | 917 | return -EFAULT; |
916 | } | 918 | } |
917 | 919 | ||
918 | /* If their number is silly, that's an error. */ | 920 | /* If their number is silly, that's an error. */ |
919 | if (head >= vq->num) { | 921 | if (unlikely(head >= vq->num)) { |
920 | vq_err(vq, "Guest says index %u > %u is available", | 922 | vq_err(vq, "Guest says index %u > %u is available", |
921 | head, vq->num); | 923 | head, vq->num); |
922 | return vq->num; | 924 | return -EINVAL; |
923 | } | 925 | } |
924 | 926 | ||
925 | /* When we start there are none of either input nor output. */ | 927 | /* When we start there are none of either input nor output. */ |
@@ -930,41 +932,41 @@ unsigned vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
930 | i = head; | 932 | i = head; |
931 | do { | 933 | do { |
932 | unsigned iov_count = *in_num + *out_num; | 934 | unsigned iov_count = *in_num + *out_num; |
933 | if (i >= vq->num) { | 935 | if (unlikely(i >= vq->num)) { |
934 | vq_err(vq, "Desc index is %u > %u, head = %u", | 936 | vq_err(vq, "Desc index is %u > %u, head = %u", |
935 | i, vq->num, head); | 937 | i, vq->num, head); |
936 | return vq->num; | 938 | return -EINVAL; |
937 | } | 939 | } |
938 | if (++found > vq->num) { | 940 | if (unlikely(++found > vq->num)) { |
939 | vq_err(vq, "Loop detected: last one at %u " | 941 | vq_err(vq, "Loop detected: last one at %u " |
940 | "vq size %u head %u\n", | 942 | "vq size %u head %u\n", |
941 | i, vq->num, head); | 943 | i, vq->num, head); |
942 | return vq->num; | 944 | return -EINVAL; |
943 | } | 945 | } |
944 | ret = copy_from_user(&desc, vq->desc + i, sizeof desc); | 946 | ret = copy_from_user(&desc, vq->desc + i, sizeof desc); |
945 | if (ret) { | 947 | if (unlikely(ret)) { |
946 | vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", | 948 | vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", |
947 | i, vq->desc + i); | 949 | i, vq->desc + i); |
948 | return vq->num; | 950 | return -EFAULT; |
949 | } | 951 | } |
950 | if (desc.flags & VRING_DESC_F_INDIRECT) { | 952 | if (desc.flags & VRING_DESC_F_INDIRECT) { |
951 | ret = get_indirect(dev, vq, iov, iov_size, | 953 | ret = get_indirect(dev, vq, iov, iov_size, |
952 | out_num, in_num, | 954 | out_num, in_num, |
953 | log, log_num, &desc); | 955 | log, log_num, &desc); |
954 | if (ret < 0) { | 956 | if (unlikely(ret < 0)) { |
955 | vq_err(vq, "Failure detected " | 957 | vq_err(vq, "Failure detected " |
956 | "in indirect descriptor at idx %d\n", i); | 958 | "in indirect descriptor at idx %d\n", i); |
957 | return vq->num; | 959 | return ret; |
958 | } | 960 | } |
959 | continue; | 961 | continue; |
960 | } | 962 | } |
961 | 963 | ||
962 | ret = translate_desc(dev, desc.addr, desc.len, iov + iov_count, | 964 | ret = translate_desc(dev, desc.addr, desc.len, iov + iov_count, |
963 | iov_size - iov_count); | 965 | iov_size - iov_count); |
964 | if (ret < 0) { | 966 | if (unlikely(ret < 0)) { |
965 | vq_err(vq, "Translation failure %d descriptor idx %d\n", | 967 | vq_err(vq, "Translation failure %d descriptor idx %d\n", |
966 | ret, i); | 968 | ret, i); |
967 | return vq->num; | 969 | return ret; |
968 | } | 970 | } |
969 | if (desc.flags & VRING_DESC_F_WRITE) { | 971 | if (desc.flags & VRING_DESC_F_WRITE) { |
970 | /* If this is an input descriptor, | 972 | /* If this is an input descriptor, |
@@ -978,10 +980,10 @@ unsigned vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
978 | } else { | 980 | } else { |
979 | /* If it's an output descriptor, they're all supposed | 981 | /* If it's an output descriptor, they're all supposed |
980 | * to come before any input descriptors. */ | 982 | * to come before any input descriptors. */ |
981 | if (*in_num) { | 983 | if (unlikely(*in_num)) { |
982 | vq_err(vq, "Descriptor has out after in: " | 984 | vq_err(vq, "Descriptor has out after in: " |
983 | "idx %d\n", i); | 985 | "idx %d\n", i); |
984 | return vq->num; | 986 | return -EINVAL; |
985 | } | 987 | } |
986 | *out_num += ret; | 988 | *out_num += ret; |
987 | } | 989 | } |
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 44591ba9b07a..11ee13dba0f7 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -120,10 +120,10 @@ long vhost_dev_ioctl(struct vhost_dev *, unsigned int ioctl, unsigned long arg); | |||
120 | int vhost_vq_access_ok(struct vhost_virtqueue *vq); | 120 | int vhost_vq_access_ok(struct vhost_virtqueue *vq); |
121 | int vhost_log_access_ok(struct vhost_dev *); | 121 | int vhost_log_access_ok(struct vhost_dev *); |
122 | 122 | ||
123 | unsigned vhost_get_vq_desc(struct vhost_dev *, struct vhost_virtqueue *, | 123 | int vhost_get_vq_desc(struct vhost_dev *, struct vhost_virtqueue *, |
124 | struct iovec iov[], unsigned int iov_count, | 124 | struct iovec iov[], unsigned int iov_count, |
125 | unsigned int *out_num, unsigned int *in_num, | 125 | unsigned int *out_num, unsigned int *in_num, |
126 | struct vhost_log *log, unsigned int *log_num); | 126 | struct vhost_log *log, unsigned int *log_num); |
127 | void vhost_discard_vq_desc(struct vhost_virtqueue *); | 127 | void vhost_discard_vq_desc(struct vhost_virtqueue *); |
128 | 128 | ||
129 | int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); | 129 | int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); |
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index 515cf1978d19..c4e17642d9c5 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -2872,7 +2872,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis | |||
2872 | } | 2872 | } |
2873 | 2873 | ||
2874 | #if 0 | 2874 | #if 0 |
2875 | /* Power down TV DAC, taht saves a significant amount of power, | 2875 | /* Power down TV DAC, that saves a significant amount of power, |
2876 | * we'll have something better once we actually have some TVOut | 2876 | * we'll have something better once we actually have some TVOut |
2877 | * support | 2877 | * support |
2878 | */ | 2878 | */ |
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 40f61320ce16..34b2fc472fe8 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -95,7 +95,7 @@ struct fb_bitfield rgb_bitfields[][4] = | |||
95 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, | 95 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static struct fb_fix_screeninfo au1100fb_fix __initdata = { | 98 | static struct fb_fix_screeninfo au1100fb_fix __devinitdata = { |
99 | .id = "AU1100 FB", | 99 | .id = "AU1100 FB", |
100 | .xpanstep = 1, | 100 | .xpanstep = 1, |
101 | .ypanstep = 1, | 101 | .ypanstep = 1, |
@@ -103,7 +103,7 @@ static struct fb_fix_screeninfo au1100fb_fix __initdata = { | |||
103 | .accel = FB_ACCEL_NONE, | 103 | .accel = FB_ACCEL_NONE, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static struct fb_var_screeninfo au1100fb_var __initdata = { | 106 | static struct fb_var_screeninfo au1100fb_var __devinitdata = { |
107 | .activate = FB_ACTIVATE_NOW, | 107 | .activate = FB_ACTIVATE_NOW, |
108 | .height = -1, | 108 | .height = -1, |
109 | .width = -1, | 109 | .width = -1, |
@@ -458,7 +458,7 @@ static struct fb_ops au1100fb_ops = | |||
458 | 458 | ||
459 | /* AU1100 LCD controller device driver */ | 459 | /* AU1100 LCD controller device driver */ |
460 | 460 | ||
461 | static int __init au1100fb_drv_probe(struct platform_device *dev) | 461 | static int __devinit au1100fb_drv_probe(struct platform_device *dev) |
462 | { | 462 | { |
463 | struct au1100fb_device *fbdev = NULL; | 463 | struct au1100fb_device *fbdev = NULL; |
464 | struct resource *regs_res; | 464 | struct resource *regs_res; |
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 3a561df2e8a2..0c1afd13ddd3 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c | |||
@@ -388,6 +388,7 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
388 | pseudo_val |= convert_bitfield(red, &var->red); | 388 | pseudo_val |= convert_bitfield(red, &var->red); |
389 | pseudo_val |= convert_bitfield(green, &var->green); | 389 | pseudo_val |= convert_bitfield(green, &var->green); |
390 | pseudo_val |= convert_bitfield(blue, &var->blue); | 390 | pseudo_val |= convert_bitfield(blue, &var->blue); |
391 | ret = 0; | ||
391 | break; | 392 | break; |
392 | } | 393 | } |
393 | 394 | ||
@@ -436,6 +437,8 @@ static void cyber2000fb_write_ramdac_ctrl(struct cfb_info *cfb) | |||
436 | cyber2000fb_writeb(i | 4, 0x3cf, cfb); | 437 | cyber2000fb_writeb(i | 4, 0x3cf, cfb); |
437 | cyber2000fb_writeb(val, 0x3c6, cfb); | 438 | cyber2000fb_writeb(val, 0x3c6, cfb); |
438 | cyber2000fb_writeb(i, 0x3cf, cfb); | 439 | cyber2000fb_writeb(i, 0x3cf, cfb); |
440 | /* prevent card lock-up observed on x86 with CyberPro 2000 */ | ||
441 | cyber2000fb_readb(0x3cf, cfb); | ||
439 | } | 442 | } |
440 | 443 | ||
441 | static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) | 444 | static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) |
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 7d8c55d7fd28..ca3355e430bf 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
@@ -91,10 +91,10 @@ static uint32_t pseudo_palette[16]; | |||
91 | static uint32_t gbe_cmap[256]; | 91 | static uint32_t gbe_cmap[256]; |
92 | static int gbe_turned_on; /* 0 turned off, 1 turned on */ | 92 | static int gbe_turned_on; /* 0 turned off, 1 turned on */ |
93 | 93 | ||
94 | static char *mode_option __initdata = NULL; | 94 | static char *mode_option __devinitdata = NULL; |
95 | 95 | ||
96 | /* default CRT mode */ | 96 | /* default CRT mode */ |
97 | static struct fb_var_screeninfo default_var_CRT __initdata = { | 97 | static struct fb_var_screeninfo default_var_CRT __devinitdata = { |
98 | /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ | 98 | /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ |
99 | .xres = 640, | 99 | .xres = 640, |
100 | .yres = 480, | 100 | .yres = 480, |
@@ -125,7 +125,7 @@ static struct fb_var_screeninfo default_var_CRT __initdata = { | |||
125 | }; | 125 | }; |
126 | 126 | ||
127 | /* default LCD mode */ | 127 | /* default LCD mode */ |
128 | static struct fb_var_screeninfo default_var_LCD __initdata = { | 128 | static struct fb_var_screeninfo default_var_LCD __devinitdata = { |
129 | /* 1600x1024, 8 bpp */ | 129 | /* 1600x1024, 8 bpp */ |
130 | .xres = 1600, | 130 | .xres = 1600, |
131 | .yres = 1024, | 131 | .yres = 1024, |
@@ -157,7 +157,7 @@ static struct fb_var_screeninfo default_var_LCD __initdata = { | |||
157 | 157 | ||
158 | /* default modedb mode */ | 158 | /* default modedb mode */ |
159 | /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ | 159 | /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ |
160 | static struct fb_videomode default_mode_CRT __initdata = { | 160 | static struct fb_videomode default_mode_CRT __devinitdata = { |
161 | .refresh = 60, | 161 | .refresh = 60, |
162 | .xres = 640, | 162 | .xres = 640, |
163 | .yres = 480, | 163 | .yres = 480, |
@@ -172,7 +172,7 @@ static struct fb_videomode default_mode_CRT __initdata = { | |||
172 | .vmode = FB_VMODE_NONINTERLACED, | 172 | .vmode = FB_VMODE_NONINTERLACED, |
173 | }; | 173 | }; |
174 | /* 1600x1024 SGI flatpanel 1600sw */ | 174 | /* 1600x1024 SGI flatpanel 1600sw */ |
175 | static struct fb_videomode default_mode_LCD __initdata = { | 175 | static struct fb_videomode default_mode_LCD __devinitdata = { |
176 | /* 1600x1024, 8 bpp */ | 176 | /* 1600x1024, 8 bpp */ |
177 | .xres = 1600, | 177 | .xres = 1600, |
178 | .yres = 1024, | 178 | .yres = 1024, |
@@ -186,8 +186,8 @@ static struct fb_videomode default_mode_LCD __initdata = { | |||
186 | .vmode = FB_VMODE_NONINTERLACED, | 186 | .vmode = FB_VMODE_NONINTERLACED, |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static struct fb_videomode *default_mode __initdata = &default_mode_CRT; | 189 | static struct fb_videomode *default_mode __devinitdata = &default_mode_CRT; |
190 | static struct fb_var_screeninfo *default_var __initdata = &default_var_CRT; | 190 | static struct fb_var_screeninfo *default_var __devinitdata = &default_var_CRT; |
191 | 191 | ||
192 | static int flat_panel_enabled = 0; | 192 | static int flat_panel_enabled = 0; |
193 | 193 | ||
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev) | |||
1098 | * Initialization | 1098 | * Initialization |
1099 | */ | 1099 | */ |
1100 | 1100 | ||
1101 | static int __init gbefb_setup(char *options) | 1101 | static int __devinit gbefb_setup(char *options) |
1102 | { | 1102 | { |
1103 | char *this_opt; | 1103 | char *this_opt; |
1104 | 1104 | ||
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index b4b6deceed15..43f0639b1c10 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -175,6 +175,7 @@ struct imxfb_info { | |||
175 | 175 | ||
176 | struct imx_fb_videomode *mode; | 176 | struct imx_fb_videomode *mode; |
177 | int num_modes; | 177 | int num_modes; |
178 | struct backlight_device *bl; | ||
178 | 179 | ||
179 | void (*lcd_power)(int); | 180 | void (*lcd_power)(int); |
180 | void (*backlight_power)(int); | 181 | void (*backlight_power)(int); |
@@ -449,6 +450,73 @@ static int imxfb_set_par(struct fb_info *info) | |||
449 | return 0; | 450 | return 0; |
450 | } | 451 | } |
451 | 452 | ||
453 | |||
454 | |||
455 | static int imxfb_bl_get_brightness(struct backlight_device *bl) | ||
456 | { | ||
457 | struct imxfb_info *fbi = bl_get_data(bl); | ||
458 | |||
459 | return readl(fbi->regs + LCDC_PWMR) & 0xFF; | ||
460 | } | ||
461 | |||
462 | static int imxfb_bl_update_status(struct backlight_device *bl) | ||
463 | { | ||
464 | struct imxfb_info *fbi = bl_get_data(bl); | ||
465 | int brightness = bl->props.brightness; | ||
466 | |||
467 | if (bl->props.power != FB_BLANK_UNBLANK) | ||
468 | brightness = 0; | ||
469 | if (bl->props.fb_blank != FB_BLANK_UNBLANK) | ||
470 | brightness = 0; | ||
471 | |||
472 | fbi->pwmr = (fbi->pwmr & ~0xFF) | brightness; | ||
473 | |||
474 | if (bl->props.fb_blank != FB_BLANK_UNBLANK) | ||
475 | clk_enable(fbi->clk); | ||
476 | writel(fbi->pwmr, fbi->regs + LCDC_PWMR); | ||
477 | if (bl->props.fb_blank != FB_BLANK_UNBLANK) | ||
478 | clk_disable(fbi->clk); | ||
479 | |||
480 | return 0; | ||
481 | } | ||
482 | |||
483 | static const struct backlight_ops imxfb_lcdc_bl_ops = { | ||
484 | .update_status = imxfb_bl_update_status, | ||
485 | .get_brightness = imxfb_bl_get_brightness, | ||
486 | }; | ||
487 | |||
488 | static void imxfb_init_backlight(struct imxfb_info *fbi) | ||
489 | { | ||
490 | struct backlight_properties props; | ||
491 | struct backlight_device *bl; | ||
492 | |||
493 | if (fbi->bl) | ||
494 | return; | ||
495 | |||
496 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
497 | props.max_brightness = 0xff; | ||
498 | writel(fbi->pwmr, fbi->regs + LCDC_PWMR); | ||
499 | |||
500 | bl = backlight_device_register("imxfb-bl", &fbi->pdev->dev, fbi, | ||
501 | &imxfb_lcdc_bl_ops, &props); | ||
502 | if (IS_ERR(bl)) { | ||
503 | dev_err(&fbi->pdev->dev, "error %ld on backlight register\n", | ||
504 | PTR_ERR(bl)); | ||
505 | return; | ||
506 | } | ||
507 | |||
508 | fbi->bl = bl; | ||
509 | bl->props.power = FB_BLANK_UNBLANK; | ||
510 | bl->props.fb_blank = FB_BLANK_UNBLANK; | ||
511 | bl->props.brightness = imxfb_bl_get_brightness(bl); | ||
512 | } | ||
513 | |||
514 | static void imxfb_exit_backlight(struct imxfb_info *fbi) | ||
515 | { | ||
516 | if (fbi->bl) | ||
517 | backlight_device_unregister(fbi->bl); | ||
518 | } | ||
519 | |||
452 | static void imxfb_enable_controller(struct imxfb_info *fbi) | 520 | static void imxfb_enable_controller(struct imxfb_info *fbi) |
453 | { | 521 | { |
454 | pr_debug("Enabling LCD controller\n"); | 522 | pr_debug("Enabling LCD controller\n"); |
@@ -579,7 +647,6 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
579 | fbi->regs + LCDC_SIZE); | 647 | fbi->regs + LCDC_SIZE); |
580 | 648 | ||
581 | writel(fbi->pcr, fbi->regs + LCDC_PCR); | 649 | writel(fbi->pcr, fbi->regs + LCDC_PCR); |
582 | writel(fbi->pwmr, fbi->regs + LCDC_PWMR); | ||
583 | writel(fbi->lscr1, fbi->regs + LCDC_LSCR1); | 650 | writel(fbi->lscr1, fbi->regs + LCDC_LSCR1); |
584 | writel(fbi->dmacr, fbi->regs + LCDC_DMACR); | 651 | writel(fbi->dmacr, fbi->regs + LCDC_DMACR); |
585 | 652 | ||
@@ -779,6 +846,8 @@ static int __init imxfb_probe(struct platform_device *pdev) | |||
779 | } | 846 | } |
780 | 847 | ||
781 | imxfb_enable_controller(fbi); | 848 | imxfb_enable_controller(fbi); |
849 | fbi->pdev = pdev; | ||
850 | imxfb_init_backlight(fbi); | ||
782 | 851 | ||
783 | return 0; | 852 | return 0; |
784 | 853 | ||
@@ -816,6 +885,7 @@ static int __devexit imxfb_remove(struct platform_device *pdev) | |||
816 | 885 | ||
817 | imxfb_disable_controller(fbi); | 886 | imxfb_disable_controller(fbi); |
818 | 887 | ||
888 | imxfb_exit_backlight(fbi); | ||
819 | unregister_framebuffer(info); | 889 | unregister_framebuffer(info); |
820 | 890 | ||
821 | pdata = pdev->dev.platform_data; | 891 | pdata = pdev->dev.platform_data; |
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c index 3b1237ad85ed..f6fdc2085f3e 100644 --- a/drivers/video/omap2/vram.c +++ b/drivers/video/omap2/vram.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/list.h> | 25 | #include <linux/list.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/seq_file.h> | 27 | #include <linux/seq_file.h> |
28 | #include <linux/bootmem.h> | 28 | #include <linux/memblock.h> |
29 | #include <linux/completion.h> | 29 | #include <linux/completion.h> |
30 | #include <linux/debugfs.h> | 30 | #include <linux/debugfs.h> |
31 | #include <linux/jiffies.h> | 31 | #include <linux/jiffies.h> |
@@ -525,10 +525,8 @@ early_param("vram", omap_vram_early_vram); | |||
525 | * Called from map_io. We need to call to this early enough so that we | 525 | * Called from map_io. We need to call to this early enough so that we |
526 | * can reserve the fixed SDRAM regions before VM could get hold of them. | 526 | * can reserve the fixed SDRAM regions before VM could get hold of them. |
527 | */ | 527 | */ |
528 | void __init omap_vram_reserve_sdram(void) | 528 | void __init omap_vram_reserve_sdram_memblock(void) |
529 | { | 529 | { |
530 | struct bootmem_data *bdata; | ||
531 | unsigned long sdram_start, sdram_size; | ||
532 | u32 paddr; | 530 | u32 paddr; |
533 | u32 size = 0; | 531 | u32 size = 0; |
534 | 532 | ||
@@ -555,29 +553,28 @@ void __init omap_vram_reserve_sdram(void) | |||
555 | 553 | ||
556 | size = PAGE_ALIGN(size); | 554 | size = PAGE_ALIGN(size); |
557 | 555 | ||
558 | bdata = NODE_DATA(0)->bdata; | ||
559 | sdram_start = bdata->node_min_pfn << PAGE_SHIFT; | ||
560 | sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start; | ||
561 | |||
562 | if (paddr) { | 556 | if (paddr) { |
563 | if ((paddr & ~PAGE_MASK) || paddr < sdram_start || | 557 | struct memblock_property res; |
564 | paddr + size > sdram_start + sdram_size) { | 558 | |
559 | res.base = paddr; | ||
560 | res.size = size; | ||
561 | if ((paddr & ~PAGE_MASK) || memblock_find(&res) || | ||
562 | res.base != paddr || res.size != size) { | ||
565 | pr_err("Illegal SDRAM region for VRAM\n"); | 563 | pr_err("Illegal SDRAM region for VRAM\n"); |
566 | return; | 564 | return; |
567 | } | 565 | } |
568 | 566 | ||
569 | if (reserve_bootmem(paddr, size, BOOTMEM_EXCLUSIVE) < 0) { | 567 | if (memblock_is_region_reserved(paddr, size)) { |
570 | pr_err("FB: failed to reserve VRAM\n"); | 568 | pr_err("FB: failed to reserve VRAM - busy\n"); |
571 | return; | 569 | return; |
572 | } | 570 | } |
573 | } else { | 571 | |
574 | if (size > sdram_size) { | 572 | if (memblock_reserve(paddr, size) < 0) { |
575 | pr_err("Illegal SDRAM size for VRAM\n"); | 573 | pr_err("FB: failed to reserve VRAM - no memory\n"); |
576 | return; | 574 | return; |
577 | } | 575 | } |
578 | 576 | } else { | |
579 | paddr = virt_to_phys(alloc_bootmem_pages(size)); | 577 | paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT); |
580 | BUG_ON(paddr & ~PAGE_MASK); | ||
581 | } | 578 | } |
582 | 579 | ||
583 | omap_vram_add_region(paddr, size); | 580 | omap_vram_add_region(paddr, size); |
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index 0f361b6100d2..0c69fa20251b 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c | |||
@@ -44,7 +44,7 @@ struct pmagbafb_par { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | 46 | ||
47 | static struct fb_var_screeninfo pmagbafb_defined __initdata = { | 47 | static struct fb_var_screeninfo pmagbafb_defined __devinitdata = { |
48 | .xres = 1024, | 48 | .xres = 1024, |
49 | .yres = 864, | 49 | .yres = 864, |
50 | .xres_virtual = 1024, | 50 | .xres_virtual = 1024, |
@@ -68,7 +68,7 @@ static struct fb_var_screeninfo pmagbafb_defined __initdata = { | |||
68 | .vmode = FB_VMODE_NONINTERLACED, | 68 | .vmode = FB_VMODE_NONINTERLACED, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static struct fb_fix_screeninfo pmagbafb_fix __initdata = { | 71 | static struct fb_fix_screeninfo pmagbafb_fix __devinitdata = { |
72 | .id = "PMAG-BA", | 72 | .id = "PMAG-BA", |
73 | .smem_len = (1024 * 1024), | 73 | .smem_len = (1024 * 1024), |
74 | .type = FB_TYPE_PACKED_PIXELS, | 74 | .type = FB_TYPE_PACKED_PIXELS, |
@@ -142,7 +142,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info) | |||
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | static int __init pmagbafb_probe(struct device *dev) | 145 | static int __devinit pmagbafb_probe(struct device *dev) |
146 | { | 146 | { |
147 | struct tc_dev *tdev = to_tc_dev(dev); | 147 | struct tc_dev *tdev = to_tc_dev(dev); |
148 | resource_size_t start, len; | 148 | resource_size_t start, len; |
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 2de0806421b4..22fcb9a3d5c0 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c | |||
@@ -45,7 +45,7 @@ struct pmagbbfb_par { | |||
45 | }; | 45 | }; |
46 | 46 | ||
47 | 47 | ||
48 | static struct fb_var_screeninfo pmagbbfb_defined __initdata = { | 48 | static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = { |
49 | .bits_per_pixel = 8, | 49 | .bits_per_pixel = 8, |
50 | .red.length = 8, | 50 | .red.length = 8, |
51 | .green.length = 8, | 51 | .green.length = 8, |
@@ -58,7 +58,7 @@ static struct fb_var_screeninfo pmagbbfb_defined __initdata = { | |||
58 | .vmode = FB_VMODE_NONINTERLACED, | 58 | .vmode = FB_VMODE_NONINTERLACED, |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static struct fb_fix_screeninfo pmagbbfb_fix __initdata = { | 61 | static struct fb_fix_screeninfo pmagbbfb_fix __devinitdata = { |
62 | .id = "PMAGB-BA", | 62 | .id = "PMAGB-BA", |
63 | .smem_len = (2048 * 1024), | 63 | .smem_len = (2048 * 1024), |
64 | .type = FB_TYPE_PACKED_PIXELS, | 64 | .type = FB_TYPE_PACKED_PIXELS, |
@@ -148,7 +148,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info) | |||
148 | /* | 148 | /* |
149 | * Set up screen parameters. | 149 | * Set up screen parameters. |
150 | */ | 150 | */ |
151 | static void __init pmagbbfb_screen_setup(struct fb_info *info) | 151 | static void __devinit pmagbbfb_screen_setup(struct fb_info *info) |
152 | { | 152 | { |
153 | struct pmagbbfb_par *par = info->par; | 153 | struct pmagbbfb_par *par = info->par; |
154 | 154 | ||
@@ -180,9 +180,9 @@ static void __init pmagbbfb_screen_setup(struct fb_info *info) | |||
180 | /* | 180 | /* |
181 | * Determine oscillator configuration. | 181 | * Determine oscillator configuration. |
182 | */ | 182 | */ |
183 | static void __init pmagbbfb_osc_setup(struct fb_info *info) | 183 | static void __devinit pmagbbfb_osc_setup(struct fb_info *info) |
184 | { | 184 | { |
185 | static unsigned int pmagbbfb_freqs[] __initdata = { | 185 | static unsigned int pmagbbfb_freqs[] __devinitdata = { |
186 | 130808, 119843, 104000, 92980, 74370, 72800, | 186 | 130808, 119843, 104000, 92980, 74370, 72800, |
187 | 69197, 66000, 65000, 50350, 36000, 32000, 25175 | 187 | 69197, 66000, 65000, 50350, 36000, 32000, 25175 |
188 | }; | 188 | }; |
@@ -247,7 +247,7 @@ static void __init pmagbbfb_osc_setup(struct fb_info *info) | |||
247 | }; | 247 | }; |
248 | 248 | ||
249 | 249 | ||
250 | static int __init pmagbbfb_probe(struct device *dev) | 250 | static int __devinit pmagbbfb_probe(struct device *dev) |
251 | { | 251 | { |
252 | struct tc_dev *tdev = to_tc_dev(dev); | 252 | struct tc_dev *tdev = to_tc_dev(dev); |
253 | resource_size_t start, len; | 253 | resource_size_t start, len; |
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index afe7e21dd0ae..1475ed6b575f 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
@@ -164,7 +164,8 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq, | |||
164 | gfp_t gfp) | 164 | gfp_t gfp) |
165 | { | 165 | { |
166 | struct vring_virtqueue *vq = to_vvq(_vq); | 166 | struct vring_virtqueue *vq = to_vvq(_vq); |
167 | unsigned int i, avail, head, uninitialized_var(prev); | 167 | unsigned int i, avail, uninitialized_var(prev); |
168 | int head; | ||
168 | 169 | ||
169 | START_USE(vq); | 170 | START_USE(vq); |
170 | 171 | ||
@@ -174,7 +175,7 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq, | |||
174 | * buffers, then go indirect. FIXME: tune this threshold */ | 175 | * buffers, then go indirect. FIXME: tune this threshold */ |
175 | if (vq->indirect && (out + in) > 1 && vq->num_free) { | 176 | if (vq->indirect && (out + in) > 1 && vq->num_free) { |
176 | head = vring_add_indirect(vq, sg, out, in, gfp); | 177 | head = vring_add_indirect(vq, sg, out, in, gfp); |
177 | if (head != vq->vring.num) | 178 | if (likely(head >= 0)) |
178 | goto add_head; | 179 | goto add_head; |
179 | } | 180 | } |
180 | 181 | ||