diff options
Diffstat (limited to 'drivers')
100 files changed, 1075 insertions, 694 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 611ce9061dc5..407ad13cac2f 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -968,7 +968,7 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) | |||
| 968 | } | 968 | } |
| 969 | return 0; | 969 | return 0; |
| 970 | } | 970 | } |
| 971 | EXPORT_SYMBOL_GPL(acpi_bus_get_device); | 971 | EXPORT_SYMBOL(acpi_bus_get_device); |
| 972 | 972 | ||
| 973 | int acpi_device_add(struct acpi_device *device, | 973 | int acpi_device_add(struct acpi_device *device, |
| 974 | void (*release)(struct device *)) | 974 | void (*release)(struct device *)) |
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index c9fd6943ce45..50329d1057ed 100644 --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c | |||
| @@ -210,25 +210,6 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) | |||
| 210 | } | 210 | } |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up) | ||
| 214 | { | ||
| 215 | u16 data; | ||
| 216 | |||
| 217 | if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) { | ||
| 218 | data = up ? 0x74 : 0x7C; | ||
| 219 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 220 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64); | ||
| 221 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 222 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
| 223 | } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) { | ||
| 224 | data = up ? 0x75 : 0x7D; | ||
| 225 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 226 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65); | ||
| 227 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 228 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
| 229 | } | ||
| 230 | } | ||
| 231 | |||
| 232 | /************************************************** | 213 | /************************************************** |
| 233 | * Init. | 214 | * Init. |
| 234 | **************************************************/ | 215 | **************************************************/ |
| @@ -255,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc) | |||
| 255 | bcma_core_pci_clientmode_init(pc); | 236 | bcma_core_pci_clientmode_init(pc); |
| 256 | } | 237 | } |
| 257 | 238 | ||
| 239 | void bcma_core_pci_power_save(struct bcma_bus *bus, bool up) | ||
| 240 | { | ||
| 241 | struct bcma_drv_pci *pc; | ||
| 242 | u16 data; | ||
| 243 | |||
| 244 | if (bus->hosttype != BCMA_HOSTTYPE_PCI) | ||
| 245 | return; | ||
| 246 | |||
| 247 | pc = &bus->drv_pci[0]; | ||
| 248 | |||
| 249 | if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) { | ||
| 250 | data = up ? 0x74 : 0x7C; | ||
| 251 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 252 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64); | ||
| 253 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 254 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
| 255 | } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) { | ||
| 256 | data = up ? 0x75 : 0x7D; | ||
| 257 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 258 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65); | ||
| 259 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
| 260 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
| 261 | } | ||
| 262 | } | ||
| 263 | EXPORT_SYMBOL_GPL(bcma_core_pci_power_save); | ||
| 264 | |||
| 258 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, | 265 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, |
| 259 | bool enable) | 266 | bool enable) |
| 260 | { | 267 | { |
| @@ -310,8 +317,6 @@ void bcma_core_pci_up(struct bcma_bus *bus) | |||
| 310 | 317 | ||
| 311 | pc = &bus->drv_pci[0]; | 318 | pc = &bus->drv_pci[0]; |
| 312 | 319 | ||
| 313 | bcma_core_pci_power_save(pc, true); | ||
| 314 | |||
| 315 | bcma_core_pci_extend_L1timer(pc, true); | 320 | bcma_core_pci_extend_L1timer(pc, true); |
| 316 | } | 321 | } |
| 317 | EXPORT_SYMBOL_GPL(bcma_core_pci_up); | 322 | EXPORT_SYMBOL_GPL(bcma_core_pci_up); |
| @@ -326,7 +331,5 @@ void bcma_core_pci_down(struct bcma_bus *bus) | |||
| 326 | pc = &bus->drv_pci[0]; | 331 | pc = &bus->drv_pci[0]; |
| 327 | 332 | ||
| 328 | bcma_core_pci_extend_L1timer(pc, false); | 333 | bcma_core_pci_extend_L1timer(pc, false); |
| 329 | |||
| 330 | bcma_core_pci_power_save(pc, false); | ||
| 331 | } | 334 | } |
| 332 | EXPORT_SYMBOL_GPL(bcma_core_pci_down); | 335 | EXPORT_SYMBOL_GPL(bcma_core_pci_down); |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index a12b923bbaca..0a327f4154a2 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
| @@ -85,6 +85,7 @@ static struct usb_device_id ath3k_table[] = { | |||
| 85 | { USB_DEVICE(0x04CA, 0x3008) }, | 85 | { USB_DEVICE(0x04CA, 0x3008) }, |
| 86 | { USB_DEVICE(0x13d3, 0x3362) }, | 86 | { USB_DEVICE(0x13d3, 0x3362) }, |
| 87 | { USB_DEVICE(0x0CF3, 0xE004) }, | 87 | { USB_DEVICE(0x0CF3, 0xE004) }, |
| 88 | { USB_DEVICE(0x0CF3, 0xE005) }, | ||
| 88 | { USB_DEVICE(0x0930, 0x0219) }, | 89 | { USB_DEVICE(0x0930, 0x0219) }, |
| 89 | { USB_DEVICE(0x0489, 0xe057) }, | 90 | { USB_DEVICE(0x0489, 0xe057) }, |
| 90 | { USB_DEVICE(0x13d3, 0x3393) }, | 91 | { USB_DEVICE(0x13d3, 0x3393) }, |
| @@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
| 126 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, | 127 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 127 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 128 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
| 128 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 129 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
| 130 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | ||
| 129 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, | 131 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, |
| 130 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, | 132 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, |
| 131 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, | 133 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 8e16f0af6358..f3dfc0a88fdc 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { | |||
| 102 | 102 | ||
| 103 | /* Broadcom BCM20702A0 */ | 103 | /* Broadcom BCM20702A0 */ |
| 104 | { USB_DEVICE(0x0b05, 0x17b5) }, | 104 | { USB_DEVICE(0x0b05, 0x17b5) }, |
| 105 | { USB_DEVICE(0x0b05, 0x17cb) }, | ||
| 105 | { USB_DEVICE(0x04ca, 0x2003) }, | 106 | { USB_DEVICE(0x04ca, 0x2003) }, |
| 106 | { USB_DEVICE(0x0489, 0xe042) }, | 107 | { USB_DEVICE(0x0489, 0xe042) }, |
| 107 | { USB_DEVICE(0x413c, 0x8197) }, | 108 | { USB_DEVICE(0x413c, 0x8197) }, |
| @@ -112,6 +113,9 @@ static struct usb_device_id btusb_table[] = { | |||
| 112 | /*Broadcom devices with vendor specific id */ | 113 | /*Broadcom devices with vendor specific id */ |
| 113 | { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, | 114 | { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, |
| 114 | 115 | ||
| 116 | /* Belkin F8065bf - Broadcom based */ | ||
| 117 | { USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) }, | ||
| 118 | |||
| 115 | { } /* Terminating entry */ | 119 | { } /* Terminating entry */ |
| 116 | }; | 120 | }; |
| 117 | 121 | ||
| @@ -148,6 +152,7 @@ static struct usb_device_id blacklist_table[] = { | |||
| 148 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, | 152 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 149 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 153 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
| 150 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 154 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
| 155 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | ||
| 151 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, | 156 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, |
| 152 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, | 157 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, |
| 153 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, | 158 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 200926699778..2e6c275322f1 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c | |||
| @@ -280,7 +280,7 @@ asmlinkage void __naked cci_enable_port_for_self(void) | |||
| 280 | 280 | ||
| 281 | /* Enable the CCI port */ | 281 | /* Enable the CCI port */ |
| 282 | " ldr r0, [r0, %[offsetof_port_phys]] \n" | 282 | " ldr r0, [r0, %[offsetof_port_phys]] \n" |
| 283 | " mov r3, #"__stringify(CCI_ENABLE_REQ)" \n" | 283 | " mov r3, %[cci_enable_req]\n" |
| 284 | " str r3, [r0, #"__stringify(CCI_PORT_CTRL)"] \n" | 284 | " str r3, [r0, #"__stringify(CCI_PORT_CTRL)"] \n" |
| 285 | 285 | ||
| 286 | /* poll the status reg for completion */ | 286 | /* poll the status reg for completion */ |
| @@ -288,7 +288,7 @@ asmlinkage void __naked cci_enable_port_for_self(void) | |||
| 288 | " ldr r0, [r1] \n" | 288 | " ldr r0, [r1] \n" |
| 289 | " ldr r0, [r0, r1] @ cci_ctrl_base \n" | 289 | " ldr r0, [r0, r1] @ cci_ctrl_base \n" |
| 290 | "4: ldr r1, [r0, #"__stringify(CCI_CTRL_STATUS)"] \n" | 290 | "4: ldr r1, [r0, #"__stringify(CCI_CTRL_STATUS)"] \n" |
| 291 | " tst r1, #1 \n" | 291 | " tst r1, %[cci_control_status_bits] \n" |
| 292 | " bne 4b \n" | 292 | " bne 4b \n" |
| 293 | 293 | ||
| 294 | " mov r0, #0 \n" | 294 | " mov r0, #0 \n" |
| @@ -301,6 +301,8 @@ asmlinkage void __naked cci_enable_port_for_self(void) | |||
| 301 | "7: .word cci_ctrl_phys - . \n" | 301 | "7: .word cci_ctrl_phys - . \n" |
| 302 | : : | 302 | : : |
| 303 | [sizeof_cpu_port] "i" (sizeof(cpu_port)), | 303 | [sizeof_cpu_port] "i" (sizeof(cpu_port)), |
| 304 | [cci_enable_req] "i" cpu_to_le32(CCI_ENABLE_REQ), | ||
| 305 | [cci_control_status_bits] "i" cpu_to_le32(1), | ||
| 304 | #ifndef __ARMEB__ | 306 | #ifndef __ARMEB__ |
| 305 | [offsetof_cpu_port_mpidr_lsb] "i" (offsetof(struct cpu_port, mpidr)), | 307 | [offsetof_cpu_port_mpidr_lsb] "i" (offsetof(struct cpu_port, mpidr)), |
| 306 | #else | 308 | #else |
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 19ab6ff53d59..2394e9753ef5 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c | |||
| @@ -700,6 +700,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, | |||
| 700 | phys_addr_t sdramwins_phys_base, | 700 | phys_addr_t sdramwins_phys_base, |
| 701 | size_t sdramwins_size) | 701 | size_t sdramwins_size) |
| 702 | { | 702 | { |
| 703 | struct device_node *np; | ||
| 703 | int win; | 704 | int win; |
| 704 | 705 | ||
| 705 | mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size); | 706 | mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size); |
| @@ -712,8 +713,11 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, | |||
| 712 | return -ENOMEM; | 713 | return -ENOMEM; |
| 713 | } | 714 | } |
| 714 | 715 | ||
| 715 | if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric")) | 716 | np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); |
| 717 | if (np) { | ||
| 716 | mbus->hw_io_coherency = 1; | 718 | mbus->hw_io_coherency = 1; |
| 719 | of_node_put(np); | ||
| 720 | } | ||
| 717 | 721 | ||
| 718 | for (win = 0; win < mbus->soc->num_wins; win++) | 722 | for (win = 0; win < mbus->soc->num_wins; win++) |
| 719 | mvebu_mbus_disable_window(mbus, win); | 723 | mvebu_mbus_disable_window(mbus, win); |
| @@ -861,11 +865,13 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np, | |||
| 861 | int ret; | 865 | int ret; |
| 862 | 866 | ||
| 863 | /* | 867 | /* |
| 864 | * These are optional, so we clear them and they'll | 868 | * These are optional, so we make sure that resource_size(x) will |
| 865 | * be zero if they are missing from the DT. | 869 | * return 0. |
| 866 | */ | 870 | */ |
| 867 | memset(mem, 0, sizeof(struct resource)); | 871 | memset(mem, 0, sizeof(struct resource)); |
| 872 | mem->end = -1; | ||
| 868 | memset(io, 0, sizeof(struct resource)); | 873 | memset(io, 0, sizeof(struct resource)); |
| 874 | io->end = -1; | ||
| 869 | 875 | ||
| 870 | ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg)); | 876 | ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg)); |
| 871 | if (!ret) { | 877 | if (!ret) { |
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 78c49d8e0f4a..c522a95c0e16 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
| @@ -229,7 +229,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
| 229 | if (of_property_read_u32(np, "clock-latency", &transition_latency)) | 229 | if (of_property_read_u32(np, "clock-latency", &transition_latency)) |
| 230 | transition_latency = CPUFREQ_ETERNAL; | 230 | transition_latency = CPUFREQ_ETERNAL; |
| 231 | 231 | ||
| 232 | if (cpu_reg) { | 232 | if (!IS_ERR(cpu_reg)) { |
| 233 | struct opp *opp; | 233 | struct opp *opp; |
| 234 | unsigned long min_uV, max_uV; | 234 | unsigned long min_uV, max_uV; |
| 235 | int i; | 235 | int i; |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 9733f29ed148..32b3479a2405 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
| @@ -394,7 +394,10 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) | |||
| 394 | trace_cpu_frequency(pstate * 100000, cpu->cpu); | 394 | trace_cpu_frequency(pstate * 100000, cpu->cpu); |
| 395 | 395 | ||
| 396 | cpu->pstate.current_pstate = pstate; | 396 | cpu->pstate.current_pstate = pstate; |
| 397 | wrmsrl(MSR_IA32_PERF_CTL, pstate << 8); | 397 | if (limits.no_turbo) |
| 398 | wrmsrl(MSR_IA32_PERF_CTL, BIT(32) | (pstate << 8)); | ||
| 399 | else | ||
| 400 | wrmsrl(MSR_IA32_PERF_CTL, pstate << 8); | ||
| 398 | 401 | ||
| 399 | } | 402 | } |
| 400 | 403 | ||
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 19e364fa5955..3f418166ce02 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c | |||
| @@ -113,7 +113,7 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy, | |||
| 113 | unsigned int target_freq, unsigned int relation) | 113 | unsigned int target_freq, unsigned int relation) |
| 114 | { | 114 | { |
| 115 | struct cpufreq_freqs freqs; | 115 | struct cpufreq_freqs freqs; |
| 116 | unsigned long newfreq; | 116 | long newfreq; |
| 117 | struct clk *srcclk; | 117 | struct clk *srcclk; |
| 118 | int index, ret, mult = 1; | 118 | int index, ret, mult = 1; |
| 119 | 119 | ||
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 526ec77c7ba0..f238cfd33847 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
| @@ -198,6 +198,7 @@ config TI_EDMA | |||
| 198 | depends on ARCH_DAVINCI || ARCH_OMAP | 198 | depends on ARCH_DAVINCI || ARCH_OMAP |
| 199 | select DMA_ENGINE | 199 | select DMA_ENGINE |
| 200 | select DMA_VIRTUAL_CHANNELS | 200 | select DMA_VIRTUAL_CHANNELS |
| 201 | select TI_PRIV_EDMA | ||
| 201 | default n | 202 | default n |
| 202 | help | 203 | help |
| 203 | Enable support for the TI EDMA controller. This DMA | 204 | Enable support for the TI EDMA controller. This DMA |
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index ff50ff4c6a57..098a8da450f0 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
| @@ -749,6 +749,6 @@ static void __exit edma_exit(void) | |||
| 749 | } | 749 | } |
| 750 | module_exit(edma_exit); | 750 | module_exit(edma_exit); |
| 751 | 751 | ||
| 752 | MODULE_AUTHOR("Matt Porter <mporter@ti.com>"); | 752 | MODULE_AUTHOR("Matt Porter <matt.porter@linaro.org>"); |
| 753 | MODULE_DESCRIPTION("TI EDMA DMA engine driver"); | 753 | MODULE_DESCRIPTION("TI EDMA DMA engine driver"); |
| 754 | MODULE_LICENSE("GPL v2"); | 754 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 78f8ca5fccee..55852c026791 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c | |||
| @@ -437,17 +437,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) | |||
| 437 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 437 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
| 438 | int chno = imxdmac->channel; | 438 | int chno = imxdmac->channel; |
| 439 | struct imxdma_desc *desc; | 439 | struct imxdma_desc *desc; |
| 440 | unsigned long flags; | ||
| 440 | 441 | ||
| 441 | spin_lock(&imxdma->lock); | 442 | spin_lock_irqsave(&imxdma->lock, flags); |
| 442 | if (list_empty(&imxdmac->ld_active)) { | 443 | if (list_empty(&imxdmac->ld_active)) { |
| 443 | spin_unlock(&imxdma->lock); | 444 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 444 | goto out; | 445 | goto out; |
| 445 | } | 446 | } |
| 446 | 447 | ||
| 447 | desc = list_first_entry(&imxdmac->ld_active, | 448 | desc = list_first_entry(&imxdmac->ld_active, |
| 448 | struct imxdma_desc, | 449 | struct imxdma_desc, |
| 449 | node); | 450 | node); |
| 450 | spin_unlock(&imxdma->lock); | 451 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 451 | 452 | ||
| 452 | if (desc->sg) { | 453 | if (desc->sg) { |
| 453 | u32 tmp; | 454 | u32 tmp; |
| @@ -519,7 +520,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 519 | { | 520 | { |
| 520 | struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); | 521 | struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); |
| 521 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 522 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
| 522 | unsigned long flags; | ||
| 523 | int slot = -1; | 523 | int slot = -1; |
| 524 | int i; | 524 | int i; |
| 525 | 525 | ||
| @@ -527,7 +527,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 527 | switch (d->type) { | 527 | switch (d->type) { |
| 528 | case IMXDMA_DESC_INTERLEAVED: | 528 | case IMXDMA_DESC_INTERLEAVED: |
| 529 | /* Try to get a free 2D slot */ | 529 | /* Try to get a free 2D slot */ |
| 530 | spin_lock_irqsave(&imxdma->lock, flags); | ||
| 531 | for (i = 0; i < IMX_DMA_2D_SLOTS; i++) { | 530 | for (i = 0; i < IMX_DMA_2D_SLOTS; i++) { |
| 532 | if ((imxdma->slots_2d[i].count > 0) && | 531 | if ((imxdma->slots_2d[i].count > 0) && |
| 533 | ((imxdma->slots_2d[i].xsr != d->x) || | 532 | ((imxdma->slots_2d[i].xsr != d->x) || |
| @@ -537,10 +536,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 537 | slot = i; | 536 | slot = i; |
| 538 | break; | 537 | break; |
| 539 | } | 538 | } |
| 540 | if (slot < 0) { | 539 | if (slot < 0) |
| 541 | spin_unlock_irqrestore(&imxdma->lock, flags); | ||
| 542 | return -EBUSY; | 540 | return -EBUSY; |
| 543 | } | ||
| 544 | 541 | ||
| 545 | imxdma->slots_2d[slot].xsr = d->x; | 542 | imxdma->slots_2d[slot].xsr = d->x; |
| 546 | imxdma->slots_2d[slot].ysr = d->y; | 543 | imxdma->slots_2d[slot].ysr = d->y; |
| @@ -549,7 +546,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 549 | 546 | ||
| 550 | imxdmac->slot_2d = slot; | 547 | imxdmac->slot_2d = slot; |
| 551 | imxdmac->enabled_2d = true; | 548 | imxdmac->enabled_2d = true; |
| 552 | spin_unlock_irqrestore(&imxdma->lock, flags); | ||
| 553 | 549 | ||
| 554 | if (slot == IMX_DMA_2D_SLOT_A) { | 550 | if (slot == IMX_DMA_2D_SLOT_A) { |
| 555 | d->config_mem &= ~CCR_MSEL_B; | 551 | d->config_mem &= ~CCR_MSEL_B; |
| @@ -625,18 +621,17 @@ static void imxdma_tasklet(unsigned long data) | |||
| 625 | struct imxdma_channel *imxdmac = (void *)data; | 621 | struct imxdma_channel *imxdmac = (void *)data; |
| 626 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 622 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
| 627 | struct imxdma_desc *desc; | 623 | struct imxdma_desc *desc; |
| 624 | unsigned long flags; | ||
| 628 | 625 | ||
| 629 | spin_lock(&imxdma->lock); | 626 | spin_lock_irqsave(&imxdma->lock, flags); |
| 630 | 627 | ||
| 631 | if (list_empty(&imxdmac->ld_active)) { | 628 | if (list_empty(&imxdmac->ld_active)) { |
| 632 | /* Someone might have called terminate all */ | 629 | /* Someone might have called terminate all */ |
| 633 | goto out; | 630 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 631 | return; | ||
| 634 | } | 632 | } |
| 635 | desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node); | 633 | desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node); |
| 636 | 634 | ||
| 637 | if (desc->desc.callback) | ||
| 638 | desc->desc.callback(desc->desc.callback_param); | ||
| 639 | |||
| 640 | /* If we are dealing with a cyclic descriptor, keep it on ld_active | 635 | /* If we are dealing with a cyclic descriptor, keep it on ld_active |
| 641 | * and dont mark the descriptor as complete. | 636 | * and dont mark the descriptor as complete. |
| 642 | * Only in non-cyclic cases it would be marked as complete | 637 | * Only in non-cyclic cases it would be marked as complete |
| @@ -663,7 +658,11 @@ static void imxdma_tasklet(unsigned long data) | |||
| 663 | __func__, imxdmac->channel); | 658 | __func__, imxdmac->channel); |
| 664 | } | 659 | } |
| 665 | out: | 660 | out: |
| 666 | spin_unlock(&imxdma->lock); | 661 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 662 | |||
| 663 | if (desc->desc.callback) | ||
| 664 | desc->desc.callback(desc->desc.callback_param); | ||
| 665 | |||
| 667 | } | 666 | } |
| 668 | 667 | ||
| 669 | static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | 668 | static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, |
| @@ -883,7 +882,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( | |||
| 883 | kfree(imxdmac->sg_list); | 882 | kfree(imxdmac->sg_list); |
| 884 | 883 | ||
| 885 | imxdmac->sg_list = kcalloc(periods + 1, | 884 | imxdmac->sg_list = kcalloc(periods + 1, |
| 886 | sizeof(struct scatterlist), GFP_KERNEL); | 885 | sizeof(struct scatterlist), GFP_ATOMIC); |
| 887 | if (!imxdmac->sg_list) | 886 | if (!imxdmac->sg_list) |
| 888 | return NULL; | 887 | return NULL; |
| 889 | 888 | ||
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 0ff43552d472..89675f862308 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
| @@ -63,6 +63,7 @@ struct gpio_bank { | |||
| 63 | struct gpio_chip chip; | 63 | struct gpio_chip chip; |
| 64 | struct clk *dbck; | 64 | struct clk *dbck; |
| 65 | u32 mod_usage; | 65 | u32 mod_usage; |
| 66 | u32 irq_usage; | ||
| 66 | u32 dbck_enable_mask; | 67 | u32 dbck_enable_mask; |
| 67 | bool dbck_enabled; | 68 | bool dbck_enabled; |
| 68 | struct device *dev; | 69 | struct device *dev; |
| @@ -86,6 +87,9 @@ struct gpio_bank { | |||
| 86 | #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio)) | 87 | #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio)) |
| 87 | #define GPIO_MOD_CTRL_BIT BIT(0) | 88 | #define GPIO_MOD_CTRL_BIT BIT(0) |
| 88 | 89 | ||
| 90 | #define BANK_USED(bank) (bank->mod_usage || bank->irq_usage) | ||
| 91 | #define LINE_USED(line, offset) (line & (1 << offset)) | ||
| 92 | |||
| 89 | static int irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq) | 93 | static int irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq) |
| 90 | { | 94 | { |
| 91 | return bank->chip.base + gpio_irq; | 95 | return bank->chip.base + gpio_irq; |
| @@ -420,15 +424,69 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, | |||
| 420 | return 0; | 424 | return 0; |
| 421 | } | 425 | } |
| 422 | 426 | ||
| 427 | static void _enable_gpio_module(struct gpio_bank *bank, unsigned offset) | ||
| 428 | { | ||
| 429 | if (bank->regs->pinctrl) { | ||
| 430 | void __iomem *reg = bank->base + bank->regs->pinctrl; | ||
| 431 | |||
| 432 | /* Claim the pin for MPU */ | ||
| 433 | __raw_writel(__raw_readl(reg) | (1 << offset), reg); | ||
| 434 | } | ||
| 435 | |||
| 436 | if (bank->regs->ctrl && !BANK_USED(bank)) { | ||
| 437 | void __iomem *reg = bank->base + bank->regs->ctrl; | ||
| 438 | u32 ctrl; | ||
| 439 | |||
| 440 | ctrl = __raw_readl(reg); | ||
| 441 | /* Module is enabled, clocks are not gated */ | ||
| 442 | ctrl &= ~GPIO_MOD_CTRL_BIT; | ||
| 443 | __raw_writel(ctrl, reg); | ||
| 444 | bank->context.ctrl = ctrl; | ||
| 445 | } | ||
| 446 | } | ||
| 447 | |||
| 448 | static void _disable_gpio_module(struct gpio_bank *bank, unsigned offset) | ||
| 449 | { | ||
| 450 | void __iomem *base = bank->base; | ||
| 451 | |||
| 452 | if (bank->regs->wkup_en && | ||
| 453 | !LINE_USED(bank->mod_usage, offset) && | ||
| 454 | !LINE_USED(bank->irq_usage, offset)) { | ||
| 455 | /* Disable wake-up during idle for dynamic tick */ | ||
| 456 | _gpio_rmw(base, bank->regs->wkup_en, 1 << offset, 0); | ||
| 457 | bank->context.wake_en = | ||
| 458 | __raw_readl(bank->base + bank->regs->wkup_en); | ||
| 459 | } | ||
| 460 | |||
| 461 | if (bank->regs->ctrl && !BANK_USED(bank)) { | ||
| 462 | void __iomem *reg = bank->base + bank->regs->ctrl; | ||
| 463 | u32 ctrl; | ||
| 464 | |||
| 465 | ctrl = __raw_readl(reg); | ||
| 466 | /* Module is disabled, clocks are gated */ | ||
| 467 | ctrl |= GPIO_MOD_CTRL_BIT; | ||
| 468 | __raw_writel(ctrl, reg); | ||
| 469 | bank->context.ctrl = ctrl; | ||
| 470 | } | ||
| 471 | } | ||
| 472 | |||
| 473 | static int gpio_is_input(struct gpio_bank *bank, int mask) | ||
| 474 | { | ||
| 475 | void __iomem *reg = bank->base + bank->regs->direction; | ||
| 476 | |||
| 477 | return __raw_readl(reg) & mask; | ||
| 478 | } | ||
| 479 | |||
| 423 | static int gpio_irq_type(struct irq_data *d, unsigned type) | 480 | static int gpio_irq_type(struct irq_data *d, unsigned type) |
| 424 | { | 481 | { |
| 425 | struct gpio_bank *bank = irq_data_get_irq_chip_data(d); | 482 | struct gpio_bank *bank = irq_data_get_irq_chip_data(d); |
| 426 | unsigned gpio = 0; | 483 | unsigned gpio = 0; |
| 427 | int retval; | 484 | int retval; |
| 428 | unsigned long flags; | 485 | unsigned long flags; |
| 486 | unsigned offset; | ||
| 429 | 487 | ||
| 430 | if (WARN_ON(!bank->mod_usage)) | 488 | if (!BANK_USED(bank)) |
| 431 | return -EINVAL; | 489 | pm_runtime_get_sync(bank->dev); |
| 432 | 490 | ||
| 433 | #ifdef CONFIG_ARCH_OMAP1 | 491 | #ifdef CONFIG_ARCH_OMAP1 |
| 434 | if (d->irq > IH_MPUIO_BASE) | 492 | if (d->irq > IH_MPUIO_BASE) |
| @@ -446,7 +504,17 @@ static int gpio_irq_type(struct irq_data *d, unsigned type) | |||
| 446 | return -EINVAL; | 504 | return -EINVAL; |
| 447 | 505 | ||
| 448 | spin_lock_irqsave(&bank->lock, flags); | 506 | spin_lock_irqsave(&bank->lock, flags); |
| 449 | retval = _set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), type); | 507 | offset = GPIO_INDEX(bank, gpio); |
| 508 | retval = _set_gpio_triggering(bank, offset, type); | ||
| 509 | if (!LINE_USED(bank->mod_usage, offset)) { | ||
| 510 | _enable_gpio_module(bank, offset); | ||
| 511 | _set_gpio_direction(bank, offset, 1); | ||
| 512 | } else if (!gpio_is_input(bank, 1 << offset)) { | ||
| 513 | spin_unlock_irqrestore(&bank->lock, flags); | ||
| 514 | return -EINVAL; | ||
| 515 | } | ||
| 516 | |||
| 517 | bank->irq_usage |= 1 << GPIO_INDEX(bank, gpio); | ||
| 450 | spin_unlock_irqrestore(&bank->lock, flags); | 518 | spin_unlock_irqrestore(&bank->lock, flags); |
| 451 | 519 | ||
| 452 | if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) | 520 | if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) |
| @@ -603,35 +671,19 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) | |||
| 603 | * If this is the first gpio_request for the bank, | 671 | * If this is the first gpio_request for the bank, |
| 604 | * enable the bank module. | 672 | * enable the bank module. |
| 605 | */ | 673 | */ |
| 606 | if (!bank->mod_usage) | 674 | if (!BANK_USED(bank)) |
| 607 | pm_runtime_get_sync(bank->dev); | 675 | pm_runtime_get_sync(bank->dev); |
| 608 | 676 | ||
| 609 | spin_lock_irqsave(&bank->lock, flags); | 677 | spin_lock_irqsave(&bank->lock, flags); |
| 610 | /* Set trigger to none. You need to enable the desired trigger with | 678 | /* Set trigger to none. You need to enable the desired trigger with |
| 611 | * request_irq() or set_irq_type(). | 679 | * request_irq() or set_irq_type(). Only do this if the IRQ line has |
| 680 | * not already been requested. | ||
| 612 | */ | 681 | */ |
| 613 | _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE); | 682 | if (!LINE_USED(bank->irq_usage, offset)) { |
| 614 | 683 | _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE); | |
| 615 | if (bank->regs->pinctrl) { | 684 | _enable_gpio_module(bank, offset); |
| 616 | void __iomem *reg = bank->base + bank->regs->pinctrl; | ||
| 617 | |||
| 618 | /* Claim the pin for MPU */ | ||
| 619 | __raw_writel(__raw_readl(reg) | (1 << offset), reg); | ||
| 620 | } | ||
| 621 | |||
| 622 | if (bank->regs->ctrl && !bank->mod_usage) { | ||
| 623 | void __iomem *reg = bank->base + bank->regs->ctrl; | ||
| 624 | u32 ctrl; | ||
| 625 | |||
| 626 | ctrl = __raw_readl(reg); | ||
| 627 | /* Module is enabled, clocks are not gated */ | ||
| 628 | ctrl &= ~GPIO_MOD_CTRL_BIT; | ||
| 629 | __raw_writel(ctrl, reg); | ||
| 630 | bank->context.ctrl = ctrl; | ||
| 631 | } | 685 | } |
| 632 | |||
| 633 | bank->mod_usage |= 1 << offset; | 686 | bank->mod_usage |= 1 << offset; |
| 634 | |||
| 635 | spin_unlock_irqrestore(&bank->lock, flags); | 687 | spin_unlock_irqrestore(&bank->lock, flags); |
| 636 | 688 | ||
| 637 | return 0; | 689 | return 0; |
| @@ -640,31 +692,11 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) | |||
| 640 | static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) | 692 | static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) |
| 641 | { | 693 | { |
| 642 | struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip); | 694 | struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip); |
| 643 | void __iomem *base = bank->base; | ||
| 644 | unsigned long flags; | 695 | unsigned long flags; |
| 645 | 696 | ||
| 646 | spin_lock_irqsave(&bank->lock, flags); | 697 | spin_lock_irqsave(&bank->lock, flags); |
| 647 | |||
| 648 | if (bank->regs->wkup_en) { | ||
| 649 | /* Disable wake-up during idle for dynamic tick */ | ||
| 650 | _gpio_rmw(base, bank->regs->wkup_en, 1 << offset, 0); | ||
| 651 | bank->context.wake_en = | ||
| 652 | __raw_readl(bank->base + bank->regs->wkup_en); | ||
| 653 | } | ||
| 654 | |||
| 655 | bank->mod_usage &= ~(1 << offset); | 698 | bank->mod_usage &= ~(1 << offset); |
| 656 | 699 | _disable_gpio_module(bank, offset); | |
| 657 | if (bank->regs->ctrl && !bank->mod_usage) { | ||
| 658 | void __iomem *reg = bank->base + bank->regs->ctrl; | ||
| 659 | u32 ctrl; | ||
| 660 | |||
| 661 | ctrl = __raw_readl(reg); | ||
| 662 | /* Module is disabled, clocks are gated */ | ||
| 663 | ctrl |= GPIO_MOD_CTRL_BIT; | ||
| 664 | __raw_writel(ctrl, reg); | ||
| 665 | bank->context.ctrl = ctrl; | ||
| 666 | } | ||
| 667 | |||
| 668 | _reset_gpio(bank, bank->chip.base + offset); | 700 | _reset_gpio(bank, bank->chip.base + offset); |
| 669 | spin_unlock_irqrestore(&bank->lock, flags); | 701 | spin_unlock_irqrestore(&bank->lock, flags); |
| 670 | 702 | ||
| @@ -672,7 +704,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) | |||
| 672 | * If this is the last gpio to be freed in the bank, | 704 | * If this is the last gpio to be freed in the bank, |
| 673 | * disable the bank module. | 705 | * disable the bank module. |
| 674 | */ | 706 | */ |
| 675 | if (!bank->mod_usage) | 707 | if (!BANK_USED(bank)) |
| 676 | pm_runtime_put(bank->dev); | 708 | pm_runtime_put(bank->dev); |
| 677 | } | 709 | } |
| 678 | 710 | ||
| @@ -762,10 +794,20 @@ static void gpio_irq_shutdown(struct irq_data *d) | |||
| 762 | struct gpio_bank *bank = irq_data_get_irq_chip_data(d); | 794 | struct gpio_bank *bank = irq_data_get_irq_chip_data(d); |
| 763 | unsigned int gpio = irq_to_gpio(bank, d->hwirq); | 795 | unsigned int gpio = irq_to_gpio(bank, d->hwirq); |
| 764 | unsigned long flags; | 796 | unsigned long flags; |
| 797 | unsigned offset = GPIO_INDEX(bank, gpio); | ||
| 765 | 798 | ||
| 766 | spin_lock_irqsave(&bank->lock, flags); | 799 | spin_lock_irqsave(&bank->lock, flags); |
| 800 | bank->irq_usage &= ~(1 << offset); | ||
| 801 | _disable_gpio_module(bank, offset); | ||
| 767 | _reset_gpio(bank, gpio); | 802 | _reset_gpio(bank, gpio); |
| 768 | spin_unlock_irqrestore(&bank->lock, flags); | 803 | spin_unlock_irqrestore(&bank->lock, flags); |
| 804 | |||
| 805 | /* | ||
| 806 | * If this is the last IRQ to be freed in the bank, | ||
| 807 | * disable the bank module. | ||
| 808 | */ | ||
| 809 | if (!BANK_USED(bank)) | ||
| 810 | pm_runtime_put(bank->dev); | ||
| 769 | } | 811 | } |
| 770 | 812 | ||
| 771 | static void gpio_ack_irq(struct irq_data *d) | 813 | static void gpio_ack_irq(struct irq_data *d) |
| @@ -897,13 +939,6 @@ static int gpio_input(struct gpio_chip *chip, unsigned offset) | |||
| 897 | return 0; | 939 | return 0; |
| 898 | } | 940 | } |
| 899 | 941 | ||
| 900 | static int gpio_is_input(struct gpio_bank *bank, int mask) | ||
| 901 | { | ||
| 902 | void __iomem *reg = bank->base + bank->regs->direction; | ||
| 903 | |||
| 904 | return __raw_readl(reg) & mask; | ||
| 905 | } | ||
| 906 | |||
| 907 | static int gpio_get(struct gpio_chip *chip, unsigned offset) | 942 | static int gpio_get(struct gpio_chip *chip, unsigned offset) |
| 908 | { | 943 | { |
| 909 | struct gpio_bank *bank; | 944 | struct gpio_bank *bank; |
| @@ -922,13 +957,22 @@ static int gpio_output(struct gpio_chip *chip, unsigned offset, int value) | |||
| 922 | { | 957 | { |
| 923 | struct gpio_bank *bank; | 958 | struct gpio_bank *bank; |
| 924 | unsigned long flags; | 959 | unsigned long flags; |
| 960 | int retval = 0; | ||
| 925 | 961 | ||
| 926 | bank = container_of(chip, struct gpio_bank, chip); | 962 | bank = container_of(chip, struct gpio_bank, chip); |
| 927 | spin_lock_irqsave(&bank->lock, flags); | 963 | spin_lock_irqsave(&bank->lock, flags); |
| 964 | |||
| 965 | if (LINE_USED(bank->irq_usage, offset)) { | ||
| 966 | retval = -EINVAL; | ||
| 967 | goto exit; | ||
| 968 | } | ||
| 969 | |||
| 928 | bank->set_dataout(bank, offset, value); | 970 | bank->set_dataout(bank, offset, value); |
| 929 | _set_gpio_direction(bank, offset, 0); | 971 | _set_gpio_direction(bank, offset, 0); |
| 972 | |||
| 973 | exit: | ||
| 930 | spin_unlock_irqrestore(&bank->lock, flags); | 974 | spin_unlock_irqrestore(&bank->lock, flags); |
| 931 | return 0; | 975 | return retval; |
| 932 | } | 976 | } |
| 933 | 977 | ||
| 934 | static int gpio_debounce(struct gpio_chip *chip, unsigned offset, | 978 | static int gpio_debounce(struct gpio_chip *chip, unsigned offset, |
| @@ -1400,7 +1444,7 @@ void omap2_gpio_prepare_for_idle(int pwr_mode) | |||
| 1400 | struct gpio_bank *bank; | 1444 | struct gpio_bank *bank; |
| 1401 | 1445 | ||
| 1402 | list_for_each_entry(bank, &omap_gpio_list, node) { | 1446 | list_for_each_entry(bank, &omap_gpio_list, node) { |
| 1403 | if (!bank->mod_usage || !bank->loses_context) | 1447 | if (!BANK_USED(bank) || !bank->loses_context) |
| 1404 | continue; | 1448 | continue; |
| 1405 | 1449 | ||
| 1406 | bank->power_mode = pwr_mode; | 1450 | bank->power_mode = pwr_mode; |
| @@ -1414,7 +1458,7 @@ void omap2_gpio_resume_after_idle(void) | |||
| 1414 | struct gpio_bank *bank; | 1458 | struct gpio_bank *bank; |
| 1415 | 1459 | ||
| 1416 | list_for_each_entry(bank, &omap_gpio_list, node) { | 1460 | list_for_each_entry(bank, &omap_gpio_list, node) { |
| 1417 | if (!bank->mod_usage || !bank->loses_context) | 1461 | if (!BANK_USED(bank) || !bank->loses_context) |
| 1418 | continue; | 1462 | continue; |
| 1419 | 1463 | ||
| 1420 | pm_runtime_get_sync(bank->dev); | 1464 | pm_runtime_get_sync(bank->dev); |
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index e3745eb07570..6038966ab045 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
| @@ -293,10 +293,9 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) | |||
| 293 | if (pdata) { | 293 | if (pdata) { |
| 294 | p->config = *pdata; | 294 | p->config = *pdata; |
| 295 | } else if (IS_ENABLED(CONFIG_OF) && np) { | 295 | } else if (IS_ENABLED(CONFIG_OF) && np) { |
| 296 | ret = of_parse_phandle_with_args(np, "gpio-ranges", | 296 | ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, |
| 297 | "#gpio-range-cells", 0, &args); | 297 | &args); |
| 298 | p->config.number_of_pins = ret == 0 && args.args_count == 3 | 298 | p->config.number_of_pins = ret == 0 ? args.args[2] |
| 299 | ? args.args[2] | ||
| 300 | : RCAR_MAX_GPIO_PER_BANK; | 299 | : RCAR_MAX_GPIO_PER_BANK; |
| 301 | p->config.gpio_base = -1; | 300 | p->config.gpio_base = -1; |
| 302 | } | 301 | } |
diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c index d0a79a4bce1c..ba6f6a91dfff 100644 --- a/drivers/iio/amplifiers/ad8366.c +++ b/drivers/iio/amplifiers/ad8366.c | |||
| @@ -185,10 +185,8 @@ static int ad8366_remove(struct spi_device *spi) | |||
| 185 | 185 | ||
| 186 | iio_device_unregister(indio_dev); | 186 | iio_device_unregister(indio_dev); |
| 187 | 187 | ||
| 188 | if (!IS_ERR(reg)) { | 188 | if (!IS_ERR(reg)) |
| 189 | regulator_disable(reg); | 189 | regulator_disable(reg); |
| 190 | regulator_put(reg); | ||
| 191 | } | ||
| 192 | 190 | ||
| 193 | return 0; | 191 | return 0; |
| 194 | } | 192 | } |
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 8e84cd522e49..f95c6979efd8 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
| @@ -852,7 +852,6 @@ static void iio_dev_release(struct device *device) | |||
| 852 | iio_device_unregister_trigger_consumer(indio_dev); | 852 | iio_device_unregister_trigger_consumer(indio_dev); |
| 853 | iio_device_unregister_eventset(indio_dev); | 853 | iio_device_unregister_eventset(indio_dev); |
| 854 | iio_device_unregister_sysfs(indio_dev); | 854 | iio_device_unregister_sysfs(indio_dev); |
| 855 | iio_device_unregister_debugfs(indio_dev); | ||
| 856 | 855 | ||
| 857 | ida_simple_remove(&iio_ida, indio_dev->id); | 856 | ida_simple_remove(&iio_ida, indio_dev->id); |
| 858 | kfree(indio_dev); | 857 | kfree(indio_dev); |
| @@ -1087,6 +1086,7 @@ void iio_device_unregister(struct iio_dev *indio_dev) | |||
| 1087 | 1086 | ||
| 1088 | if (indio_dev->chrdev.dev) | 1087 | if (indio_dev->chrdev.dev) |
| 1089 | cdev_del(&indio_dev->chrdev); | 1088 | cdev_del(&indio_dev->chrdev); |
| 1089 | iio_device_unregister_debugfs(indio_dev); | ||
| 1090 | 1090 | ||
| 1091 | iio_disable_all_buffers(indio_dev); | 1091 | iio_disable_all_buffers(indio_dev); |
| 1092 | 1092 | ||
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index e8d2849cc81d..cab3bc7494a2 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c | |||
| @@ -29,9 +29,9 @@ | |||
| 29 | #define ST_MAGN_NUMBER_DATA_CHANNELS 3 | 29 | #define ST_MAGN_NUMBER_DATA_CHANNELS 3 |
| 30 | 30 | ||
| 31 | /* DEFAULT VALUE FOR SENSORS */ | 31 | /* DEFAULT VALUE FOR SENSORS */ |
| 32 | #define ST_MAGN_DEFAULT_OUT_X_L_ADDR 0X04 | 32 | #define ST_MAGN_DEFAULT_OUT_X_H_ADDR 0X03 |
| 33 | #define ST_MAGN_DEFAULT_OUT_Y_L_ADDR 0X08 | 33 | #define ST_MAGN_DEFAULT_OUT_Y_H_ADDR 0X07 |
| 34 | #define ST_MAGN_DEFAULT_OUT_Z_L_ADDR 0X06 | 34 | #define ST_MAGN_DEFAULT_OUT_Z_H_ADDR 0X05 |
| 35 | 35 | ||
| 36 | /* FULLSCALE */ | 36 | /* FULLSCALE */ |
| 37 | #define ST_MAGN_FS_AVL_1300MG 1300 | 37 | #define ST_MAGN_FS_AVL_1300MG 1300 |
| @@ -117,16 +117,16 @@ | |||
| 117 | static const struct iio_chan_spec st_magn_16bit_channels[] = { | 117 | static const struct iio_chan_spec st_magn_16bit_channels[] = { |
| 118 | ST_SENSORS_LSM_CHANNELS(IIO_MAGN, | 118 | ST_SENSORS_LSM_CHANNELS(IIO_MAGN, |
| 119 | BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), | 119 | BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), |
| 120 | ST_SENSORS_SCAN_X, 1, IIO_MOD_X, 's', IIO_LE, 16, 16, | 120 | ST_SENSORS_SCAN_X, 1, IIO_MOD_X, 's', IIO_BE, 16, 16, |
| 121 | ST_MAGN_DEFAULT_OUT_X_L_ADDR), | 121 | ST_MAGN_DEFAULT_OUT_X_H_ADDR), |
| 122 | ST_SENSORS_LSM_CHANNELS(IIO_MAGN, | 122 | ST_SENSORS_LSM_CHANNELS(IIO_MAGN, |
| 123 | BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), | 123 | BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), |
| 124 | ST_SENSORS_SCAN_Y, 1, IIO_MOD_Y, 's', IIO_LE, 16, 16, | 124 | ST_SENSORS_SCAN_Y, 1, IIO_MOD_Y, 's', IIO_BE, 16, 16, |
| 125 | ST_MAGN_DEFAULT_OUT_Y_L_ADDR), | 125 | ST_MAGN_DEFAULT_OUT_Y_H_ADDR), |
| 126 | ST_SENSORS_LSM_CHANNELS(IIO_MAGN, | 126 | ST_SENSORS_LSM_CHANNELS(IIO_MAGN, |
| 127 | BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), | 127 | BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), |
| 128 | ST_SENSORS_SCAN_Z, 1, IIO_MOD_Z, 's', IIO_LE, 16, 16, | 128 | ST_SENSORS_SCAN_Z, 1, IIO_MOD_Z, 's', IIO_BE, 16, 16, |
| 129 | ST_MAGN_DEFAULT_OUT_Z_L_ADDR), | 129 | ST_MAGN_DEFAULT_OUT_Z_H_ADDR), |
| 130 | IIO_CHAN_SOFT_TIMESTAMP(3) | 130 | IIO_CHAN_SOFT_TIMESTAMP(3) |
| 131 | }; | 131 | }; |
| 132 | 132 | ||
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 653ac6bfc57a..6c923c7039a1 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
| @@ -1588,7 +1588,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, | |||
| 1588 | int resp_data_len; | 1588 | int resp_data_len; |
| 1589 | int resp_len; | 1589 | int resp_len; |
| 1590 | 1590 | ||
| 1591 | resp_data_len = (rsp_code == SRP_TSK_MGMT_SUCCESS) ? 0 : 4; | 1591 | resp_data_len = 4; |
| 1592 | resp_len = sizeof(*srp_rsp) + resp_data_len; | 1592 | resp_len = sizeof(*srp_rsp) + resp_data_len; |
| 1593 | 1593 | ||
| 1594 | srp_rsp = ioctx->ioctx.buf; | 1594 | srp_rsp = ioctx->ioctx.buf; |
| @@ -1600,11 +1600,9 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, | |||
| 1600 | + atomic_xchg(&ch->req_lim_delta, 0)); | 1600 | + atomic_xchg(&ch->req_lim_delta, 0)); |
| 1601 | srp_rsp->tag = tag; | 1601 | srp_rsp->tag = tag; |
| 1602 | 1602 | ||
| 1603 | if (rsp_code != SRP_TSK_MGMT_SUCCESS) { | 1603 | srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID; |
| 1604 | srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID; | 1604 | srp_rsp->resp_data_len = cpu_to_be32(resp_data_len); |
| 1605 | srp_rsp->resp_data_len = cpu_to_be32(resp_data_len); | 1605 | srp_rsp->data[3] = rsp_code; |
| 1606 | srp_rsp->data[3] = rsp_code; | ||
| 1607 | } | ||
| 1608 | 1606 | ||
| 1609 | return resp_len; | 1607 | return resp_len; |
| 1610 | } | 1608 | } |
| @@ -2358,6 +2356,8 @@ static void srpt_release_channel_work(struct work_struct *w) | |||
| 2358 | transport_deregister_session(se_sess); | 2356 | transport_deregister_session(se_sess); |
| 2359 | ch->sess = NULL; | 2357 | ch->sess = NULL; |
| 2360 | 2358 | ||
| 2359 | ib_destroy_cm_id(ch->cm_id); | ||
| 2360 | |||
| 2361 | srpt_destroy_ch_ib(ch); | 2361 | srpt_destroy_ch_ib(ch); |
| 2362 | 2362 | ||
| 2363 | srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring, | 2363 | srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring, |
| @@ -2368,8 +2368,6 @@ static void srpt_release_channel_work(struct work_struct *w) | |||
| 2368 | list_del(&ch->list); | 2368 | list_del(&ch->list); |
| 2369 | spin_unlock_irq(&sdev->spinlock); | 2369 | spin_unlock_irq(&sdev->spinlock); |
| 2370 | 2370 | ||
| 2371 | ib_destroy_cm_id(ch->cm_id); | ||
| 2372 | |||
| 2373 | if (ch->release_done) | 2371 | if (ch->release_done) |
| 2374 | complete(ch->release_done); | 2372 | complete(ch->release_done); |
| 2375 | 2373 | ||
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index f417e89e1e7e..181c9ba929cd 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
| @@ -377,6 +377,7 @@ struct arm_smmu_cfg { | |||
| 377 | u32 cbar; | 377 | u32 cbar; |
| 378 | pgd_t *pgd; | 378 | pgd_t *pgd; |
| 379 | }; | 379 | }; |
| 380 | #define INVALID_IRPTNDX 0xff | ||
| 380 | 381 | ||
| 381 | #define ARM_SMMU_CB_ASID(cfg) ((cfg)->cbndx) | 382 | #define ARM_SMMU_CB_ASID(cfg) ((cfg)->cbndx) |
| 382 | #define ARM_SMMU_CB_VMID(cfg) ((cfg)->cbndx + 1) | 383 | #define ARM_SMMU_CB_VMID(cfg) ((cfg)->cbndx + 1) |
| @@ -840,7 +841,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, | |||
| 840 | if (IS_ERR_VALUE(ret)) { | 841 | if (IS_ERR_VALUE(ret)) { |
| 841 | dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n", | 842 | dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n", |
| 842 | root_cfg->irptndx, irq); | 843 | root_cfg->irptndx, irq); |
| 843 | root_cfg->irptndx = -1; | 844 | root_cfg->irptndx = INVALID_IRPTNDX; |
| 844 | goto out_free_context; | 845 | goto out_free_context; |
| 845 | } | 846 | } |
| 846 | 847 | ||
| @@ -869,7 +870,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain) | |||
| 869 | writel_relaxed(0, cb_base + ARM_SMMU_CB_SCTLR); | 870 | writel_relaxed(0, cb_base + ARM_SMMU_CB_SCTLR); |
| 870 | arm_smmu_tlb_inv_context(root_cfg); | 871 | arm_smmu_tlb_inv_context(root_cfg); |
| 871 | 872 | ||
| 872 | if (root_cfg->irptndx != -1) { | 873 | if (root_cfg->irptndx != INVALID_IRPTNDX) { |
| 873 | irq = smmu->irqs[smmu->num_global_irqs + root_cfg->irptndx]; | 874 | irq = smmu->irqs[smmu->num_global_irqs + root_cfg->irptndx]; |
| 874 | free_irq(irq, domain); | 875 | free_irq(irq, domain); |
| 875 | } | 876 | } |
| @@ -1857,8 +1858,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) | |||
| 1857 | goto out_put_parent; | 1858 | goto out_put_parent; |
| 1858 | } | 1859 | } |
| 1859 | 1860 | ||
| 1860 | arm_smmu_device_reset(smmu); | ||
| 1861 | |||
| 1862 | for (i = 0; i < smmu->num_global_irqs; ++i) { | 1861 | for (i = 0; i < smmu->num_global_irqs; ++i) { |
| 1863 | err = request_irq(smmu->irqs[i], | 1862 | err = request_irq(smmu->irqs[i], |
| 1864 | arm_smmu_global_fault, | 1863 | arm_smmu_global_fault, |
| @@ -1876,6 +1875,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) | |||
| 1876 | spin_lock(&arm_smmu_devices_lock); | 1875 | spin_lock(&arm_smmu_devices_lock); |
| 1877 | list_add(&smmu->list, &arm_smmu_devices); | 1876 | list_add(&smmu->list, &arm_smmu_devices); |
| 1878 | spin_unlock(&arm_smmu_devices_lock); | 1877 | spin_unlock(&arm_smmu_devices_lock); |
| 1878 | |||
| 1879 | arm_smmu_device_reset(smmu); | ||
| 1879 | return 0; | 1880 | return 0; |
| 1880 | 1881 | ||
| 1881 | out_free_irqs: | 1882 | out_free_irqs: |
| @@ -1966,10 +1967,10 @@ static int __init arm_smmu_init(void) | |||
| 1966 | return ret; | 1967 | return ret; |
| 1967 | 1968 | ||
| 1968 | /* Oh, for a proper bus abstraction */ | 1969 | /* Oh, for a proper bus abstraction */ |
| 1969 | if (!iommu_present(&platform_bus_type)); | 1970 | if (!iommu_present(&platform_bus_type)) |
| 1970 | bus_set_iommu(&platform_bus_type, &arm_smmu_ops); | 1971 | bus_set_iommu(&platform_bus_type, &arm_smmu_ops); |
| 1971 | 1972 | ||
| 1972 | if (!iommu_present(&amba_bustype)); | 1973 | if (!iommu_present(&amba_bustype)) |
| 1973 | bus_set_iommu(&amba_bustype, &arm_smmu_ops); | 1974 | bus_set_iommu(&amba_bustype, &arm_smmu_ops); |
| 1974 | 1975 | ||
| 1975 | return 0; | 1976 | return 0; |
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 87ed3fb5149a..f344659dceac 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
| @@ -113,14 +113,14 @@ static const struct sh_mobile_sdhi_ops sdhi_ops = { | |||
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | static const struct of_device_id sh_mobile_sdhi_of_match[] = { | 115 | static const struct of_device_id sh_mobile_sdhi_of_match[] = { |
| 116 | { .compatible = "renesas,shmobile-sdhi" }, | 116 | { .compatible = "renesas,sdhi-shmobile" }, |
| 117 | { .compatible = "renesas,sh7372-sdhi" }, | 117 | { .compatible = "renesas,sdhi-sh7372" }, |
| 118 | { .compatible = "renesas,sh73a0-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], }, | 118 | { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], }, |
| 119 | { .compatible = "renesas,r8a73a4-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], }, | 119 | { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], }, |
| 120 | { .compatible = "renesas,r8a7740-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], }, | 120 | { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], }, |
| 121 | { .compatible = "renesas,r8a7778-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], }, | 121 | { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], }, |
| 122 | { .compatible = "renesas,r8a7779-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], }, | 122 | { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], }, |
| 123 | { .compatible = "renesas,r8a7790-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], }, | 123 | { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], }, |
| 124 | {}, | 124 | {}, |
| 125 | }; | 125 | }; |
| 126 | MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match); | 126 | MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 55bbb8b8200c..e883bfe2e727 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -1724,6 +1724,7 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
| 1724 | struct bonding *bond = netdev_priv(bond_dev); | 1724 | struct bonding *bond = netdev_priv(bond_dev); |
| 1725 | struct slave *slave, *oldcurrent; | 1725 | struct slave *slave, *oldcurrent; |
| 1726 | struct sockaddr addr; | 1726 | struct sockaddr addr; |
| 1727 | int old_flags = bond_dev->flags; | ||
| 1727 | netdev_features_t old_features = bond_dev->features; | 1728 | netdev_features_t old_features = bond_dev->features; |
| 1728 | 1729 | ||
| 1729 | /* slave is not a slave or master is not master of this slave */ | 1730 | /* slave is not a slave or master is not master of this slave */ |
| @@ -1855,12 +1856,18 @@ static int __bond_release_one(struct net_device *bond_dev, | |||
| 1855 | * bond_change_active_slave(..., NULL) | 1856 | * bond_change_active_slave(..., NULL) |
| 1856 | */ | 1857 | */ |
| 1857 | if (!USES_PRIMARY(bond->params.mode)) { | 1858 | if (!USES_PRIMARY(bond->params.mode)) { |
| 1858 | /* unset promiscuity level from slave */ | 1859 | /* unset promiscuity level from slave |
| 1859 | if (bond_dev->flags & IFF_PROMISC) | 1860 | * NOTE: The NETDEV_CHANGEADDR call above may change the value |
| 1861 | * of the IFF_PROMISC flag in the bond_dev, but we need the | ||
| 1862 | * value of that flag before that change, as that was the value | ||
| 1863 | * when this slave was attached, so we cache at the start of the | ||
| 1864 | * function and use it here. Same goes for ALLMULTI below | ||
| 1865 | */ | ||
| 1866 | if (old_flags & IFF_PROMISC) | ||
| 1860 | dev_set_promiscuity(slave_dev, -1); | 1867 | dev_set_promiscuity(slave_dev, -1); |
| 1861 | 1868 | ||
| 1862 | /* unset allmulti level from slave */ | 1869 | /* unset allmulti level from slave */ |
| 1863 | if (bond_dev->flags & IFF_ALLMULTI) | 1870 | if (old_flags & IFF_ALLMULTI) |
| 1864 | dev_set_allmulti(slave_dev, -1); | 1871 | dev_set_allmulti(slave_dev, -1); |
| 1865 | 1872 | ||
| 1866 | bond_hw_addr_flush(bond_dev, slave_dev); | 1873 | bond_hw_addr_flush(bond_dev, slave_dev); |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 71c677e651d7..3f21142138b7 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
| @@ -702,7 +702,6 @@ static int flexcan_chip_start(struct net_device *dev) | |||
| 702 | { | 702 | { |
| 703 | struct flexcan_priv *priv = netdev_priv(dev); | 703 | struct flexcan_priv *priv = netdev_priv(dev); |
| 704 | struct flexcan_regs __iomem *regs = priv->base; | 704 | struct flexcan_regs __iomem *regs = priv->base; |
| 705 | unsigned int i; | ||
| 706 | int err; | 705 | int err; |
| 707 | u32 reg_mcr, reg_ctrl; | 706 | u32 reg_mcr, reg_ctrl; |
| 708 | 707 | ||
| @@ -772,17 +771,6 @@ static int flexcan_chip_start(struct net_device *dev) | |||
| 772 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); | 771 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); |
| 773 | flexcan_write(reg_ctrl, ®s->ctrl); | 772 | flexcan_write(reg_ctrl, ®s->ctrl); |
| 774 | 773 | ||
| 775 | for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) { | ||
| 776 | flexcan_write(0, ®s->cantxfg[i].can_ctrl); | ||
| 777 | flexcan_write(0, ®s->cantxfg[i].can_id); | ||
| 778 | flexcan_write(0, ®s->cantxfg[i].data[0]); | ||
| 779 | flexcan_write(0, ®s->cantxfg[i].data[1]); | ||
| 780 | |||
| 781 | /* put MB into rx queue */ | ||
| 782 | flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), | ||
| 783 | ®s->cantxfg[i].can_ctrl); | ||
| 784 | } | ||
| 785 | |||
| 786 | /* acceptance mask/acceptance code (accept everything) */ | 774 | /* acceptance mask/acceptance code (accept everything) */ |
| 787 | flexcan_write(0x0, ®s->rxgmask); | 775 | flexcan_write(0x0, ®s->rxgmask); |
| 788 | flexcan_write(0x0, ®s->rx14mask); | 776 | flexcan_write(0x0, ®s->rx14mask); |
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c index 874188ba06f7..25377e547f9b 100644 --- a/drivers/net/can/slcan.c +++ b/drivers/net/can/slcan.c | |||
| @@ -76,6 +76,10 @@ MODULE_PARM_DESC(maxdev, "Maximum number of slcan interfaces"); | |||
| 76 | /* maximum rx buffer len: extended CAN frame with timestamp */ | 76 | /* maximum rx buffer len: extended CAN frame with timestamp */ |
| 77 | #define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1) | 77 | #define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1) |
| 78 | 78 | ||
| 79 | #define SLC_CMD_LEN 1 | ||
| 80 | #define SLC_SFF_ID_LEN 3 | ||
| 81 | #define SLC_EFF_ID_LEN 8 | ||
| 82 | |||
| 79 | struct slcan { | 83 | struct slcan { |
| 80 | int magic; | 84 | int magic; |
| 81 | 85 | ||
| @@ -142,47 +146,63 @@ static void slc_bump(struct slcan *sl) | |||
| 142 | { | 146 | { |
| 143 | struct sk_buff *skb; | 147 | struct sk_buff *skb; |
| 144 | struct can_frame cf; | 148 | struct can_frame cf; |
| 145 | int i, dlc_pos, tmp; | 149 | int i, tmp; |
| 146 | unsigned long ultmp; | 150 | u32 tmpid; |
| 147 | char cmd = sl->rbuff[0]; | 151 | char *cmd = sl->rbuff; |
| 148 | 152 | ||
| 149 | if ((cmd != 't') && (cmd != 'T') && (cmd != 'r') && (cmd != 'R')) | 153 | cf.can_id = 0; |
| 154 | |||
| 155 | switch (*cmd) { | ||
| 156 | case 'r': | ||
| 157 | cf.can_id = CAN_RTR_FLAG; | ||
| 158 | /* fallthrough */ | ||
| 159 | case 't': | ||
| 160 | /* store dlc ASCII value and terminate SFF CAN ID string */ | ||
| 161 | cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN]; | ||
| 162 | sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN] = 0; | ||
| 163 | /* point to payload data behind the dlc */ | ||
| 164 | cmd += SLC_CMD_LEN + SLC_SFF_ID_LEN + 1; | ||
| 165 | break; | ||
| 166 | case 'R': | ||
| 167 | cf.can_id = CAN_RTR_FLAG; | ||
| 168 | /* fallthrough */ | ||
| 169 | case 'T': | ||
| 170 | cf.can_id |= CAN_EFF_FLAG; | ||
| 171 | /* store dlc ASCII value and terminate EFF CAN ID string */ | ||
| 172 | cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN]; | ||
| 173 | sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN] = 0; | ||
| 174 | /* point to payload data behind the dlc */ | ||
| 175 | cmd += SLC_CMD_LEN + SLC_EFF_ID_LEN + 1; | ||
| 176 | break; | ||
| 177 | default: | ||
| 150 | return; | 178 | return; |
| 179 | } | ||
| 151 | 180 | ||
| 152 | if (cmd & 0x20) /* tiny chars 'r' 't' => standard frame format */ | 181 | if (kstrtou32(sl->rbuff + SLC_CMD_LEN, 16, &tmpid)) |
| 153 | dlc_pos = 4; /* dlc position tiiid */ | ||
| 154 | else | ||
| 155 | dlc_pos = 9; /* dlc position Tiiiiiiiid */ | ||
| 156 | |||
| 157 | if (!((sl->rbuff[dlc_pos] >= '0') && (sl->rbuff[dlc_pos] < '9'))) | ||
| 158 | return; | 182 | return; |
| 159 | 183 | ||
| 160 | cf.can_dlc = sl->rbuff[dlc_pos] - '0'; /* get can_dlc from ASCII val */ | 184 | cf.can_id |= tmpid; |
| 161 | 185 | ||
| 162 | sl->rbuff[dlc_pos] = 0; /* terminate can_id string */ | 186 | /* get can_dlc from sanitized ASCII value */ |
| 163 | 187 | if (cf.can_dlc >= '0' && cf.can_dlc < '9') | |
| 164 | if (kstrtoul(sl->rbuff+1, 16, &ultmp)) | 188 | cf.can_dlc -= '0'; |
| 189 | else | ||
| 165 | return; | 190 | return; |
| 166 | 191 | ||
| 167 | cf.can_id = ultmp; | ||
| 168 | |||
| 169 | if (!(cmd & 0x20)) /* NO tiny chars => extended frame format */ | ||
| 170 | cf.can_id |= CAN_EFF_FLAG; | ||
| 171 | |||
| 172 | if ((cmd | 0x20) == 'r') /* RTR frame */ | ||
| 173 | cf.can_id |= CAN_RTR_FLAG; | ||
| 174 | |||
| 175 | *(u64 *) (&cf.data) = 0; /* clear payload */ | 192 | *(u64 *) (&cf.data) = 0; /* clear payload */ |
| 176 | 193 | ||
| 177 | for (i = 0, dlc_pos++; i < cf.can_dlc; i++) { | 194 | /* RTR frames may have a dlc > 0 but they never have any data bytes */ |
| 178 | tmp = hex_to_bin(sl->rbuff[dlc_pos++]); | 195 | if (!(cf.can_id & CAN_RTR_FLAG)) { |
| 179 | if (tmp < 0) | 196 | for (i = 0; i < cf.can_dlc; i++) { |
| 180 | return; | 197 | tmp = hex_to_bin(*cmd++); |
| 181 | cf.data[i] = (tmp << 4); | 198 | if (tmp < 0) |
| 182 | tmp = hex_to_bin(sl->rbuff[dlc_pos++]); | 199 | return; |
| 183 | if (tmp < 0) | 200 | cf.data[i] = (tmp << 4); |
| 184 | return; | 201 | tmp = hex_to_bin(*cmd++); |
| 185 | cf.data[i] |= tmp; | 202 | if (tmp < 0) |
| 203 | return; | ||
| 204 | cf.data[i] |= tmp; | ||
| 205 | } | ||
| 186 | } | 206 | } |
| 187 | 207 | ||
| 188 | skb = dev_alloc_skb(sizeof(struct can_frame) + | 208 | skb = dev_alloc_skb(sizeof(struct can_frame) + |
| @@ -209,7 +229,6 @@ static void slc_bump(struct slcan *sl) | |||
| 209 | /* parse tty input stream */ | 229 | /* parse tty input stream */ |
| 210 | static void slcan_unesc(struct slcan *sl, unsigned char s) | 230 | static void slcan_unesc(struct slcan *sl, unsigned char s) |
| 211 | { | 231 | { |
| 212 | |||
| 213 | if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */ | 232 | if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */ |
| 214 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && | 233 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
| 215 | (sl->rcount > 4)) { | 234 | (sl->rcount > 4)) { |
| @@ -236,27 +255,46 @@ static void slcan_unesc(struct slcan *sl, unsigned char s) | |||
| 236 | /* Encapsulate one can_frame and stuff into a TTY queue. */ | 255 | /* Encapsulate one can_frame and stuff into a TTY queue. */ |
| 237 | static void slc_encaps(struct slcan *sl, struct can_frame *cf) | 256 | static void slc_encaps(struct slcan *sl, struct can_frame *cf) |
| 238 | { | 257 | { |
| 239 | int actual, idx, i; | 258 | int actual, i; |
| 240 | char cmd; | 259 | unsigned char *pos; |
| 260 | unsigned char *endpos; | ||
| 261 | canid_t id = cf->can_id; | ||
| 262 | |||
| 263 | pos = sl->xbuff; | ||
| 241 | 264 | ||
| 242 | if (cf->can_id & CAN_RTR_FLAG) | 265 | if (cf->can_id & CAN_RTR_FLAG) |
| 243 | cmd = 'R'; /* becomes 'r' in standard frame format */ | 266 | *pos = 'R'; /* becomes 'r' in standard frame format (SFF) */ |
| 244 | else | 267 | else |
| 245 | cmd = 'T'; /* becomes 't' in standard frame format */ | 268 | *pos = 'T'; /* becomes 't' in standard frame format (SSF) */ |
| 246 | 269 | ||
| 247 | if (cf->can_id & CAN_EFF_FLAG) | 270 | /* determine number of chars for the CAN-identifier */ |
| 248 | sprintf(sl->xbuff, "%c%08X%d", cmd, | 271 | if (cf->can_id & CAN_EFF_FLAG) { |
| 249 | cf->can_id & CAN_EFF_MASK, cf->can_dlc); | 272 | id &= CAN_EFF_MASK; |
| 250 | else | 273 | endpos = pos + SLC_EFF_ID_LEN; |
| 251 | sprintf(sl->xbuff, "%c%03X%d", cmd | 0x20, | 274 | } else { |
| 252 | cf->can_id & CAN_SFF_MASK, cf->can_dlc); | 275 | *pos |= 0x20; /* convert R/T to lower case for SFF */ |
| 276 | id &= CAN_SFF_MASK; | ||
| 277 | endpos = pos + SLC_SFF_ID_LEN; | ||
| 278 | } | ||
| 253 | 279 | ||
| 254 | idx = strlen(sl->xbuff); | 280 | /* build 3 (SFF) or 8 (EFF) digit CAN identifier */ |
| 281 | pos++; | ||
| 282 | while (endpos >= pos) { | ||
| 283 | *endpos-- = hex_asc_upper[id & 0xf]; | ||
| 284 | id >>= 4; | ||
| 285 | } | ||
| 286 | |||
| 287 | pos += (cf->can_id & CAN_EFF_FLAG) ? SLC_EFF_ID_LEN : SLC_SFF_ID_LEN; | ||
| 255 | 288 | ||
| 256 | for (i = 0; i < cf->can_dlc; i++) | 289 | *pos++ = cf->can_dlc + '0'; |
| 257 | sprintf(&sl->xbuff[idx + 2*i], "%02X", cf->data[i]); | 290 | |
| 291 | /* RTR frames may have a dlc > 0 but they never have any data bytes */ | ||
| 292 | if (!(cf->can_id & CAN_RTR_FLAG)) { | ||
| 293 | for (i = 0; i < cf->can_dlc; i++) | ||
| 294 | pos = hex_byte_pack_upper(pos, cf->data[i]); | ||
| 295 | } | ||
| 258 | 296 | ||
| 259 | strcat(sl->xbuff, "\r"); /* add terminating character */ | 297 | *pos++ = '\r'; |
| 260 | 298 | ||
| 261 | /* Order of next two lines is *very* important. | 299 | /* Order of next two lines is *very* important. |
| 262 | * When we are sending a little amount of data, | 300 | * When we are sending a little amount of data, |
| @@ -267,8 +305,8 @@ static void slc_encaps(struct slcan *sl, struct can_frame *cf) | |||
| 267 | * 14 Oct 1994 Dmitry Gorodchanin. | 305 | * 14 Oct 1994 Dmitry Gorodchanin. |
| 268 | */ | 306 | */ |
| 269 | set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); | 307 | set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); |
| 270 | actual = sl->tty->ops->write(sl->tty, sl->xbuff, strlen(sl->xbuff)); | 308 | actual = sl->tty->ops->write(sl->tty, sl->xbuff, pos - sl->xbuff); |
| 271 | sl->xleft = strlen(sl->xbuff) - actual; | 309 | sl->xleft = (pos - sl->xbuff) - actual; |
| 272 | sl->xhead = sl->xbuff + actual; | 310 | sl->xhead = sl->xbuff + actual; |
| 273 | sl->dev->stats.tx_bytes += cf->can_dlc; | 311 | sl->dev->stats.tx_bytes += cf->can_dlc; |
| 274 | } | 312 | } |
| @@ -286,11 +324,13 @@ static void slcan_write_wakeup(struct tty_struct *tty) | |||
| 286 | if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) | 324 | if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) |
| 287 | return; | 325 | return; |
| 288 | 326 | ||
| 327 | spin_lock(&sl->lock); | ||
| 289 | if (sl->xleft <= 0) { | 328 | if (sl->xleft <= 0) { |
| 290 | /* Now serial buffer is almost free & we can start | 329 | /* Now serial buffer is almost free & we can start |
| 291 | * transmission of another packet */ | 330 | * transmission of another packet */ |
| 292 | sl->dev->stats.tx_packets++; | 331 | sl->dev->stats.tx_packets++; |
| 293 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); | 332 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
| 333 | spin_unlock(&sl->lock); | ||
| 294 | netif_wake_queue(sl->dev); | 334 | netif_wake_queue(sl->dev); |
| 295 | return; | 335 | return; |
| 296 | } | 336 | } |
| @@ -298,6 +338,7 @@ static void slcan_write_wakeup(struct tty_struct *tty) | |||
| 298 | actual = tty->ops->write(tty, sl->xhead, sl->xleft); | 338 | actual = tty->ops->write(tty, sl->xhead, sl->xleft); |
| 299 | sl->xleft -= actual; | 339 | sl->xleft -= actual; |
| 300 | sl->xhead += actual; | 340 | sl->xhead += actual; |
| 341 | spin_unlock(&sl->lock); | ||
| 301 | } | 342 | } |
| 302 | 343 | ||
| 303 | /* Send a can_frame to a TTY queue. */ | 344 | /* Send a can_frame to a TTY queue. */ |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index a0f647f92bf5..0b7a4c3b01a2 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c | |||
| @@ -463,7 +463,7 @@ static int peak_usb_start(struct peak_usb_device *dev) | |||
| 463 | if (i < PCAN_USB_MAX_TX_URBS) { | 463 | if (i < PCAN_USB_MAX_TX_URBS) { |
| 464 | if (i == 0) { | 464 | if (i == 0) { |
| 465 | netdev_err(netdev, "couldn't setup any tx URB\n"); | 465 | netdev_err(netdev, "couldn't setup any tx URB\n"); |
| 466 | return err; | 466 | goto err_tx; |
| 467 | } | 467 | } |
| 468 | 468 | ||
| 469 | netdev_warn(netdev, "tx performance may be slow\n"); | 469 | netdev_warn(netdev, "tx performance may be slow\n"); |
| @@ -472,7 +472,7 @@ static int peak_usb_start(struct peak_usb_device *dev) | |||
| 472 | if (dev->adapter->dev_start) { | 472 | if (dev->adapter->dev_start) { |
| 473 | err = dev->adapter->dev_start(dev); | 473 | err = dev->adapter->dev_start(dev); |
| 474 | if (err) | 474 | if (err) |
| 475 | goto failed; | 475 | goto err_adapter; |
| 476 | } | 476 | } |
| 477 | 477 | ||
| 478 | dev->state |= PCAN_USB_STATE_STARTED; | 478 | dev->state |= PCAN_USB_STATE_STARTED; |
| @@ -481,19 +481,26 @@ static int peak_usb_start(struct peak_usb_device *dev) | |||
| 481 | if (dev->adapter->dev_set_bus) { | 481 | if (dev->adapter->dev_set_bus) { |
| 482 | err = dev->adapter->dev_set_bus(dev, 1); | 482 | err = dev->adapter->dev_set_bus(dev, 1); |
| 483 | if (err) | 483 | if (err) |
| 484 | goto failed; | 484 | goto err_adapter; |
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | dev->can.state = CAN_STATE_ERROR_ACTIVE; | 487 | dev->can.state = CAN_STATE_ERROR_ACTIVE; |
| 488 | 488 | ||
| 489 | return 0; | 489 | return 0; |
| 490 | 490 | ||
| 491 | failed: | 491 | err_adapter: |
| 492 | if (err == -ENODEV) | 492 | if (err == -ENODEV) |
| 493 | netif_device_detach(dev->netdev); | 493 | netif_device_detach(dev->netdev); |
| 494 | 494 | ||
| 495 | netdev_warn(netdev, "couldn't submit control: %d\n", err); | 495 | netdev_warn(netdev, "couldn't submit control: %d\n", err); |
| 496 | 496 | ||
| 497 | for (i = 0; i < PCAN_USB_MAX_TX_URBS; i++) { | ||
| 498 | usb_free_urb(dev->tx_contexts[i].urb); | ||
| 499 | dev->tx_contexts[i].urb = NULL; | ||
| 500 | } | ||
| 501 | err_tx: | ||
| 502 | usb_kill_anchored_urbs(&dev->rx_submitted); | ||
| 503 | |||
| 497 | return err; | 504 | return err; |
| 498 | } | 505 | } |
| 499 | 506 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 61726af1de6e..e66beff2704d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
| @@ -2481,8 +2481,7 @@ load_error_cnic2: | |||
| 2481 | load_error_cnic1: | 2481 | load_error_cnic1: |
| 2482 | bnx2x_napi_disable_cnic(bp); | 2482 | bnx2x_napi_disable_cnic(bp); |
| 2483 | /* Update the number of queues without the cnic queues */ | 2483 | /* Update the number of queues without the cnic queues */ |
| 2484 | rc = bnx2x_set_real_num_queues(bp, 0); | 2484 | if (bnx2x_set_real_num_queues(bp, 0)) |
| 2485 | if (rc) | ||
| 2486 | BNX2X_ERR("Unable to set real_num_queues not including cnic\n"); | 2485 | BNX2X_ERR("Unable to set real_num_queues not including cnic\n"); |
| 2487 | load_error_cnic0: | 2486 | load_error_cnic0: |
| 2488 | BNX2X_ERR("CNIC-related load failed\n"); | 2487 | BNX2X_ERR("CNIC-related load failed\n"); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index d60a2ea3da19..51468227bf3b 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
| @@ -175,6 +175,7 @@ typedef int (*read_sfp_module_eeprom_func_p)(struct bnx2x_phy *phy, | |||
| 175 | #define EDC_MODE_LINEAR 0x0022 | 175 | #define EDC_MODE_LINEAR 0x0022 |
| 176 | #define EDC_MODE_LIMITING 0x0044 | 176 | #define EDC_MODE_LIMITING 0x0044 |
| 177 | #define EDC_MODE_PASSIVE_DAC 0x0055 | 177 | #define EDC_MODE_PASSIVE_DAC 0x0055 |
| 178 | #define EDC_MODE_ACTIVE_DAC 0x0066 | ||
| 178 | 179 | ||
| 179 | /* ETS defines*/ | 180 | /* ETS defines*/ |
| 180 | #define DCBX_INVALID_COS (0xFF) | 181 | #define DCBX_INVALID_COS (0xFF) |
| @@ -3684,6 +3685,41 @@ static void bnx2x_warpcore_enable_AN_KR2(struct bnx2x_phy *phy, | |||
| 3684 | bnx2x_update_link_attr(params, vars->link_attr_sync); | 3685 | bnx2x_update_link_attr(params, vars->link_attr_sync); |
| 3685 | } | 3686 | } |
| 3686 | 3687 | ||
| 3688 | static void bnx2x_disable_kr2(struct link_params *params, | ||
| 3689 | struct link_vars *vars, | ||
| 3690 | struct bnx2x_phy *phy) | ||
| 3691 | { | ||
| 3692 | struct bnx2x *bp = params->bp; | ||
| 3693 | int i; | ||
| 3694 | static struct bnx2x_reg_set reg_set[] = { | ||
| 3695 | /* Step 1 - Program the TX/RX alignment markers */ | ||
| 3696 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690}, | ||
| 3697 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647}, | ||
| 3698 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0}, | ||
| 3699 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690}, | ||
| 3700 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647}, | ||
| 3701 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0}, | ||
| 3702 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c}, | ||
| 3703 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000}, | ||
| 3704 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000}, | ||
| 3705 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002}, | ||
| 3706 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000}, | ||
| 3707 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7}, | ||
| 3708 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7}, | ||
| 3709 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002}, | ||
| 3710 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000} | ||
| 3711 | }; | ||
| 3712 | DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n"); | ||
| 3713 | |||
| 3714 | for (i = 0; i < ARRAY_SIZE(reg_set); i++) | ||
| 3715 | bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg, | ||
| 3716 | reg_set[i].val); | ||
| 3717 | vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE; | ||
| 3718 | bnx2x_update_link_attr(params, vars->link_attr_sync); | ||
| 3719 | |||
| 3720 | vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT; | ||
| 3721 | } | ||
| 3722 | |||
| 3687 | static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy, | 3723 | static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy, |
| 3688 | struct link_params *params) | 3724 | struct link_params *params) |
| 3689 | { | 3725 | { |
| @@ -3715,7 +3751,6 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, | |||
| 3715 | struct link_params *params, | 3751 | struct link_params *params, |
| 3716 | struct link_vars *vars) { | 3752 | struct link_vars *vars) { |
| 3717 | u16 lane, i, cl72_ctrl, an_adv = 0; | 3753 | u16 lane, i, cl72_ctrl, an_adv = 0; |
| 3718 | u16 ucode_ver; | ||
| 3719 | struct bnx2x *bp = params->bp; | 3754 | struct bnx2x *bp = params->bp; |
| 3720 | static struct bnx2x_reg_set reg_set[] = { | 3755 | static struct bnx2x_reg_set reg_set[] = { |
| 3721 | {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7}, | 3756 | {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7}, |
| @@ -3806,15 +3841,7 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, | |||
| 3806 | 3841 | ||
| 3807 | /* Advertise pause */ | 3842 | /* Advertise pause */ |
| 3808 | bnx2x_ext_phy_set_pause(params, phy, vars); | 3843 | bnx2x_ext_phy_set_pause(params, phy, vars); |
| 3809 | /* Set KR Autoneg Work-Around flag for Warpcore version older than D108 | 3844 | vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY; |
| 3810 | */ | ||
| 3811 | bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, | ||
| 3812 | MDIO_WC_REG_UC_INFO_B1_VERSION, &ucode_ver); | ||
| 3813 | if (ucode_ver < 0xd108) { | ||
| 3814 | DP(NETIF_MSG_LINK, "Enable AN KR work-around. WC ver:0x%x\n", | ||
| 3815 | ucode_ver); | ||
| 3816 | vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY; | ||
| 3817 | } | ||
| 3818 | bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD, | 3845 | bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD, |
| 3819 | MDIO_WC_REG_DIGITAL5_MISC7, 0x100); | 3846 | MDIO_WC_REG_DIGITAL5_MISC7, 0x100); |
| 3820 | 3847 | ||
| @@ -3838,6 +3865,8 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, | |||
| 3838 | bnx2x_set_aer_mmd(params, phy); | 3865 | bnx2x_set_aer_mmd(params, phy); |
| 3839 | 3866 | ||
| 3840 | bnx2x_warpcore_enable_AN_KR2(phy, params, vars); | 3867 | bnx2x_warpcore_enable_AN_KR2(phy, params, vars); |
| 3868 | } else { | ||
| 3869 | bnx2x_disable_kr2(params, vars, phy); | ||
| 3841 | } | 3870 | } |
| 3842 | 3871 | ||
| 3843 | /* Enable Autoneg: only on the main lane */ | 3872 | /* Enable Autoneg: only on the main lane */ |
| @@ -4347,20 +4376,14 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, | |||
| 4347 | struct bnx2x *bp = params->bp; | 4376 | struct bnx2x *bp = params->bp; |
| 4348 | u32 serdes_net_if; | 4377 | u32 serdes_net_if; |
| 4349 | u16 gp_status1 = 0, lnkup = 0, lnkup_kr = 0; | 4378 | u16 gp_status1 = 0, lnkup = 0, lnkup_kr = 0; |
| 4350 | u16 lane = bnx2x_get_warpcore_lane(phy, params); | ||
| 4351 | 4379 | ||
| 4352 | vars->turn_to_run_wc_rt = vars->turn_to_run_wc_rt ? 0 : 1; | 4380 | vars->turn_to_run_wc_rt = vars->turn_to_run_wc_rt ? 0 : 1; |
| 4353 | 4381 | ||
| 4354 | if (!vars->turn_to_run_wc_rt) | 4382 | if (!vars->turn_to_run_wc_rt) |
| 4355 | return; | 4383 | return; |
| 4356 | 4384 | ||
| 4357 | /* Return if there is no link partner */ | ||
| 4358 | if (!(bnx2x_warpcore_get_sigdet(phy, params))) { | ||
| 4359 | DP(NETIF_MSG_LINK, "bnx2x_warpcore_get_sigdet false\n"); | ||
| 4360 | return; | ||
| 4361 | } | ||
| 4362 | |||
| 4363 | if (vars->rx_tx_asic_rst) { | 4385 | if (vars->rx_tx_asic_rst) { |
| 4386 | u16 lane = bnx2x_get_warpcore_lane(phy, params); | ||
| 4364 | serdes_net_if = (REG_RD(bp, params->shmem_base + | 4387 | serdes_net_if = (REG_RD(bp, params->shmem_base + |
| 4365 | offsetof(struct shmem_region, dev_info. | 4388 | offsetof(struct shmem_region, dev_info. |
| 4366 | port_hw_config[params->port].default_cfg)) & | 4389 | port_hw_config[params->port].default_cfg)) & |
| @@ -4375,14 +4398,8 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, | |||
| 4375 | /*10G KR*/ | 4398 | /*10G KR*/ |
| 4376 | lnkup_kr = (gp_status1 >> (12+lane)) & 0x1; | 4399 | lnkup_kr = (gp_status1 >> (12+lane)) & 0x1; |
| 4377 | 4400 | ||
| 4378 | DP(NETIF_MSG_LINK, | ||
| 4379 | "gp_status1 0x%x\n", gp_status1); | ||
| 4380 | |||
| 4381 | if (lnkup_kr || lnkup) { | 4401 | if (lnkup_kr || lnkup) { |
| 4382 | vars->rx_tx_asic_rst = 0; | 4402 | vars->rx_tx_asic_rst = 0; |
| 4383 | DP(NETIF_MSG_LINK, | ||
| 4384 | "link up, rx_tx_asic_rst 0x%x\n", | ||
| 4385 | vars->rx_tx_asic_rst); | ||
| 4386 | } else { | 4403 | } else { |
| 4387 | /* Reset the lane to see if link comes up.*/ | 4404 | /* Reset the lane to see if link comes up.*/ |
| 4388 | bnx2x_warpcore_reset_lane(bp, phy, 1); | 4405 | bnx2x_warpcore_reset_lane(bp, phy, 1); |
| @@ -4507,10 +4524,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, | |||
| 4507 | * enabled transmitter to avoid current leakage in case | 4524 | * enabled transmitter to avoid current leakage in case |
| 4508 | * no module is connected | 4525 | * no module is connected |
| 4509 | */ | 4526 | */ |
| 4510 | if (bnx2x_is_sfp_module_plugged(phy, params)) | 4527 | if ((params->loopback_mode == LOOPBACK_NONE) || |
| 4511 | bnx2x_sfp_module_detection(phy, params); | 4528 | (params->loopback_mode == LOOPBACK_EXT)) { |
| 4512 | else | 4529 | if (bnx2x_is_sfp_module_plugged(phy, params)) |
| 4513 | bnx2x_sfp_e3_set_transmitter(params, phy, 1); | 4530 | bnx2x_sfp_module_detection(phy, params); |
| 4531 | else | ||
| 4532 | bnx2x_sfp_e3_set_transmitter(params, | ||
| 4533 | phy, 1); | ||
| 4534 | } | ||
| 4514 | 4535 | ||
| 4515 | bnx2x_warpcore_config_sfi(phy, params); | 4536 | bnx2x_warpcore_config_sfi(phy, params); |
| 4516 | break; | 4537 | break; |
| @@ -5757,6 +5778,11 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, | |||
| 5757 | rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed, | 5778 | rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed, |
| 5758 | duplex); | 5779 | duplex); |
| 5759 | 5780 | ||
| 5781 | /* In case of KR link down, start up the recovering procedure */ | ||
| 5782 | if ((!link_up) && (phy->media_type == ETH_PHY_KR) && | ||
| 5783 | (!(phy->flags & FLAGS_WC_DUAL_MODE))) | ||
| 5784 | vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY; | ||
| 5785 | |||
| 5760 | DP(NETIF_MSG_LINK, "duplex %x flow_ctrl 0x%x link_status 0x%x\n", | 5786 | DP(NETIF_MSG_LINK, "duplex %x flow_ctrl 0x%x link_status 0x%x\n", |
| 5761 | vars->duplex, vars->flow_ctrl, vars->link_status); | 5787 | vars->duplex, vars->flow_ctrl, vars->link_status); |
| 5762 | return rc; | 5788 | return rc; |
| @@ -6507,6 +6533,11 @@ static int bnx2x_link_initialize(struct link_params *params, | |||
| 6507 | params->phy[INT_PHY].config_init(phy, params, vars); | 6533 | params->phy[INT_PHY].config_init(phy, params, vars); |
| 6508 | } | 6534 | } |
| 6509 | 6535 | ||
| 6536 | /* Re-read this value in case it was changed inside config_init due to | ||
| 6537 | * limitations of optic module | ||
| 6538 | */ | ||
| 6539 | vars->line_speed = params->phy[INT_PHY].req_line_speed; | ||
| 6540 | |||
| 6510 | /* Init external phy*/ | 6541 | /* Init external phy*/ |
| 6511 | if (non_ext_phy) { | 6542 | if (non_ext_phy) { |
| 6512 | if (params->phy[INT_PHY].supported & | 6543 | if (params->phy[INT_PHY].supported & |
| @@ -8080,7 +8111,10 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, | |||
| 8080 | if (copper_module_type & | 8111 | if (copper_module_type & |
| 8081 | SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_ACTIVE) { | 8112 | SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_ACTIVE) { |
| 8082 | DP(NETIF_MSG_LINK, "Active Copper cable detected\n"); | 8113 | DP(NETIF_MSG_LINK, "Active Copper cable detected\n"); |
| 8083 | check_limiting_mode = 1; | 8114 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) |
| 8115 | *edc_mode = EDC_MODE_ACTIVE_DAC; | ||
| 8116 | else | ||
| 8117 | check_limiting_mode = 1; | ||
| 8084 | } else if (copper_module_type & | 8118 | } else if (copper_module_type & |
| 8085 | SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) { | 8119 | SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) { |
| 8086 | DP(NETIF_MSG_LINK, | 8120 | DP(NETIF_MSG_LINK, |
| @@ -8555,6 +8589,7 @@ static void bnx2x_warpcore_set_limiting_mode(struct link_params *params, | |||
| 8555 | mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_DEFAULT; | 8589 | mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_DEFAULT; |
| 8556 | break; | 8590 | break; |
| 8557 | case EDC_MODE_PASSIVE_DAC: | 8591 | case EDC_MODE_PASSIVE_DAC: |
| 8592 | case EDC_MODE_ACTIVE_DAC: | ||
| 8558 | mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_SFP_DAC; | 8593 | mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_SFP_DAC; |
| 8559 | break; | 8594 | break; |
| 8560 | default: | 8595 | default: |
| @@ -9730,32 +9765,41 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, | |||
| 9730 | MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL, | 9765 | MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL, |
| 9731 | an_1000_val); | 9766 | an_1000_val); |
| 9732 | 9767 | ||
| 9733 | /* set 100 speed advertisement */ | 9768 | /* Set 10/100 speed advertisement */ |
| 9734 | if ((phy->req_line_speed == SPEED_AUTO_NEG) && | 9769 | if (phy->req_line_speed == SPEED_AUTO_NEG) { |
| 9735 | (phy->speed_cap_mask & | 9770 | if (phy->speed_cap_mask & |
| 9736 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | | 9771 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) { |
| 9737 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF))) { | 9772 | /* Enable autoneg and restart autoneg for legacy speeds |
| 9738 | an_10_100_val |= (1<<7); | 9773 | */ |
| 9739 | /* Enable autoneg and restart autoneg for legacy speeds */ | 9774 | autoneg_val |= (1<<9 | 1<<12); |
| 9740 | autoneg_val |= (1<<9 | 1<<12); | ||
| 9741 | |||
| 9742 | if (phy->req_duplex == DUPLEX_FULL) | ||
| 9743 | an_10_100_val |= (1<<8); | 9775 | an_10_100_val |= (1<<8); |
| 9744 | DP(NETIF_MSG_LINK, "Advertising 100M\n"); | 9776 | DP(NETIF_MSG_LINK, "Advertising 100M-FD\n"); |
| 9745 | } | 9777 | } |
| 9746 | /* set 10 speed advertisement */ | 9778 | |
| 9747 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && | 9779 | if (phy->speed_cap_mask & |
| 9748 | (phy->speed_cap_mask & | 9780 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF) { |
| 9749 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL | | 9781 | /* Enable autoneg and restart autoneg for legacy speeds |
| 9750 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)) && | 9782 | */ |
| 9751 | (phy->supported & | 9783 | autoneg_val |= (1<<9 | 1<<12); |
| 9752 | (SUPPORTED_10baseT_Half | | 9784 | an_10_100_val |= (1<<7); |
| 9753 | SUPPORTED_10baseT_Full)))) { | 9785 | DP(NETIF_MSG_LINK, "Advertising 100M-HD\n"); |
| 9754 | an_10_100_val |= (1<<5); | 9786 | } |
| 9755 | autoneg_val |= (1<<9 | 1<<12); | 9787 | |
| 9756 | if (phy->req_duplex == DUPLEX_FULL) | 9788 | if ((phy->speed_cap_mask & |
| 9789 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) && | ||
| 9790 | (phy->supported & SUPPORTED_10baseT_Full)) { | ||
| 9757 | an_10_100_val |= (1<<6); | 9791 | an_10_100_val |= (1<<6); |
| 9758 | DP(NETIF_MSG_LINK, "Advertising 10M\n"); | 9792 | autoneg_val |= (1<<9 | 1<<12); |
| 9793 | DP(NETIF_MSG_LINK, "Advertising 10M-FD\n"); | ||
| 9794 | } | ||
| 9795 | |||
| 9796 | if ((phy->speed_cap_mask & | ||
| 9797 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) && | ||
| 9798 | (phy->supported & SUPPORTED_10baseT_Half)) { | ||
| 9799 | an_10_100_val |= (1<<5); | ||
| 9800 | autoneg_val |= (1<<9 | 1<<12); | ||
| 9801 | DP(NETIF_MSG_LINK, "Advertising 10M-HD\n"); | ||
| 9802 | } | ||
| 9759 | } | 9803 | } |
| 9760 | 9804 | ||
| 9761 | /* Only 10/100 are allowed to work in FORCE mode */ | 9805 | /* Only 10/100 are allowed to work in FORCE mode */ |
| @@ -13432,43 +13476,6 @@ static void bnx2x_sfp_tx_fault_detection(struct bnx2x_phy *phy, | |||
| 13432 | } | 13476 | } |
| 13433 | } | 13477 | } |
| 13434 | } | 13478 | } |
| 13435 | static void bnx2x_disable_kr2(struct link_params *params, | ||
| 13436 | struct link_vars *vars, | ||
| 13437 | struct bnx2x_phy *phy) | ||
| 13438 | { | ||
| 13439 | struct bnx2x *bp = params->bp; | ||
| 13440 | int i; | ||
| 13441 | static struct bnx2x_reg_set reg_set[] = { | ||
| 13442 | /* Step 1 - Program the TX/RX alignment markers */ | ||
| 13443 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690}, | ||
| 13444 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647}, | ||
| 13445 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0}, | ||
| 13446 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690}, | ||
| 13447 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647}, | ||
| 13448 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0}, | ||
| 13449 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c}, | ||
| 13450 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000}, | ||
| 13451 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000}, | ||
| 13452 | {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002}, | ||
| 13453 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000}, | ||
| 13454 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7}, | ||
| 13455 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7}, | ||
| 13456 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002}, | ||
| 13457 | {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000} | ||
| 13458 | }; | ||
| 13459 | DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n"); | ||
| 13460 | |||
| 13461 | for (i = 0; i < ARRAY_SIZE(reg_set); i++) | ||
| 13462 | bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg, | ||
| 13463 | reg_set[i].val); | ||
| 13464 | vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE; | ||
| 13465 | bnx2x_update_link_attr(params, vars->link_attr_sync); | ||
| 13466 | |||
| 13467 | vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT; | ||
| 13468 | /* Restart AN on leading lane */ | ||
| 13469 | bnx2x_warpcore_restart_AN_KR(phy, params); | ||
| 13470 | } | ||
| 13471 | |||
| 13472 | static void bnx2x_kr2_recovery(struct link_params *params, | 13479 | static void bnx2x_kr2_recovery(struct link_params *params, |
| 13473 | struct link_vars *vars, | 13480 | struct link_vars *vars, |
| 13474 | struct bnx2x_phy *phy) | 13481 | struct bnx2x_phy *phy) |
| @@ -13546,6 +13553,8 @@ static void bnx2x_check_kr2_wa(struct link_params *params, | |||
| 13546 | /* Disable KR2 on both lanes */ | 13553 | /* Disable KR2 on both lanes */ |
| 13547 | DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page, next_page); | 13554 | DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page, next_page); |
| 13548 | bnx2x_disable_kr2(params, vars, phy); | 13555 | bnx2x_disable_kr2(params, vars, phy); |
| 13556 | /* Restart AN on leading lane */ | ||
| 13557 | bnx2x_warpcore_restart_AN_KR(phy, params); | ||
| 13549 | return; | 13558 | return; |
| 13550 | } | 13559 | } |
| 13551 | } | 13560 | } |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index a6704b555042..82b658d8c04c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
| @@ -4703,6 +4703,14 @@ bool bnx2x_chk_parity_attn(struct bnx2x *bp, bool *global, bool print) | |||
| 4703 | attn.sig[3] = REG_RD(bp, | 4703 | attn.sig[3] = REG_RD(bp, |
| 4704 | MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 + | 4704 | MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 + |
| 4705 | port*4); | 4705 | port*4); |
| 4706 | /* Since MCP attentions can't be disabled inside the block, we need to | ||
| 4707 | * read AEU registers to see whether they're currently disabled | ||
| 4708 | */ | ||
| 4709 | attn.sig[3] &= ((REG_RD(bp, | ||
| 4710 | !port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0 | ||
| 4711 | : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0) & | ||
| 4712 | MISC_AEU_ENABLE_MCP_PRTY_BITS) | | ||
| 4713 | ~MISC_AEU_ENABLE_MCP_PRTY_BITS); | ||
| 4706 | 4714 | ||
| 4707 | if (!CHIP_IS_E1x(bp)) | 4715 | if (!CHIP_IS_E1x(bp)) |
| 4708 | attn.sig[4] = REG_RD(bp, | 4716 | attn.sig[4] = REG_RD(bp, |
| @@ -5447,26 +5455,24 @@ static void bnx2x_timer(unsigned long data) | |||
| 5447 | if (IS_PF(bp) && | 5455 | if (IS_PF(bp) && |
| 5448 | !BP_NOMCP(bp)) { | 5456 | !BP_NOMCP(bp)) { |
| 5449 | int mb_idx = BP_FW_MB_IDX(bp); | 5457 | int mb_idx = BP_FW_MB_IDX(bp); |
| 5450 | u32 drv_pulse; | 5458 | u16 drv_pulse; |
| 5451 | u32 mcp_pulse; | 5459 | u16 mcp_pulse; |
| 5452 | 5460 | ||
| 5453 | ++bp->fw_drv_pulse_wr_seq; | 5461 | ++bp->fw_drv_pulse_wr_seq; |
| 5454 | bp->fw_drv_pulse_wr_seq &= DRV_PULSE_SEQ_MASK; | 5462 | bp->fw_drv_pulse_wr_seq &= DRV_PULSE_SEQ_MASK; |
| 5455 | /* TBD - add SYSTEM_TIME */ | ||
| 5456 | drv_pulse = bp->fw_drv_pulse_wr_seq; | 5463 | drv_pulse = bp->fw_drv_pulse_wr_seq; |
| 5457 | bnx2x_drv_pulse(bp); | 5464 | bnx2x_drv_pulse(bp); |
| 5458 | 5465 | ||
| 5459 | mcp_pulse = (SHMEM_RD(bp, func_mb[mb_idx].mcp_pulse_mb) & | 5466 | mcp_pulse = (SHMEM_RD(bp, func_mb[mb_idx].mcp_pulse_mb) & |
| 5460 | MCP_PULSE_SEQ_MASK); | 5467 | MCP_PULSE_SEQ_MASK); |
| 5461 | /* The delta between driver pulse and mcp response | 5468 | /* The delta between driver pulse and mcp response |
| 5462 | * should be 1 (before mcp response) or 0 (after mcp response) | 5469 | * should not get too big. If the MFW is more than 5 pulses |
| 5470 | * behind, we should worry about it enough to generate an error | ||
| 5471 | * log. | ||
| 5463 | */ | 5472 | */ |
| 5464 | if ((drv_pulse != mcp_pulse) && | 5473 | if (((drv_pulse - mcp_pulse) & MCP_PULSE_SEQ_MASK) > 5) |
| 5465 | (drv_pulse != ((mcp_pulse + 1) & MCP_PULSE_SEQ_MASK))) { | 5474 | BNX2X_ERR("MFW seems hanged: drv_pulse (0x%x) != mcp_pulse (0x%x)\n", |
| 5466 | /* someone lost a heartbeat... */ | ||
| 5467 | BNX2X_ERR("drv_pulse (0x%x) != mcp_pulse (0x%x)\n", | ||
| 5468 | drv_pulse, mcp_pulse); | 5475 | drv_pulse, mcp_pulse); |
| 5469 | } | ||
| 5470 | } | 5476 | } |
| 5471 | 5477 | ||
| 5472 | if (bp->state == BNX2X_STATE_OPEN) | 5478 | if (bp->state == BNX2X_STATE_OPEN) |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 2604b6204abe..9ad012bdd915 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
| @@ -1819,7 +1819,7 @@ bnx2x_get_vf_igu_cam_info(struct bnx2x *bp) | |||
| 1819 | fid = GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID); | 1819 | fid = GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID); |
| 1820 | if (fid & IGU_FID_ENCODE_IS_PF) | 1820 | if (fid & IGU_FID_ENCODE_IS_PF) |
| 1821 | current_pf = fid & IGU_FID_PF_NUM_MASK; | 1821 | current_pf = fid & IGU_FID_PF_NUM_MASK; |
| 1822 | else if (current_pf == BP_ABS_FUNC(bp)) | 1822 | else if (current_pf == BP_FUNC(bp)) |
| 1823 | bnx2x_vf_set_igu_info(bp, sb_id, | 1823 | bnx2x_vf_set_igu_info(bp, sb_id, |
| 1824 | (fid & IGU_FID_VF_NUM_MASK)); | 1824 | (fid & IGU_FID_VF_NUM_MASK)); |
| 1825 | DP(BNX2X_MSG_IOV, "%s[%d], igu_sb_id=%d, msix=%d\n", | 1825 | DP(BNX2X_MSG_IOV, "%s[%d], igu_sb_id=%d, msix=%d\n", |
| @@ -3180,6 +3180,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp) | |||
| 3180 | /* set local queue arrays */ | 3180 | /* set local queue arrays */ |
| 3181 | vf->vfqs = &bp->vfdb->vfqs[qcount]; | 3181 | vf->vfqs = &bp->vfdb->vfqs[qcount]; |
| 3182 | qcount += vf_sb_count(vf); | 3182 | qcount += vf_sb_count(vf); |
| 3183 | bnx2x_iov_static_resc(bp, vf); | ||
| 3183 | } | 3184 | } |
| 3184 | 3185 | ||
| 3185 | /* prepare msix vectors in VF configuration space */ | 3186 | /* prepare msix vectors in VF configuration space */ |
| @@ -3187,6 +3188,8 @@ int bnx2x_enable_sriov(struct bnx2x *bp) | |||
| 3187 | bnx2x_pretend_func(bp, HW_VF_HANDLE(bp, vf_idx)); | 3188 | bnx2x_pretend_func(bp, HW_VF_HANDLE(bp, vf_idx)); |
| 3188 | REG_WR(bp, PCICFG_OFFSET + GRC_CONFIG_REG_VF_MSIX_CONTROL, | 3189 | REG_WR(bp, PCICFG_OFFSET + GRC_CONFIG_REG_VF_MSIX_CONTROL, |
| 3189 | num_vf_queues); | 3190 | num_vf_queues); |
| 3191 | DP(BNX2X_MSG_IOV, "set msix vec num in VF %d cfg space to %d\n", | ||
| 3192 | vf_idx, num_vf_queues); | ||
| 3190 | } | 3193 | } |
| 3191 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | 3194 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); |
| 3192 | 3195 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c index 6cfb88732452..da16953eb2ec 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | |||
| @@ -1765,28 +1765,28 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, | |||
| 1765 | switch (mbx->first_tlv.tl.type) { | 1765 | switch (mbx->first_tlv.tl.type) { |
| 1766 | case CHANNEL_TLV_ACQUIRE: | 1766 | case CHANNEL_TLV_ACQUIRE: |
| 1767 | bnx2x_vf_mbx_acquire(bp, vf, mbx); | 1767 | bnx2x_vf_mbx_acquire(bp, vf, mbx); |
| 1768 | break; | 1768 | return; |
| 1769 | case CHANNEL_TLV_INIT: | 1769 | case CHANNEL_TLV_INIT: |
| 1770 | bnx2x_vf_mbx_init_vf(bp, vf, mbx); | 1770 | bnx2x_vf_mbx_init_vf(bp, vf, mbx); |
| 1771 | break; | 1771 | return; |
| 1772 | case CHANNEL_TLV_SETUP_Q: | 1772 | case CHANNEL_TLV_SETUP_Q: |
| 1773 | bnx2x_vf_mbx_setup_q(bp, vf, mbx); | 1773 | bnx2x_vf_mbx_setup_q(bp, vf, mbx); |
| 1774 | break; | 1774 | return; |
| 1775 | case CHANNEL_TLV_SET_Q_FILTERS: | 1775 | case CHANNEL_TLV_SET_Q_FILTERS: |
| 1776 | bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); | 1776 | bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); |
| 1777 | break; | 1777 | return; |
| 1778 | case CHANNEL_TLV_TEARDOWN_Q: | 1778 | case CHANNEL_TLV_TEARDOWN_Q: |
| 1779 | bnx2x_vf_mbx_teardown_q(bp, vf, mbx); | 1779 | bnx2x_vf_mbx_teardown_q(bp, vf, mbx); |
| 1780 | break; | 1780 | return; |
| 1781 | case CHANNEL_TLV_CLOSE: | 1781 | case CHANNEL_TLV_CLOSE: |
| 1782 | bnx2x_vf_mbx_close_vf(bp, vf, mbx); | 1782 | bnx2x_vf_mbx_close_vf(bp, vf, mbx); |
| 1783 | break; | 1783 | return; |
| 1784 | case CHANNEL_TLV_RELEASE: | 1784 | case CHANNEL_TLV_RELEASE: |
| 1785 | bnx2x_vf_mbx_release_vf(bp, vf, mbx); | 1785 | bnx2x_vf_mbx_release_vf(bp, vf, mbx); |
| 1786 | break; | 1786 | return; |
| 1787 | case CHANNEL_TLV_UPDATE_RSS: | 1787 | case CHANNEL_TLV_UPDATE_RSS: |
| 1788 | bnx2x_vf_mbx_update_rss(bp, vf, mbx); | 1788 | bnx2x_vf_mbx_update_rss(bp, vf, mbx); |
| 1789 | break; | 1789 | return; |
| 1790 | } | 1790 | } |
| 1791 | 1791 | ||
| 1792 | } else { | 1792 | } else { |
| @@ -1802,26 +1802,24 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, | |||
| 1802 | for (i = 0; i < 20; i++) | 1802 | for (i = 0; i < 20; i++) |
| 1803 | DP_CONT(BNX2X_MSG_IOV, "%x ", | 1803 | DP_CONT(BNX2X_MSG_IOV, "%x ", |
| 1804 | mbx->msg->req.tlv_buf_size.tlv_buffer[i]); | 1804 | mbx->msg->req.tlv_buf_size.tlv_buffer[i]); |
| 1805 | } | ||
| 1805 | 1806 | ||
| 1806 | /* test whether we can respond to the VF (do we have an address | 1807 | /* can we respond to VF (do we have an address for it?) */ |
| 1807 | * for it?) | 1808 | if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { |
| 1808 | */ | 1809 | /* mbx_resp uses the op_rc of the VF */ |
| 1809 | if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { | 1810 | vf->op_rc = PFVF_STATUS_NOT_SUPPORTED; |
| 1810 | /* mbx_resp uses the op_rc of the VF */ | ||
| 1811 | vf->op_rc = PFVF_STATUS_NOT_SUPPORTED; | ||
| 1812 | 1811 | ||
| 1813 | /* notify the VF that we do not support this request */ | 1812 | /* notify the VF that we do not support this request */ |
| 1814 | bnx2x_vf_mbx_resp(bp, vf); | 1813 | bnx2x_vf_mbx_resp(bp, vf); |
| 1815 | } else { | 1814 | } else { |
| 1816 | /* can't send a response since this VF is unknown to us | 1815 | /* can't send a response since this VF is unknown to us |
| 1817 | * just ack the FW to release the mailbox and unlock | 1816 | * just ack the FW to release the mailbox and unlock |
| 1818 | * the channel. | 1817 | * the channel. |
| 1819 | */ | 1818 | */ |
| 1820 | storm_memset_vf_mbx_ack(bp, vf->abs_vfid); | 1819 | storm_memset_vf_mbx_ack(bp, vf->abs_vfid); |
| 1821 | mmiowb(); | 1820 | /* Firmware ack should be written before unlocking channel */ |
| 1822 | bnx2x_unlock_vf_pf_channel(bp, vf, | 1821 | mmiowb(); |
| 1823 | mbx->first_tlv.tl.type); | 1822 | bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); |
| 1824 | } | ||
| 1825 | } | 1823 | } |
| 1826 | } | 1824 | } |
| 1827 | 1825 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index ace5050dba38..db020230bd0b 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
| @@ -88,6 +88,7 @@ static inline char *nic_name(struct pci_dev *pdev) | |||
| 88 | #define BE_MIN_MTU 256 | 88 | #define BE_MIN_MTU 256 |
| 89 | 89 | ||
| 90 | #define BE_NUM_VLANS_SUPPORTED 64 | 90 | #define BE_NUM_VLANS_SUPPORTED 64 |
| 91 | #define BE_UMC_NUM_VLANS_SUPPORTED 15 | ||
| 91 | #define BE_MAX_EQD 96u | 92 | #define BE_MAX_EQD 96u |
| 92 | #define BE_MAX_TX_FRAG_COUNT 30 | 93 | #define BE_MAX_TX_FRAG_COUNT 30 |
| 93 | 94 | ||
| @@ -333,6 +334,7 @@ enum vf_state { | |||
| 333 | 334 | ||
| 334 | #define BE_FLAGS_LINK_STATUS_INIT 1 | 335 | #define BE_FLAGS_LINK_STATUS_INIT 1 |
| 335 | #define BE_FLAGS_WORKER_SCHEDULED (1 << 3) | 336 | #define BE_FLAGS_WORKER_SCHEDULED (1 << 3) |
| 337 | #define BE_FLAGS_VLAN_PROMISC (1 << 4) | ||
| 336 | #define BE_FLAGS_NAPI_ENABLED (1 << 9) | 338 | #define BE_FLAGS_NAPI_ENABLED (1 << 9) |
| 337 | #define BE_UC_PMAC_COUNT 30 | 339 | #define BE_UC_PMAC_COUNT 30 |
| 338 | #define BE_VF_UC_PMAC_COUNT 2 | 340 | #define BE_VF_UC_PMAC_COUNT 2 |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 1ab5dab11eff..bd0e0c0bbcd8 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
| @@ -180,6 +180,9 @@ static int be_mcc_compl_process(struct be_adapter *adapter, | |||
| 180 | dev_err(&adapter->pdev->dev, | 180 | dev_err(&adapter->pdev->dev, |
| 181 | "opcode %d-%d failed:status %d-%d\n", | 181 | "opcode %d-%d failed:status %d-%d\n", |
| 182 | opcode, subsystem, compl_status, extd_status); | 182 | opcode, subsystem, compl_status, extd_status); |
| 183 | |||
| 184 | if (extd_status == MCC_ADDL_STS_INSUFFICIENT_RESOURCES) | ||
| 185 | return extd_status; | ||
| 183 | } | 186 | } |
| 184 | } | 187 | } |
| 185 | done: | 188 | done: |
| @@ -1812,6 +1815,12 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value) | |||
| 1812 | } else if (flags & IFF_ALLMULTI) { | 1815 | } else if (flags & IFF_ALLMULTI) { |
| 1813 | req->if_flags_mask = req->if_flags = | 1816 | req->if_flags_mask = req->if_flags = |
| 1814 | cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS); | 1817 | cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS); |
| 1818 | } else if (flags & BE_FLAGS_VLAN_PROMISC) { | ||
| 1819 | req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_VLAN_PROMISCUOUS); | ||
| 1820 | |||
| 1821 | if (value == ON) | ||
| 1822 | req->if_flags = | ||
| 1823 | cpu_to_le32(BE_IF_FLAGS_VLAN_PROMISCUOUS); | ||
| 1815 | } else { | 1824 | } else { |
| 1816 | struct netdev_hw_addr *ha; | 1825 | struct netdev_hw_addr *ha; |
| 1817 | int i = 0; | 1826 | int i = 0; |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h index d026226db88c..108ca8abf0af 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.h +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h | |||
| @@ -60,6 +60,8 @@ enum { | |||
| 60 | MCC_STATUS_NOT_SUPPORTED = 66 | 60 | MCC_STATUS_NOT_SUPPORTED = 66 |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | #define MCC_ADDL_STS_INSUFFICIENT_RESOURCES 0x16 | ||
| 64 | |||
| 63 | #define CQE_STATUS_COMPL_MASK 0xFFFF | 65 | #define CQE_STATUS_COMPL_MASK 0xFFFF |
| 64 | #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ | 66 | #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ |
| 65 | #define CQE_STATUS_EXTD_MASK 0xFFFF | 67 | #define CQE_STATUS_EXTD_MASK 0xFFFF |
| @@ -1791,7 +1793,7 @@ struct be_nic_res_desc { | |||
| 1791 | u8 acpi_params; | 1793 | u8 acpi_params; |
| 1792 | u8 wol_param; | 1794 | u8 wol_param; |
| 1793 | u16 rsvd7; | 1795 | u16 rsvd7; |
| 1794 | u32 rsvd8[3]; | 1796 | u32 rsvd8[7]; |
| 1795 | } __packed; | 1797 | } __packed; |
| 1796 | 1798 | ||
| 1797 | struct be_cmd_req_get_func_config { | 1799 | struct be_cmd_req_get_func_config { |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 100b528b9bd0..2c38cc402119 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
| @@ -855,11 +855,11 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter, | |||
| 855 | unsigned int eth_hdr_len; | 855 | unsigned int eth_hdr_len; |
| 856 | struct iphdr *ip; | 856 | struct iphdr *ip; |
| 857 | 857 | ||
| 858 | /* Lancer ASIC has a bug wherein packets that are 32 bytes or less | 858 | /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or less |
| 859 | * may cause a transmit stall on that port. So the work-around is to | 859 | * may cause a transmit stall on that port. So the work-around is to |
| 860 | * pad such packets to a 36-byte length. | 860 | * pad short packets (<= 32 bytes) to a 36-byte length. |
| 861 | */ | 861 | */ |
| 862 | if (unlikely(lancer_chip(adapter) && skb->len <= 32)) { | 862 | if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) { |
| 863 | if (skb_padto(skb, 36)) | 863 | if (skb_padto(skb, 36)) |
| 864 | goto tx_drop; | 864 | goto tx_drop; |
| 865 | skb->len = 36; | 865 | skb->len = 36; |
| @@ -1013,18 +1013,40 @@ static int be_vid_config(struct be_adapter *adapter) | |||
| 1013 | status = be_cmd_vlan_config(adapter, adapter->if_handle, | 1013 | status = be_cmd_vlan_config(adapter, adapter->if_handle, |
| 1014 | vids, num, 1, 0); | 1014 | vids, num, 1, 0); |
| 1015 | 1015 | ||
| 1016 | /* Set to VLAN promisc mode as setting VLAN filter failed */ | ||
| 1017 | if (status) { | 1016 | if (status) { |
| 1018 | dev_info(&adapter->pdev->dev, "Exhausted VLAN HW filters.\n"); | 1017 | /* Set to VLAN promisc mode as setting VLAN filter failed */ |
| 1019 | dev_info(&adapter->pdev->dev, "Disabling HW VLAN filtering.\n"); | 1018 | if (status == MCC_ADDL_STS_INSUFFICIENT_RESOURCES) |
| 1020 | goto set_vlan_promisc; | 1019 | goto set_vlan_promisc; |
| 1020 | dev_err(&adapter->pdev->dev, | ||
| 1021 | "Setting HW VLAN filtering failed.\n"); | ||
| 1022 | } else { | ||
| 1023 | if (adapter->flags & BE_FLAGS_VLAN_PROMISC) { | ||
| 1024 | /* hw VLAN filtering re-enabled. */ | ||
| 1025 | status = be_cmd_rx_filter(adapter, | ||
| 1026 | BE_FLAGS_VLAN_PROMISC, OFF); | ||
| 1027 | if (!status) { | ||
| 1028 | dev_info(&adapter->pdev->dev, | ||
| 1029 | "Disabling VLAN Promiscuous mode.\n"); | ||
| 1030 | adapter->flags &= ~BE_FLAGS_VLAN_PROMISC; | ||
| 1031 | dev_info(&adapter->pdev->dev, | ||
| 1032 | "Re-Enabling HW VLAN filtering\n"); | ||
| 1033 | } | ||
| 1034 | } | ||
| 1021 | } | 1035 | } |
| 1022 | 1036 | ||
| 1023 | return status; | 1037 | return status; |
| 1024 | 1038 | ||
| 1025 | set_vlan_promisc: | 1039 | set_vlan_promisc: |
| 1026 | status = be_cmd_vlan_config(adapter, adapter->if_handle, | 1040 | dev_warn(&adapter->pdev->dev, "Exhausted VLAN HW filters.\n"); |
| 1027 | NULL, 0, 1, 1); | 1041 | |
| 1042 | status = be_cmd_rx_filter(adapter, BE_FLAGS_VLAN_PROMISC, ON); | ||
| 1043 | if (!status) { | ||
| 1044 | dev_info(&adapter->pdev->dev, "Enable VLAN Promiscuous mode\n"); | ||
| 1045 | dev_info(&adapter->pdev->dev, "Disabling HW VLAN filtering\n"); | ||
| 1046 | adapter->flags |= BE_FLAGS_VLAN_PROMISC; | ||
| 1047 | } else | ||
| 1048 | dev_err(&adapter->pdev->dev, | ||
| 1049 | "Failed to enable VLAN Promiscuous mode.\n"); | ||
| 1028 | return status; | 1050 | return status; |
| 1029 | } | 1051 | } |
| 1030 | 1052 | ||
| @@ -1033,10 +1055,6 @@ static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid) | |||
| 1033 | struct be_adapter *adapter = netdev_priv(netdev); | 1055 | struct be_adapter *adapter = netdev_priv(netdev); |
| 1034 | int status = 0; | 1056 | int status = 0; |
| 1035 | 1057 | ||
| 1036 | if (!lancer_chip(adapter) && !be_physfn(adapter)) { | ||
| 1037 | status = -EINVAL; | ||
| 1038 | goto ret; | ||
| 1039 | } | ||
| 1040 | 1058 | ||
| 1041 | /* Packets with VID 0 are always received by Lancer by default */ | 1059 | /* Packets with VID 0 are always received by Lancer by default */ |
| 1042 | if (lancer_chip(adapter) && vid == 0) | 1060 | if (lancer_chip(adapter) && vid == 0) |
| @@ -1059,11 +1077,6 @@ static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid) | |||
| 1059 | struct be_adapter *adapter = netdev_priv(netdev); | 1077 | struct be_adapter *adapter = netdev_priv(netdev); |
| 1060 | int status = 0; | 1078 | int status = 0; |
| 1061 | 1079 | ||
| 1062 | if (!lancer_chip(adapter) && !be_physfn(adapter)) { | ||
| 1063 | status = -EINVAL; | ||
| 1064 | goto ret; | ||
| 1065 | } | ||
| 1066 | |||
| 1067 | /* Packets with VID 0 are always received by Lancer by default */ | 1080 | /* Packets with VID 0 are always received by Lancer by default */ |
| 1068 | if (lancer_chip(adapter) && vid == 0) | 1081 | if (lancer_chip(adapter) && vid == 0) |
| 1069 | goto ret; | 1082 | goto ret; |
| @@ -1188,8 +1201,8 @@ static int be_get_vf_config(struct net_device *netdev, int vf, | |||
| 1188 | 1201 | ||
| 1189 | vi->vf = vf; | 1202 | vi->vf = vf; |
| 1190 | vi->tx_rate = vf_cfg->tx_rate; | 1203 | vi->tx_rate = vf_cfg->tx_rate; |
| 1191 | vi->vlan = vf_cfg->vlan_tag; | 1204 | vi->vlan = vf_cfg->vlan_tag & VLAN_VID_MASK; |
| 1192 | vi->qos = 0; | 1205 | vi->qos = vf_cfg->vlan_tag >> VLAN_PRIO_SHIFT; |
| 1193 | memcpy(&vi->mac, vf_cfg->mac_addr, ETH_ALEN); | 1206 | memcpy(&vi->mac, vf_cfg->mac_addr, ETH_ALEN); |
| 1194 | 1207 | ||
| 1195 | return 0; | 1208 | return 0; |
| @@ -1199,28 +1212,29 @@ static int be_set_vf_vlan(struct net_device *netdev, | |||
| 1199 | int vf, u16 vlan, u8 qos) | 1212 | int vf, u16 vlan, u8 qos) |
| 1200 | { | 1213 | { |
| 1201 | struct be_adapter *adapter = netdev_priv(netdev); | 1214 | struct be_adapter *adapter = netdev_priv(netdev); |
| 1215 | struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf]; | ||
| 1202 | int status = 0; | 1216 | int status = 0; |
| 1203 | 1217 | ||
| 1204 | if (!sriov_enabled(adapter)) | 1218 | if (!sriov_enabled(adapter)) |
| 1205 | return -EPERM; | 1219 | return -EPERM; |
| 1206 | 1220 | ||
| 1207 | if (vf >= adapter->num_vfs || vlan > 4095) | 1221 | if (vf >= adapter->num_vfs || vlan > 4095 || qos > 7) |
| 1208 | return -EINVAL; | 1222 | return -EINVAL; |
| 1209 | 1223 | ||
| 1210 | if (vlan) { | 1224 | if (vlan || qos) { |
| 1211 | if (adapter->vf_cfg[vf].vlan_tag != vlan) { | 1225 | vlan |= qos << VLAN_PRIO_SHIFT; |
| 1226 | if (vf_cfg->vlan_tag != vlan) { | ||
| 1212 | /* If this is new value, program it. Else skip. */ | 1227 | /* If this is new value, program it. Else skip. */ |
| 1213 | adapter->vf_cfg[vf].vlan_tag = vlan; | 1228 | vf_cfg->vlan_tag = vlan; |
| 1214 | 1229 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, | |
| 1215 | status = be_cmd_set_hsw_config(adapter, vlan, | 1230 | vf_cfg->if_handle, 0); |
| 1216 | vf + 1, adapter->vf_cfg[vf].if_handle, 0); | ||
| 1217 | } | 1231 | } |
| 1218 | } else { | 1232 | } else { |
| 1219 | /* Reset Transparent Vlan Tagging. */ | 1233 | /* Reset Transparent Vlan Tagging. */ |
| 1220 | adapter->vf_cfg[vf].vlan_tag = 0; | 1234 | vf_cfg->vlan_tag = 0; |
| 1221 | vlan = adapter->vf_cfg[vf].def_vid; | 1235 | vlan = vf_cfg->def_vid; |
| 1222 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, | 1236 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, |
| 1223 | adapter->vf_cfg[vf].if_handle, 0); | 1237 | vf_cfg->if_handle, 0); |
| 1224 | } | 1238 | } |
| 1225 | 1239 | ||
| 1226 | 1240 | ||
| @@ -2963,6 +2977,8 @@ static void BEx_get_resources(struct be_adapter *adapter, | |||
| 2963 | 2977 | ||
| 2964 | if (adapter->function_mode & FLEX10_MODE) | 2978 | if (adapter->function_mode & FLEX10_MODE) |
| 2965 | res->max_vlans = BE_NUM_VLANS_SUPPORTED/8; | 2979 | res->max_vlans = BE_NUM_VLANS_SUPPORTED/8; |
| 2980 | else if (adapter->function_mode & UMC_ENABLED) | ||
| 2981 | res->max_vlans = BE_UMC_NUM_VLANS_SUPPORTED; | ||
| 2966 | else | 2982 | else |
| 2967 | res->max_vlans = BE_NUM_VLANS_SUPPORTED; | 2983 | res->max_vlans = BE_NUM_VLANS_SUPPORTED; |
| 2968 | res->max_mcast_mac = BE_MAX_MC; | 2984 | res->max_mcast_mac = BE_MAX_MC; |
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c index 098f133908ae..e006a09ba899 100644 --- a/drivers/net/ethernet/freescale/gianfar_ptp.c +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c | |||
| @@ -452,7 +452,9 @@ static int gianfar_ptp_probe(struct platform_device *dev) | |||
| 452 | err = -ENODEV; | 452 | err = -ENODEV; |
| 453 | 453 | ||
| 454 | etsects->caps = ptp_gianfar_caps; | 454 | etsects->caps = ptp_gianfar_caps; |
| 455 | etsects->cksel = DEFAULT_CKSEL; | 455 | |
| 456 | if (get_of_u32(node, "fsl,cksel", &etsects->cksel)) | ||
| 457 | etsects->cksel = DEFAULT_CKSEL; | ||
| 456 | 458 | ||
| 457 | if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) || | 459 | if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) || |
| 458 | get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) || | 460 | get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) || |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c index 0c524fa9f811..cfef7fc32cdd 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c | |||
| @@ -701,8 +701,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, | |||
| 701 | 701 | ||
| 702 | details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use); | 702 | details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use); |
| 703 | if (cmd_details) { | 703 | if (cmd_details) { |
| 704 | memcpy(details, cmd_details, | 704 | *details = *cmd_details; |
| 705 | sizeof(struct i40e_asq_cmd_details)); | ||
| 706 | 705 | ||
| 707 | /* If the cmd_details are defined copy the cookie. The | 706 | /* If the cmd_details are defined copy the cookie. The |
| 708 | * cpu_to_le32 is not needed here because the data is ignored | 707 | * cpu_to_le32 is not needed here because the data is ignored |
| @@ -760,7 +759,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, | |||
| 760 | desc_on_ring = I40E_ADMINQ_DESC(hw->aq.asq, hw->aq.asq.next_to_use); | 759 | desc_on_ring = I40E_ADMINQ_DESC(hw->aq.asq, hw->aq.asq.next_to_use); |
| 761 | 760 | ||
| 762 | /* if the desc is available copy the temp desc to the right place */ | 761 | /* if the desc is available copy the temp desc to the right place */ |
| 763 | memcpy(desc_on_ring, desc, sizeof(struct i40e_aq_desc)); | 762 | *desc_on_ring = *desc; |
| 764 | 763 | ||
| 765 | /* if buff is not NULL assume indirect command */ | 764 | /* if buff is not NULL assume indirect command */ |
| 766 | if (buff != NULL) { | 765 | if (buff != NULL) { |
| @@ -807,7 +806,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, | |||
| 807 | 806 | ||
| 808 | /* if ready, copy the desc back to temp */ | 807 | /* if ready, copy the desc back to temp */ |
| 809 | if (i40e_asq_done(hw)) { | 808 | if (i40e_asq_done(hw)) { |
| 810 | memcpy(desc, desc_on_ring, sizeof(struct i40e_aq_desc)); | 809 | *desc = *desc_on_ring; |
| 811 | if (buff != NULL) | 810 | if (buff != NULL) |
| 812 | memcpy(buff, dma_buff->va, buff_size); | 811 | memcpy(buff, dma_buff->va, buff_size); |
| 813 | retval = le16_to_cpu(desc->retval); | 812 | retval = le16_to_cpu(desc->retval); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index c21df7bc3b1d..1e4ea134975a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
| @@ -507,7 +507,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, | |||
| 507 | 507 | ||
| 508 | /* save link status information */ | 508 | /* save link status information */ |
| 509 | if (link) | 509 | if (link) |
| 510 | memcpy(link, hw_link_info, sizeof(struct i40e_link_status)); | 510 | *link = *hw_link_info; |
| 511 | 511 | ||
| 512 | /* flag cleared so helper functions don't call AQ again */ | 512 | /* flag cleared so helper functions don't call AQ again */ |
| 513 | hw->phy.get_link_info = false; | 513 | hw->phy.get_link_info = false; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 601d482694ea..221aa4795017 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
| @@ -101,10 +101,10 @@ int i40e_allocate_dma_mem_d(struct i40e_hw *hw, struct i40e_dma_mem *mem, | |||
| 101 | mem->size = ALIGN(size, alignment); | 101 | mem->size = ALIGN(size, alignment); |
| 102 | mem->va = dma_zalloc_coherent(&pf->pdev->dev, mem->size, | 102 | mem->va = dma_zalloc_coherent(&pf->pdev->dev, mem->size, |
| 103 | &mem->pa, GFP_KERNEL); | 103 | &mem->pa, GFP_KERNEL); |
| 104 | if (mem->va) | 104 | if (!mem->va) |
| 105 | return 0; | 105 | return -ENOMEM; |
| 106 | 106 | ||
| 107 | return -ENOMEM; | 107 | return 0; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /** | 110 | /** |
| @@ -136,10 +136,10 @@ int i40e_allocate_virt_mem_d(struct i40e_hw *hw, struct i40e_virt_mem *mem, | |||
| 136 | mem->size = size; | 136 | mem->size = size; |
| 137 | mem->va = kzalloc(size, GFP_KERNEL); | 137 | mem->va = kzalloc(size, GFP_KERNEL); |
| 138 | 138 | ||
| 139 | if (mem->va) | 139 | if (!mem->va) |
| 140 | return 0; | 140 | return -ENOMEM; |
| 141 | 141 | ||
| 142 | return -ENOMEM; | 142 | return 0; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | /** | 145 | /** |
| @@ -174,8 +174,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, | |||
| 174 | u16 needed, u16 id) | 174 | u16 needed, u16 id) |
| 175 | { | 175 | { |
| 176 | int ret = -ENOMEM; | 176 | int ret = -ENOMEM; |
| 177 | int i = 0; | 177 | int i, j; |
| 178 | int j = 0; | ||
| 179 | 178 | ||
| 180 | if (!pile || needed == 0 || id >= I40E_PILE_VALID_BIT) { | 179 | if (!pile || needed == 0 || id >= I40E_PILE_VALID_BIT) { |
| 181 | dev_info(&pf->pdev->dev, | 180 | dev_info(&pf->pdev->dev, |
| @@ -186,7 +185,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, | |||
| 186 | 185 | ||
| 187 | /* start the linear search with an imperfect hint */ | 186 | /* start the linear search with an imperfect hint */ |
| 188 | i = pile->search_hint; | 187 | i = pile->search_hint; |
| 189 | while (i < pile->num_entries && ret < 0) { | 188 | while (i < pile->num_entries) { |
| 190 | /* skip already allocated entries */ | 189 | /* skip already allocated entries */ |
| 191 | if (pile->list[i] & I40E_PILE_VALID_BIT) { | 190 | if (pile->list[i] & I40E_PILE_VALID_BIT) { |
| 192 | i++; | 191 | i++; |
| @@ -205,6 +204,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, | |||
| 205 | pile->list[i+j] = id | I40E_PILE_VALID_BIT; | 204 | pile->list[i+j] = id | I40E_PILE_VALID_BIT; |
| 206 | ret = i; | 205 | ret = i; |
| 207 | pile->search_hint = i + j; | 206 | pile->search_hint = i + j; |
| 207 | break; | ||
| 208 | } else { | 208 | } else { |
| 209 | /* not enough, so skip over it and continue looking */ | 209 | /* not enough, so skip over it and continue looking */ |
| 210 | i += j; | 210 | i += j; |
| @@ -1388,7 +1388,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) | |||
| 1388 | bool add_happened = false; | 1388 | bool add_happened = false; |
| 1389 | int filter_list_len = 0; | 1389 | int filter_list_len = 0; |
| 1390 | u32 changed_flags = 0; | 1390 | u32 changed_flags = 0; |
| 1391 | i40e_status ret = 0; | 1391 | i40e_status aq_ret = 0; |
| 1392 | struct i40e_pf *pf; | 1392 | struct i40e_pf *pf; |
| 1393 | int num_add = 0; | 1393 | int num_add = 0; |
| 1394 | int num_del = 0; | 1394 | int num_del = 0; |
| @@ -1449,28 +1449,28 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) | |||
| 1449 | 1449 | ||
| 1450 | /* flush a full buffer */ | 1450 | /* flush a full buffer */ |
| 1451 | if (num_del == filter_list_len) { | 1451 | if (num_del == filter_list_len) { |
| 1452 | ret = i40e_aq_remove_macvlan(&pf->hw, | 1452 | aq_ret = i40e_aq_remove_macvlan(&pf->hw, |
| 1453 | vsi->seid, del_list, num_del, | 1453 | vsi->seid, del_list, num_del, |
| 1454 | NULL); | 1454 | NULL); |
| 1455 | num_del = 0; | 1455 | num_del = 0; |
| 1456 | memset(del_list, 0, sizeof(*del_list)); | 1456 | memset(del_list, 0, sizeof(*del_list)); |
| 1457 | 1457 | ||
| 1458 | if (ret) | 1458 | if (aq_ret) |
| 1459 | dev_info(&pf->pdev->dev, | 1459 | dev_info(&pf->pdev->dev, |
| 1460 | "ignoring delete macvlan error, err %d, aq_err %d while flushing a full buffer\n", | 1460 | "ignoring delete macvlan error, err %d, aq_err %d while flushing a full buffer\n", |
| 1461 | ret, | 1461 | aq_ret, |
| 1462 | pf->hw.aq.asq_last_status); | 1462 | pf->hw.aq.asq_last_status); |
| 1463 | } | 1463 | } |
| 1464 | } | 1464 | } |
| 1465 | if (num_del) { | 1465 | if (num_del) { |
| 1466 | ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid, | 1466 | aq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid, |
| 1467 | del_list, num_del, NULL); | 1467 | del_list, num_del, NULL); |
| 1468 | num_del = 0; | 1468 | num_del = 0; |
| 1469 | 1469 | ||
| 1470 | if (ret) | 1470 | if (aq_ret) |
| 1471 | dev_info(&pf->pdev->dev, | 1471 | dev_info(&pf->pdev->dev, |
| 1472 | "ignoring delete macvlan error, err %d, aq_err %d\n", | 1472 | "ignoring delete macvlan error, err %d, aq_err %d\n", |
| 1473 | ret, pf->hw.aq.asq_last_status); | 1473 | aq_ret, pf->hw.aq.asq_last_status); |
| 1474 | } | 1474 | } |
| 1475 | 1475 | ||
| 1476 | kfree(del_list); | 1476 | kfree(del_list); |
| @@ -1515,32 +1515,30 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) | |||
| 1515 | 1515 | ||
| 1516 | /* flush a full buffer */ | 1516 | /* flush a full buffer */ |
| 1517 | if (num_add == filter_list_len) { | 1517 | if (num_add == filter_list_len) { |
| 1518 | ret = i40e_aq_add_macvlan(&pf->hw, | 1518 | aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid, |
| 1519 | vsi->seid, | 1519 | add_list, num_add, |
| 1520 | add_list, | 1520 | NULL); |
| 1521 | num_add, | ||
| 1522 | NULL); | ||
| 1523 | num_add = 0; | 1521 | num_add = 0; |
| 1524 | 1522 | ||
| 1525 | if (ret) | 1523 | if (aq_ret) |
| 1526 | break; | 1524 | break; |
| 1527 | memset(add_list, 0, sizeof(*add_list)); | 1525 | memset(add_list, 0, sizeof(*add_list)); |
| 1528 | } | 1526 | } |
| 1529 | } | 1527 | } |
| 1530 | if (num_add) { | 1528 | if (num_add) { |
| 1531 | ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid, | 1529 | aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid, |
| 1532 | add_list, num_add, NULL); | 1530 | add_list, num_add, NULL); |
| 1533 | num_add = 0; | 1531 | num_add = 0; |
| 1534 | } | 1532 | } |
| 1535 | kfree(add_list); | 1533 | kfree(add_list); |
| 1536 | add_list = NULL; | 1534 | add_list = NULL; |
| 1537 | 1535 | ||
| 1538 | if (add_happened && (!ret)) { | 1536 | if (add_happened && (!aq_ret)) { |
| 1539 | /* do nothing */; | 1537 | /* do nothing */; |
| 1540 | } else if (add_happened && (ret)) { | 1538 | } else if (add_happened && (aq_ret)) { |
| 1541 | dev_info(&pf->pdev->dev, | 1539 | dev_info(&pf->pdev->dev, |
| 1542 | "add filter failed, err %d, aq_err %d\n", | 1540 | "add filter failed, err %d, aq_err %d\n", |
| 1543 | ret, pf->hw.aq.asq_last_status); | 1541 | aq_ret, pf->hw.aq.asq_last_status); |
| 1544 | if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) && | 1542 | if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) && |
| 1545 | !test_bit(__I40E_FILTER_OVERFLOW_PROMISC, | 1543 | !test_bit(__I40E_FILTER_OVERFLOW_PROMISC, |
| 1546 | &vsi->state)) { | 1544 | &vsi->state)) { |
| @@ -1556,28 +1554,27 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) | |||
| 1556 | if (changed_flags & IFF_ALLMULTI) { | 1554 | if (changed_flags & IFF_ALLMULTI) { |
| 1557 | bool cur_multipromisc; | 1555 | bool cur_multipromisc; |
| 1558 | cur_multipromisc = !!(vsi->current_netdev_flags & IFF_ALLMULTI); | 1556 | cur_multipromisc = !!(vsi->current_netdev_flags & IFF_ALLMULTI); |
| 1559 | ret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw, | 1557 | aq_ret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw, |
| 1560 | vsi->seid, | 1558 | vsi->seid, |
| 1561 | cur_multipromisc, | 1559 | cur_multipromisc, |
| 1562 | NULL); | 1560 | NULL); |
| 1563 | if (ret) | 1561 | if (aq_ret) |
| 1564 | dev_info(&pf->pdev->dev, | 1562 | dev_info(&pf->pdev->dev, |
| 1565 | "set multi promisc failed, err %d, aq_err %d\n", | 1563 | "set multi promisc failed, err %d, aq_err %d\n", |
| 1566 | ret, pf->hw.aq.asq_last_status); | 1564 | aq_ret, pf->hw.aq.asq_last_status); |
| 1567 | } | 1565 | } |
| 1568 | if ((changed_flags & IFF_PROMISC) || promisc_forced_on) { | 1566 | if ((changed_flags & IFF_PROMISC) || promisc_forced_on) { |
| 1569 | bool cur_promisc; | 1567 | bool cur_promisc; |
| 1570 | cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) || | 1568 | cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) || |
| 1571 | test_bit(__I40E_FILTER_OVERFLOW_PROMISC, | 1569 | test_bit(__I40E_FILTER_OVERFLOW_PROMISC, |
| 1572 | &vsi->state)); | 1570 | &vsi->state)); |
| 1573 | ret = i40e_aq_set_vsi_unicast_promiscuous(&vsi->back->hw, | 1571 | aq_ret = i40e_aq_set_vsi_unicast_promiscuous(&vsi->back->hw, |
| 1574 | vsi->seid, | 1572 | vsi->seid, |
| 1575 | cur_promisc, | 1573 | cur_promisc, NULL); |
| 1576 | NULL); | 1574 | if (aq_ret) |
| 1577 | if (ret) | ||
| 1578 | dev_info(&pf->pdev->dev, | 1575 | dev_info(&pf->pdev->dev, |
| 1579 | "set uni promisc failed, err %d, aq_err %d\n", | 1576 | "set uni promisc failed, err %d, aq_err %d\n", |
| 1580 | ret, pf->hw.aq.asq_last_status); | 1577 | aq_ret, pf->hw.aq.asq_last_status); |
| 1581 | } | 1578 | } |
| 1582 | 1579 | ||
| 1583 | clear_bit(__I40E_CONFIG_BUSY, &vsi->state); | 1580 | clear_bit(__I40E_CONFIG_BUSY, &vsi->state); |
| @@ -1790,6 +1787,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid) | |||
| 1790 | * i40e_vsi_kill_vlan - Remove vsi membership for given vlan | 1787 | * i40e_vsi_kill_vlan - Remove vsi membership for given vlan |
| 1791 | * @vsi: the vsi being configured | 1788 | * @vsi: the vsi being configured |
| 1792 | * @vid: vlan id to be removed (0 = untagged only , -1 = any) | 1789 | * @vid: vlan id to be removed (0 = untagged only , -1 = any) |
| 1790 | * | ||
| 1791 | * Return: 0 on success or negative otherwise | ||
| 1793 | **/ | 1792 | **/ |
| 1794 | int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid) | 1793 | int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid) |
| 1795 | { | 1794 | { |
| @@ -1863,37 +1862,39 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid) | |||
| 1863 | * i40e_vlan_rx_add_vid - Add a vlan id filter to HW offload | 1862 | * i40e_vlan_rx_add_vid - Add a vlan id filter to HW offload |
| 1864 | * @netdev: network interface to be adjusted | 1863 | * @netdev: network interface to be adjusted |
| 1865 | * @vid: vlan id to be added | 1864 | * @vid: vlan id to be added |
| 1865 | * | ||
| 1866 | * net_device_ops implementation for adding vlan ids | ||
| 1866 | **/ | 1867 | **/ |
| 1867 | static int i40e_vlan_rx_add_vid(struct net_device *netdev, | 1868 | static int i40e_vlan_rx_add_vid(struct net_device *netdev, |
| 1868 | __always_unused __be16 proto, u16 vid) | 1869 | __always_unused __be16 proto, u16 vid) |
| 1869 | { | 1870 | { |
| 1870 | struct i40e_netdev_priv *np = netdev_priv(netdev); | 1871 | struct i40e_netdev_priv *np = netdev_priv(netdev); |
| 1871 | struct i40e_vsi *vsi = np->vsi; | 1872 | struct i40e_vsi *vsi = np->vsi; |
| 1872 | int ret; | 1873 | int ret = 0; |
| 1873 | 1874 | ||
| 1874 | if (vid > 4095) | 1875 | if (vid > 4095) |
| 1875 | return 0; | 1876 | return -EINVAL; |
| 1877 | |||
| 1878 | netdev_info(netdev, "adding %pM vid=%d\n", netdev->dev_addr, vid); | ||
| 1876 | 1879 | ||
| 1877 | netdev_info(vsi->netdev, "adding %pM vid=%d\n", | ||
| 1878 | netdev->dev_addr, vid); | ||
| 1879 | /* If the network stack called us with vid = 0, we should | 1880 | /* If the network stack called us with vid = 0, we should |
| 1880 | * indicate to i40e_vsi_add_vlan() that we want to receive | 1881 | * indicate to i40e_vsi_add_vlan() that we want to receive |
| 1881 | * any traffic (i.e. with any vlan tag, or untagged) | 1882 | * any traffic (i.e. with any vlan tag, or untagged) |
| 1882 | */ | 1883 | */ |
| 1883 | ret = i40e_vsi_add_vlan(vsi, vid ? vid : I40E_VLAN_ANY); | 1884 | ret = i40e_vsi_add_vlan(vsi, vid ? vid : I40E_VLAN_ANY); |
| 1884 | 1885 | ||
| 1885 | if (!ret) { | 1886 | if (!ret && (vid < VLAN_N_VID)) |
| 1886 | if (vid < VLAN_N_VID) | 1887 | set_bit(vid, vsi->active_vlans); |
| 1887 | set_bit(vid, vsi->active_vlans); | ||
| 1888 | } | ||
| 1889 | 1888 | ||
| 1890 | return 0; | 1889 | return ret; |
| 1891 | } | 1890 | } |
| 1892 | 1891 | ||
| 1893 | /** | 1892 | /** |
| 1894 | * i40e_vlan_rx_kill_vid - Remove a vlan id filter from HW offload | 1893 | * i40e_vlan_rx_kill_vid - Remove a vlan id filter from HW offload |
| 1895 | * @netdev: network interface to be adjusted | 1894 | * @netdev: network interface to be adjusted |
| 1896 | * @vid: vlan id to be removed | 1895 | * @vid: vlan id to be removed |
| 1896 | * | ||
| 1897 | * net_device_ops implementation for adding vlan ids | ||
| 1897 | **/ | 1898 | **/ |
| 1898 | static int i40e_vlan_rx_kill_vid(struct net_device *netdev, | 1899 | static int i40e_vlan_rx_kill_vid(struct net_device *netdev, |
| 1899 | __always_unused __be16 proto, u16 vid) | 1900 | __always_unused __be16 proto, u16 vid) |
| @@ -1901,15 +1902,16 @@ static int i40e_vlan_rx_kill_vid(struct net_device *netdev, | |||
| 1901 | struct i40e_netdev_priv *np = netdev_priv(netdev); | 1902 | struct i40e_netdev_priv *np = netdev_priv(netdev); |
| 1902 | struct i40e_vsi *vsi = np->vsi; | 1903 | struct i40e_vsi *vsi = np->vsi; |
| 1903 | 1904 | ||
| 1904 | netdev_info(vsi->netdev, "removing %pM vid=%d\n", | 1905 | netdev_info(netdev, "removing %pM vid=%d\n", netdev->dev_addr, vid); |
| 1905 | netdev->dev_addr, vid); | 1906 | |
| 1906 | /* return code is ignored as there is nothing a user | 1907 | /* return code is ignored as there is nothing a user |
| 1907 | * can do about failure to remove and a log message was | 1908 | * can do about failure to remove and a log message was |
| 1908 | * already printed from another function | 1909 | * already printed from the other function |
| 1909 | */ | 1910 | */ |
| 1910 | i40e_vsi_kill_vlan(vsi, vid); | 1911 | i40e_vsi_kill_vlan(vsi, vid); |
| 1911 | 1912 | ||
| 1912 | clear_bit(vid, vsi->active_vlans); | 1913 | clear_bit(vid, vsi->active_vlans); |
| 1914 | |||
| 1913 | return 0; | 1915 | return 0; |
| 1914 | } | 1916 | } |
| 1915 | 1917 | ||
| @@ -1936,10 +1938,10 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi) | |||
| 1936 | * @vsi: the vsi being adjusted | 1938 | * @vsi: the vsi being adjusted |
| 1937 | * @vid: the vlan id to set as a PVID | 1939 | * @vid: the vlan id to set as a PVID |
| 1938 | **/ | 1940 | **/ |
| 1939 | i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid) | 1941 | int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid) |
| 1940 | { | 1942 | { |
| 1941 | struct i40e_vsi_context ctxt; | 1943 | struct i40e_vsi_context ctxt; |
| 1942 | i40e_status ret; | 1944 | i40e_status aq_ret; |
| 1943 | 1945 | ||
| 1944 | vsi->info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID); | 1946 | vsi->info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID); |
| 1945 | vsi->info.pvid = cpu_to_le16(vid); | 1947 | vsi->info.pvid = cpu_to_le16(vid); |
| @@ -1948,14 +1950,15 @@ i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid) | |||
| 1948 | 1950 | ||
| 1949 | ctxt.seid = vsi->seid; | 1951 | ctxt.seid = vsi->seid; |
| 1950 | memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); | 1952 | memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); |
| 1951 | ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); | 1953 | aq_ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); |
| 1952 | if (ret) { | 1954 | if (aq_ret) { |
| 1953 | dev_info(&vsi->back->pdev->dev, | 1955 | dev_info(&vsi->back->pdev->dev, |
| 1954 | "%s: update vsi failed, aq_err=%d\n", | 1956 | "%s: update vsi failed, aq_err=%d\n", |
| 1955 | __func__, vsi->back->hw.aq.asq_last_status); | 1957 | __func__, vsi->back->hw.aq.asq_last_status); |
| 1958 | return -ENOENT; | ||
| 1956 | } | 1959 | } |
| 1957 | 1960 | ||
| 1958 | return ret; | 1961 | return 0; |
| 1959 | } | 1962 | } |
| 1960 | 1963 | ||
| 1961 | /** | 1964 | /** |
| @@ -3326,7 +3329,8 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf) | |||
| 3326 | **/ | 3329 | **/ |
| 3327 | static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg) | 3330 | static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg) |
| 3328 | { | 3331 | { |
| 3329 | int num_tc = 0, i; | 3332 | u8 num_tc = 0; |
| 3333 | int i; | ||
| 3330 | 3334 | ||
| 3331 | /* Scan the ETS Config Priority Table to find | 3335 | /* Scan the ETS Config Priority Table to find |
| 3332 | * traffic class enabled for a given priority | 3336 | * traffic class enabled for a given priority |
| @@ -3341,9 +3345,7 @@ static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg) | |||
| 3341 | /* Traffic class index starts from zero so | 3345 | /* Traffic class index starts from zero so |
| 3342 | * increment to return the actual count | 3346 | * increment to return the actual count |
| 3343 | */ | 3347 | */ |
| 3344 | num_tc++; | 3348 | return num_tc + 1; |
| 3345 | |||
| 3346 | return num_tc; | ||
| 3347 | } | 3349 | } |
| 3348 | 3350 | ||
| 3349 | /** | 3351 | /** |
| @@ -3451,28 +3453,27 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) | |||
| 3451 | struct i40e_aqc_query_vsi_bw_config_resp bw_config = {0}; | 3453 | struct i40e_aqc_query_vsi_bw_config_resp bw_config = {0}; |
| 3452 | struct i40e_pf *pf = vsi->back; | 3454 | struct i40e_pf *pf = vsi->back; |
| 3453 | struct i40e_hw *hw = &pf->hw; | 3455 | struct i40e_hw *hw = &pf->hw; |
| 3456 | i40e_status aq_ret; | ||
| 3454 | u32 tc_bw_max; | 3457 | u32 tc_bw_max; |
| 3455 | int ret; | ||
| 3456 | int i; | 3458 | int i; |
| 3457 | 3459 | ||
| 3458 | /* Get the VSI level BW configuration */ | 3460 | /* Get the VSI level BW configuration */ |
| 3459 | ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL); | 3461 | aq_ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL); |
| 3460 | if (ret) { | 3462 | if (aq_ret) { |
| 3461 | dev_info(&pf->pdev->dev, | 3463 | dev_info(&pf->pdev->dev, |
| 3462 | "couldn't get pf vsi bw config, err %d, aq_err %d\n", | 3464 | "couldn't get pf vsi bw config, err %d, aq_err %d\n", |
| 3463 | ret, pf->hw.aq.asq_last_status); | 3465 | aq_ret, pf->hw.aq.asq_last_status); |
| 3464 | return ret; | 3466 | return -EINVAL; |
| 3465 | } | 3467 | } |
| 3466 | 3468 | ||
| 3467 | /* Get the VSI level BW configuration per TC */ | 3469 | /* Get the VSI level BW configuration per TC */ |
| 3468 | ret = i40e_aq_query_vsi_ets_sla_config(hw, vsi->seid, | 3470 | aq_ret = i40e_aq_query_vsi_ets_sla_config(hw, vsi->seid, &bw_ets_config, |
| 3469 | &bw_ets_config, | 3471 | NULL); |
| 3470 | NULL); | 3472 | if (aq_ret) { |
| 3471 | if (ret) { | ||
| 3472 | dev_info(&pf->pdev->dev, | 3473 | dev_info(&pf->pdev->dev, |
| 3473 | "couldn't get pf vsi ets bw config, err %d, aq_err %d\n", | 3474 | "couldn't get pf vsi ets bw config, err %d, aq_err %d\n", |
| 3474 | ret, pf->hw.aq.asq_last_status); | 3475 | aq_ret, pf->hw.aq.asq_last_status); |
| 3475 | return ret; | 3476 | return -EINVAL; |
| 3476 | } | 3477 | } |
| 3477 | 3478 | ||
| 3478 | if (bw_config.tc_valid_bits != bw_ets_config.tc_valid_bits) { | 3479 | if (bw_config.tc_valid_bits != bw_ets_config.tc_valid_bits) { |
| @@ -3494,7 +3495,8 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) | |||
| 3494 | /* 3 bits out of 4 for each TC */ | 3495 | /* 3 bits out of 4 for each TC */ |
| 3495 | vsi->bw_ets_max_quanta[i] = (u8)((tc_bw_max >> (i*4)) & 0x7); | 3496 | vsi->bw_ets_max_quanta[i] = (u8)((tc_bw_max >> (i*4)) & 0x7); |
| 3496 | } | 3497 | } |
| 3497 | return ret; | 3498 | |
| 3499 | return 0; | ||
| 3498 | } | 3500 | } |
| 3499 | 3501 | ||
| 3500 | /** | 3502 | /** |
| @@ -3505,30 +3507,30 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) | |||
| 3505 | * | 3507 | * |
| 3506 | * Returns 0 on success, negative value on failure | 3508 | * Returns 0 on success, negative value on failure |
| 3507 | **/ | 3509 | **/ |
| 3508 | static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, | 3510 | static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc, |
| 3509 | u8 enabled_tc, | ||
| 3510 | u8 *bw_share) | 3511 | u8 *bw_share) |
| 3511 | { | 3512 | { |
| 3512 | struct i40e_aqc_configure_vsi_tc_bw_data bw_data; | 3513 | struct i40e_aqc_configure_vsi_tc_bw_data bw_data; |
| 3513 | int i, ret = 0; | 3514 | i40e_status aq_ret; |
| 3515 | int i; | ||
| 3514 | 3516 | ||
| 3515 | bw_data.tc_valid_bits = enabled_tc; | 3517 | bw_data.tc_valid_bits = enabled_tc; |
| 3516 | for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) | 3518 | for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) |
| 3517 | bw_data.tc_bw_credits[i] = bw_share[i]; | 3519 | bw_data.tc_bw_credits[i] = bw_share[i]; |
| 3518 | 3520 | ||
| 3519 | ret = i40e_aq_config_vsi_tc_bw(&vsi->back->hw, vsi->seid, | 3521 | aq_ret = i40e_aq_config_vsi_tc_bw(&vsi->back->hw, vsi->seid, &bw_data, |
| 3520 | &bw_data, NULL); | 3522 | NULL); |
| 3521 | if (ret) { | 3523 | if (aq_ret) { |
| 3522 | dev_info(&vsi->back->pdev->dev, | 3524 | dev_info(&vsi->back->pdev->dev, |
| 3523 | "%s: AQ command Config VSI BW allocation per TC failed = %d\n", | 3525 | "%s: AQ command Config VSI BW allocation per TC failed = %d\n", |
| 3524 | __func__, vsi->back->hw.aq.asq_last_status); | 3526 | __func__, vsi->back->hw.aq.asq_last_status); |
| 3525 | return ret; | 3527 | return -EINVAL; |
| 3526 | } | 3528 | } |
| 3527 | 3529 | ||
| 3528 | for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) | 3530 | for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) |
| 3529 | vsi->info.qs_handle[i] = bw_data.qs_handles[i]; | 3531 | vsi->info.qs_handle[i] = bw_data.qs_handles[i]; |
| 3530 | 3532 | ||
| 3531 | return ret; | 3533 | return 0; |
| 3532 | } | 3534 | } |
| 3533 | 3535 | ||
| 3534 | /** | 3536 | /** |
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 48cbc833b051..86d51429a189 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c | |||
| @@ -1607,6 +1607,9 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) | |||
| 1607 | igb_write_phy_reg(hw, I347AT4_PAGE_SELECT, 0); | 1607 | igb_write_phy_reg(hw, I347AT4_PAGE_SELECT, 0); |
| 1608 | igb_write_phy_reg(hw, PHY_CONTROL, 0x4140); | 1608 | igb_write_phy_reg(hw, PHY_CONTROL, 0x4140); |
| 1609 | } | 1609 | } |
| 1610 | } else if (hw->phy.type == e1000_phy_82580) { | ||
| 1611 | /* enable MII loopback */ | ||
| 1612 | igb_write_phy_reg(hw, I82580_PHY_LBK_CTRL, 0x8041); | ||
| 1610 | } | 1613 | } |
| 1611 | 1614 | ||
| 1612 | /* add small delay to avoid loopback test failure */ | 1615 | /* add small delay to avoid loopback test failure */ |
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 1a9c4f6269ea..ecc7f7b696b8 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c | |||
| @@ -3086,13 +3086,16 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
| 3086 | PCI_DMA_FROMDEVICE); | 3086 | PCI_DMA_FROMDEVICE); |
| 3087 | skge_rx_reuse(e, skge->rx_buf_size); | 3087 | skge_rx_reuse(e, skge->rx_buf_size); |
| 3088 | } else { | 3088 | } else { |
| 3089 | struct skge_element ee; | ||
| 3089 | struct sk_buff *nskb; | 3090 | struct sk_buff *nskb; |
| 3090 | 3091 | ||
| 3091 | nskb = netdev_alloc_skb_ip_align(dev, skge->rx_buf_size); | 3092 | nskb = netdev_alloc_skb_ip_align(dev, skge->rx_buf_size); |
| 3092 | if (!nskb) | 3093 | if (!nskb) |
| 3093 | goto resubmit; | 3094 | goto resubmit; |
| 3094 | 3095 | ||
| 3095 | skb = e->skb; | 3096 | ee = *e; |
| 3097 | |||
| 3098 | skb = ee.skb; | ||
| 3096 | prefetch(skb->data); | 3099 | prefetch(skb->data); |
| 3097 | 3100 | ||
| 3098 | if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) { | 3101 | if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) { |
| @@ -3101,8 +3104,8 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
| 3101 | } | 3104 | } |
| 3102 | 3105 | ||
| 3103 | pci_unmap_single(skge->hw->pdev, | 3106 | pci_unmap_single(skge->hw->pdev, |
| 3104 | dma_unmap_addr(e, mapaddr), | 3107 | dma_unmap_addr(&ee, mapaddr), |
| 3105 | dma_unmap_len(e, maplen), | 3108 | dma_unmap_len(&ee, maplen), |
| 3106 | PCI_DMA_FROMDEVICE); | 3109 | PCI_DMA_FROMDEVICE); |
| 3107 | } | 3110 | } |
| 3108 | 3111 | ||
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index 83c2091c9c23..bd1a2d2bc2ae 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c | |||
| @@ -543,7 +543,7 @@ static const struct of_device_id moxart_mac_match[] = { | |||
| 543 | { } | 543 | { } |
| 544 | }; | 544 | }; |
| 545 | 545 | ||
| 546 | struct __initdata platform_driver moxart_mac_driver = { | 546 | static struct platform_driver moxart_mac_driver = { |
| 547 | .probe = moxart_mac_probe, | 547 | .probe = moxart_mac_probe, |
| 548 | .remove = moxart_remove, | 548 | .remove = moxart_remove, |
| 549 | .driver = { | 549 | .driver = { |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 4d7ad0074d1c..ebe4c86e5230 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
| @@ -1794,3 +1794,11 @@ const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = { | |||
| 1794 | .set_msglevel = qlcnic_set_msglevel, | 1794 | .set_msglevel = qlcnic_set_msglevel, |
| 1795 | .get_msglevel = qlcnic_get_msglevel, | 1795 | .get_msglevel = qlcnic_get_msglevel, |
| 1796 | }; | 1796 | }; |
| 1797 | |||
| 1798 | const struct ethtool_ops qlcnic_ethtool_failed_ops = { | ||
| 1799 | .get_settings = qlcnic_get_settings, | ||
| 1800 | .get_drvinfo = qlcnic_get_drvinfo, | ||
| 1801 | .set_msglevel = qlcnic_set_msglevel, | ||
| 1802 | .get_msglevel = qlcnic_get_msglevel, | ||
| 1803 | .set_dump = qlcnic_set_dump, | ||
| 1804 | }; | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index c4c5023e1fdf..21d00a0449a1 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
| @@ -431,6 +431,9 @@ static void qlcnic_82xx_cancel_idc_work(struct qlcnic_adapter *adapter) | |||
| 431 | while (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) | 431 | while (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) |
| 432 | usleep_range(10000, 11000); | 432 | usleep_range(10000, 11000); |
| 433 | 433 | ||
| 434 | if (!adapter->fw_work.work.func) | ||
| 435 | return; | ||
| 436 | |||
| 434 | cancel_delayed_work_sync(&adapter->fw_work); | 437 | cancel_delayed_work_sync(&adapter->fw_work); |
| 435 | } | 438 | } |
| 436 | 439 | ||
| @@ -2275,8 +2278,9 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 2275 | adapter->portnum = adapter->ahw->pci_func; | 2278 | adapter->portnum = adapter->ahw->pci_func; |
| 2276 | err = qlcnic_start_firmware(adapter); | 2279 | err = qlcnic_start_firmware(adapter); |
| 2277 | if (err) { | 2280 | if (err) { |
| 2278 | dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"); | 2281 | dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n" |
| 2279 | goto err_out_free_hw; | 2282 | "\t\tIf reboot doesn't help, try flashing the card\n"); |
| 2283 | goto err_out_maintenance_mode; | ||
| 2280 | } | 2284 | } |
| 2281 | 2285 | ||
| 2282 | qlcnic_get_multiq_capability(adapter); | 2286 | qlcnic_get_multiq_capability(adapter); |
| @@ -2408,6 +2412,22 @@ err_out_disable_pdev: | |||
| 2408 | pci_set_drvdata(pdev, NULL); | 2412 | pci_set_drvdata(pdev, NULL); |
| 2409 | pci_disable_device(pdev); | 2413 | pci_disable_device(pdev); |
| 2410 | return err; | 2414 | return err; |
| 2415 | |||
| 2416 | err_out_maintenance_mode: | ||
| 2417 | netdev->netdev_ops = &qlcnic_netdev_failed_ops; | ||
| 2418 | SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_failed_ops); | ||
| 2419 | err = register_netdev(netdev); | ||
| 2420 | |||
| 2421 | if (err) { | ||
| 2422 | dev_err(&pdev->dev, "Failed to register net device\n"); | ||
| 2423 | qlcnic_clr_all_drv_state(adapter, 0); | ||
| 2424 | goto err_out_free_hw; | ||
| 2425 | } | ||
| 2426 | |||
| 2427 | pci_set_drvdata(pdev, adapter); | ||
| 2428 | qlcnic_add_sysfs(adapter); | ||
| 2429 | |||
| 2430 | return 0; | ||
| 2411 | } | 2431 | } |
| 2412 | 2432 | ||
| 2413 | static void qlcnic_remove(struct pci_dev *pdev) | 2433 | static void qlcnic_remove(struct pci_dev *pdev) |
| @@ -2518,8 +2538,16 @@ static int qlcnic_resume(struct pci_dev *pdev) | |||
| 2518 | static int qlcnic_open(struct net_device *netdev) | 2538 | static int qlcnic_open(struct net_device *netdev) |
| 2519 | { | 2539 | { |
| 2520 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 2540 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
| 2541 | u32 state; | ||
| 2521 | int err; | 2542 | int err; |
| 2522 | 2543 | ||
| 2544 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); | ||
| 2545 | if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD) { | ||
| 2546 | netdev_err(netdev, "%s: Device is in FAILED state\n", __func__); | ||
| 2547 | |||
| 2548 | return -EIO; | ||
| 2549 | } | ||
| 2550 | |||
| 2523 | netif_carrier_off(netdev); | 2551 | netif_carrier_off(netdev); |
| 2524 | 2552 | ||
| 2525 | err = qlcnic_attach(adapter); | 2553 | err = qlcnic_attach(adapter); |
| @@ -3228,6 +3256,13 @@ void qlcnic_82xx_dev_request_reset(struct qlcnic_adapter *adapter, u32 key) | |||
| 3228 | return; | 3256 | return; |
| 3229 | 3257 | ||
| 3230 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); | 3258 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); |
| 3259 | if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD) { | ||
| 3260 | netdev_err(adapter->netdev, "%s: Device is in FAILED state\n", | ||
| 3261 | __func__); | ||
| 3262 | qlcnic_api_unlock(adapter); | ||
| 3263 | |||
| 3264 | return; | ||
| 3265 | } | ||
| 3231 | 3266 | ||
| 3232 | if (state == QLCNIC_DEV_READY) { | 3267 | if (state == QLCNIC_DEV_READY) { |
| 3233 | QLC_SHARED_REG_WR32(adapter, QLCNIC_CRB_DEV_STATE, | 3268 | QLC_SHARED_REG_WR32(adapter, QLCNIC_CRB_DEV_STATE, |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c index 330d9a8774ad..686f460b1502 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | |||
| @@ -397,6 +397,7 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter) | |||
| 397 | { | 397 | { |
| 398 | struct net_device *netdev = adapter->netdev; | 398 | struct net_device *netdev = adapter->netdev; |
| 399 | 399 | ||
| 400 | rtnl_lock(); | ||
| 400 | if (netif_running(netdev)) | 401 | if (netif_running(netdev)) |
| 401 | __qlcnic_down(adapter, netdev); | 402 | __qlcnic_down(adapter, netdev); |
| 402 | 403 | ||
| @@ -407,12 +408,15 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter) | |||
| 407 | /* After disabling SRIOV re-init the driver in default mode | 408 | /* After disabling SRIOV re-init the driver in default mode |
| 408 | configure opmode based on op_mode of function | 409 | configure opmode based on op_mode of function |
| 409 | */ | 410 | */ |
| 410 | if (qlcnic_83xx_configure_opmode(adapter)) | 411 | if (qlcnic_83xx_configure_opmode(adapter)) { |
| 412 | rtnl_unlock(); | ||
| 411 | return -EIO; | 413 | return -EIO; |
| 414 | } | ||
| 412 | 415 | ||
| 413 | if (netif_running(netdev)) | 416 | if (netif_running(netdev)) |
| 414 | __qlcnic_up(adapter, netdev); | 417 | __qlcnic_up(adapter, netdev); |
| 415 | 418 | ||
| 419 | rtnl_unlock(); | ||
| 416 | return 0; | 420 | return 0; |
| 417 | } | 421 | } |
| 418 | 422 | ||
| @@ -533,6 +537,7 @@ static int qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, int num_vfs) | |||
| 533 | return -EIO; | 537 | return -EIO; |
| 534 | } | 538 | } |
| 535 | 539 | ||
| 540 | rtnl_lock(); | ||
| 536 | if (netif_running(netdev)) | 541 | if (netif_running(netdev)) |
| 537 | __qlcnic_down(adapter, netdev); | 542 | __qlcnic_down(adapter, netdev); |
| 538 | 543 | ||
| @@ -555,6 +560,7 @@ static int qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, int num_vfs) | |||
| 555 | __qlcnic_up(adapter, netdev); | 560 | __qlcnic_up(adapter, netdev); |
| 556 | 561 | ||
| 557 | error: | 562 | error: |
| 563 | rtnl_unlock(); | ||
| 558 | return err; | 564 | return err; |
| 559 | } | 565 | } |
| 560 | 566 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c index c6165d05cc13..019f4377307f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | |||
| @@ -1272,6 +1272,7 @@ void qlcnic_remove_sysfs_entries(struct qlcnic_adapter *adapter) | |||
| 1272 | void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) | 1272 | void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) |
| 1273 | { | 1273 | { |
| 1274 | struct device *dev = &adapter->pdev->dev; | 1274 | struct device *dev = &adapter->pdev->dev; |
| 1275 | u32 state; | ||
| 1275 | 1276 | ||
| 1276 | if (device_create_bin_file(dev, &bin_attr_port_stats)) | 1277 | if (device_create_bin_file(dev, &bin_attr_port_stats)) |
| 1277 | dev_info(dev, "failed to create port stats sysfs entry"); | 1278 | dev_info(dev, "failed to create port stats sysfs entry"); |
| @@ -1285,8 +1286,13 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) | |||
| 1285 | if (device_create_bin_file(dev, &bin_attr_mem)) | 1286 | if (device_create_bin_file(dev, &bin_attr_mem)) |
| 1286 | dev_info(dev, "failed to create mem sysfs entry\n"); | 1287 | dev_info(dev, "failed to create mem sysfs entry\n"); |
| 1287 | 1288 | ||
| 1289 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); | ||
| 1290 | if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD) | ||
| 1291 | return; | ||
| 1292 | |||
| 1288 | if (device_create_bin_file(dev, &bin_attr_pci_config)) | 1293 | if (device_create_bin_file(dev, &bin_attr_pci_config)) |
| 1289 | dev_info(dev, "failed to create pci config sysfs entry"); | 1294 | dev_info(dev, "failed to create pci config sysfs entry"); |
| 1295 | |||
| 1290 | if (device_create_file(dev, &dev_attr_beacon)) | 1296 | if (device_create_file(dev, &dev_attr_beacon)) |
| 1291 | dev_info(dev, "failed to create beacon sysfs entry"); | 1297 | dev_info(dev, "failed to create beacon sysfs entry"); |
| 1292 | 1298 | ||
| @@ -1307,6 +1313,7 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) | |||
| 1307 | void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) | 1313 | void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) |
| 1308 | { | 1314 | { |
| 1309 | struct device *dev = &adapter->pdev->dev; | 1315 | struct device *dev = &adapter->pdev->dev; |
| 1316 | u32 state; | ||
| 1310 | 1317 | ||
| 1311 | device_remove_bin_file(dev, &bin_attr_port_stats); | 1318 | device_remove_bin_file(dev, &bin_attr_port_stats); |
| 1312 | 1319 | ||
| @@ -1315,6 +1322,11 @@ void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) | |||
| 1315 | device_remove_file(dev, &dev_attr_diag_mode); | 1322 | device_remove_file(dev, &dev_attr_diag_mode); |
| 1316 | device_remove_bin_file(dev, &bin_attr_crb); | 1323 | device_remove_bin_file(dev, &bin_attr_crb); |
| 1317 | device_remove_bin_file(dev, &bin_attr_mem); | 1324 | device_remove_bin_file(dev, &bin_attr_mem); |
| 1325 | |||
| 1326 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); | ||
| 1327 | if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD) | ||
| 1328 | return; | ||
| 1329 | |||
| 1318 | device_remove_bin_file(dev, &bin_attr_pci_config); | 1330 | device_remove_bin_file(dev, &bin_attr_pci_config); |
| 1319 | device_remove_file(dev, &dev_attr_beacon); | 1331 | device_remove_file(dev, &dev_attr_beacon); |
| 1320 | if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED)) | 1332 | if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED)) |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c b/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c index 10093f0c4c0f..6bc5db703920 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | |||
| @@ -740,8 +740,8 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) | |||
| 740 | int i; | 740 | int i; |
| 741 | 741 | ||
| 742 | if (!mpi_coredump) { | 742 | if (!mpi_coredump) { |
| 743 | netif_err(qdev, drv, qdev->ndev, "No memory available\n"); | 743 | netif_err(qdev, drv, qdev->ndev, "No memory allocated\n"); |
| 744 | return -ENOMEM; | 744 | return -EINVAL; |
| 745 | } | 745 | } |
| 746 | 746 | ||
| 747 | /* Try to get the spinlock, but dont worry if | 747 | /* Try to get the spinlock, but dont worry if |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c b/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c index ff2bf8a4e247..7ad146080c36 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c | |||
| @@ -1274,7 +1274,7 @@ void ql_mpi_reset_work(struct work_struct *work) | |||
| 1274 | return; | 1274 | return; |
| 1275 | } | 1275 | } |
| 1276 | 1276 | ||
| 1277 | if (!ql_core_dump(qdev, qdev->mpi_coredump)) { | 1277 | if (qdev->mpi_coredump && !ql_core_dump(qdev, qdev->mpi_coredump)) { |
| 1278 | netif_err(qdev, drv, qdev->ndev, "Core is dumped!\n"); | 1278 | netif_err(qdev, drv, qdev->ndev, "Core is dumped!\n"); |
| 1279 | qdev->core_is_dumped = 1; | 1279 | qdev->core_is_dumped = 1; |
| 1280 | queue_delayed_work(qdev->workqueue, | 1280 | queue_delayed_work(qdev->workqueue, |
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index 128d7cdf9eb2..c082562dbf4e 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c | |||
| @@ -27,10 +27,10 @@ | |||
| 27 | 27 | ||
| 28 | /* A reboot/assertion causes the MCDI status word to be set after the | 28 | /* A reboot/assertion causes the MCDI status word to be set after the |
| 29 | * command word is set or a REBOOT event is sent. If we notice a reboot | 29 | * command word is set or a REBOOT event is sent. If we notice a reboot |
| 30 | * via these mechanisms then wait 20ms for the status word to be set. | 30 | * via these mechanisms then wait 250ms for the status word to be set. |
| 31 | */ | 31 | */ |
| 32 | #define MCDI_STATUS_DELAY_US 100 | 32 | #define MCDI_STATUS_DELAY_US 100 |
| 33 | #define MCDI_STATUS_DELAY_COUNT 200 | 33 | #define MCDI_STATUS_DELAY_COUNT 2500 |
| 34 | #define MCDI_STATUS_SLEEP_MS \ | 34 | #define MCDI_STATUS_SLEEP_MS \ |
| 35 | (MCDI_STATUS_DELAY_US * MCDI_STATUS_DELAY_COUNT / 1000) | 35 | (MCDI_STATUS_DELAY_US * MCDI_STATUS_DELAY_COUNT / 1000) |
| 36 | 36 | ||
| @@ -800,9 +800,6 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc) | |||
| 800 | } else { | 800 | } else { |
| 801 | int count; | 801 | int count; |
| 802 | 802 | ||
| 803 | /* Nobody was waiting for an MCDI request, so trigger a reset */ | ||
| 804 | efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); | ||
| 805 | |||
| 806 | /* Consume the status word since efx_mcdi_rpc_finish() won't */ | 803 | /* Consume the status word since efx_mcdi_rpc_finish() won't */ |
| 807 | for (count = 0; count < MCDI_STATUS_DELAY_COUNT; ++count) { | 804 | for (count = 0; count < MCDI_STATUS_DELAY_COUNT; ++count) { |
| 808 | if (efx_mcdi_poll_reboot(efx)) | 805 | if (efx_mcdi_poll_reboot(efx)) |
| @@ -810,6 +807,9 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc) | |||
| 810 | udelay(MCDI_STATUS_DELAY_US); | 807 | udelay(MCDI_STATUS_DELAY_US); |
| 811 | } | 808 | } |
| 812 | mcdi->new_epoch = true; | 809 | mcdi->new_epoch = true; |
| 810 | |||
| 811 | /* Nobody was waiting for an MCDI request, so trigger a reset */ | ||
| 812 | efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); | ||
| 813 | } | 813 | } |
| 814 | 814 | ||
| 815 | spin_unlock(&mcdi->iface_lock); | 815 | spin_unlock(&mcdi->iface_lock); |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index c8f088ab5fdf..bdf697b184ae 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 32 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 33 | 33 | ||
| 34 | #define DRV_NAME "via-rhine" | 34 | #define DRV_NAME "via-rhine" |
| 35 | #define DRV_VERSION "1.5.0" | 35 | #define DRV_VERSION "1.5.1" |
| 36 | #define DRV_RELDATE "2010-10-09" | 36 | #define DRV_RELDATE "2010-10-09" |
| 37 | 37 | ||
| 38 | #include <linux/types.h> | 38 | #include <linux/types.h> |
| @@ -1704,7 +1704,12 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb, | |||
| 1704 | cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); | 1704 | cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); |
| 1705 | 1705 | ||
| 1706 | if (unlikely(vlan_tx_tag_present(skb))) { | 1706 | if (unlikely(vlan_tx_tag_present(skb))) { |
| 1707 | rp->tx_ring[entry].tx_status = cpu_to_le32((vlan_tx_tag_get(skb)) << 16); | 1707 | u16 vid_pcp = vlan_tx_tag_get(skb); |
| 1708 | |||
| 1709 | /* drop CFI/DEI bit, register needs VID and PCP */ | ||
| 1710 | vid_pcp = (vid_pcp & VLAN_VID_MASK) | | ||
| 1711 | ((vid_pcp & VLAN_PRIO_MASK) >> 1); | ||
| 1712 | rp->tx_ring[entry].tx_status = cpu_to_le32((vid_pcp) << 16); | ||
| 1708 | /* request tagging */ | 1713 | /* request tagging */ |
| 1709 | rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000); | 1714 | rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000); |
| 1710 | } | 1715 | } |
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index b88121f240ca..0029148077a9 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c | |||
| @@ -297,6 +297,12 @@ static int temac_dma_bd_init(struct net_device *ndev) | |||
| 297 | lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1))); | 297 | lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1))); |
| 298 | lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p); | 298 | lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p); |
| 299 | 299 | ||
| 300 | /* Init descriptor indexes */ | ||
| 301 | lp->tx_bd_ci = 0; | ||
| 302 | lp->tx_bd_next = 0; | ||
| 303 | lp->tx_bd_tail = 0; | ||
| 304 | lp->rx_bd_ci = 0; | ||
| 305 | |||
| 300 | return 0; | 306 | return 0; |
| 301 | 307 | ||
| 302 | out: | 308 | out: |
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index a34d6bf5e43b..cc70ecfc7062 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c | |||
| @@ -429,11 +429,13 @@ static void slip_write_wakeup(struct tty_struct *tty) | |||
| 429 | if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) | 429 | if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) |
| 430 | return; | 430 | return; |
| 431 | 431 | ||
| 432 | spin_lock(&sl->lock); | ||
| 432 | if (sl->xleft <= 0) { | 433 | if (sl->xleft <= 0) { |
| 433 | /* Now serial buffer is almost free & we can start | 434 | /* Now serial buffer is almost free & we can start |
| 434 | * transmission of another packet */ | 435 | * transmission of another packet */ |
| 435 | sl->dev->stats.tx_packets++; | 436 | sl->dev->stats.tx_packets++; |
| 436 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); | 437 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
| 438 | spin_unlock(&sl->lock); | ||
| 437 | sl_unlock(sl); | 439 | sl_unlock(sl); |
| 438 | return; | 440 | return; |
| 439 | } | 441 | } |
| @@ -441,6 +443,7 @@ static void slip_write_wakeup(struct tty_struct *tty) | |||
| 441 | actual = tty->ops->write(tty, sl->xhead, sl->xleft); | 443 | actual = tty->ops->write(tty, sl->xhead, sl->xleft); |
| 442 | sl->xleft -= actual; | 444 | sl->xleft -= actual; |
| 443 | sl->xhead += actual; | 445 | sl->xhead += actual; |
| 446 | spin_unlock(&sl->lock); | ||
| 444 | } | 447 | } |
| 445 | 448 | ||
| 446 | static void sl_tx_timeout(struct net_device *dev) | 449 | static void sl_tx_timeout(struct net_device *dev) |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 2dbb9460349d..c6867f926cff 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
| @@ -303,7 +303,7 @@ static void dm9601_set_multicast(struct net_device *net) | |||
| 303 | rx_ctl |= 0x02; | 303 | rx_ctl |= 0x02; |
| 304 | } else if (net->flags & IFF_ALLMULTI || | 304 | } else if (net->flags & IFF_ALLMULTI || |
| 305 | netdev_mc_count(net) > DM_MAX_MCAST) { | 305 | netdev_mc_count(net) > DM_MAX_MCAST) { |
| 306 | rx_ctl |= 0x04; | 306 | rx_ctl |= 0x08; |
| 307 | } else if (!netdev_mc_empty(net)) { | 307 | } else if (!netdev_mc_empty(net)) { |
| 308 | struct netdev_hw_addr *ha; | 308 | struct netdev_hw_addr *ha; |
| 309 | 309 | ||
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 6312332afeba..3d6aaf79d8b2 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -714,7 +714,7 @@ static const struct usb_device_id products[] = { | |||
| 714 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ | 714 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ |
| 715 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ | 715 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ |
| 716 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ | 716 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ |
| 717 | {QMI_FIXED_INTF(0x1e2d, 0x12d1, 4)}, /* Cinterion PLxx */ | 717 | {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ |
| 718 | 718 | ||
| 719 | /* 4. Gobi 1000 devices */ | 719 | /* 4. Gobi 1000 devices */ |
| 720 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 720 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 7b331e613e02..bf94e10a37c8 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -1241,7 +1241,9 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) | |||
| 1241 | if (num_sgs == 1) | 1241 | if (num_sgs == 1) |
| 1242 | return 0; | 1242 | return 0; |
| 1243 | 1243 | ||
| 1244 | urb->sg = kmalloc(num_sgs * sizeof(struct scatterlist), GFP_ATOMIC); | 1244 | /* reserve one for zero packet */ |
| 1245 | urb->sg = kmalloc((num_sgs + 1) * sizeof(struct scatterlist), | ||
| 1246 | GFP_ATOMIC); | ||
| 1245 | if (!urb->sg) | 1247 | if (!urb->sg) |
| 1246 | return -ENOMEM; | 1248 | return -ENOMEM; |
| 1247 | 1249 | ||
| @@ -1305,7 +1307,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
| 1305 | if (build_dma_sg(skb, urb) < 0) | 1307 | if (build_dma_sg(skb, urb) < 0) |
| 1306 | goto drop; | 1308 | goto drop; |
| 1307 | } | 1309 | } |
| 1308 | entry->length = length = urb->transfer_buffer_length; | 1310 | length = urb->transfer_buffer_length; |
| 1309 | 1311 | ||
| 1310 | /* don't assume the hardware handles USB_ZERO_PACKET | 1312 | /* don't assume the hardware handles USB_ZERO_PACKET |
| 1311 | * NOTE: strictly conforming cdc-ether devices should expect | 1313 | * NOTE: strictly conforming cdc-ether devices should expect |
| @@ -1317,15 +1319,18 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
| 1317 | if (length % dev->maxpacket == 0) { | 1319 | if (length % dev->maxpacket == 0) { |
| 1318 | if (!(info->flags & FLAG_SEND_ZLP)) { | 1320 | if (!(info->flags & FLAG_SEND_ZLP)) { |
| 1319 | if (!(info->flags & FLAG_MULTI_PACKET)) { | 1321 | if (!(info->flags & FLAG_MULTI_PACKET)) { |
| 1320 | urb->transfer_buffer_length++; | 1322 | length++; |
| 1321 | if (skb_tailroom(skb)) { | 1323 | if (skb_tailroom(skb) && !urb->num_sgs) { |
| 1322 | skb->data[skb->len] = 0; | 1324 | skb->data[skb->len] = 0; |
| 1323 | __skb_put(skb, 1); | 1325 | __skb_put(skb, 1); |
| 1324 | } | 1326 | } else if (urb->num_sgs) |
| 1327 | sg_set_buf(&urb->sg[urb->num_sgs++], | ||
| 1328 | dev->padding_pkt, 1); | ||
| 1325 | } | 1329 | } |
| 1326 | } else | 1330 | } else |
| 1327 | urb->transfer_flags |= URB_ZERO_PACKET; | 1331 | urb->transfer_flags |= URB_ZERO_PACKET; |
| 1328 | } | 1332 | } |
| 1333 | entry->length = urb->transfer_buffer_length = length; | ||
| 1329 | 1334 | ||
| 1330 | spin_lock_irqsave(&dev->txq.lock, flags); | 1335 | spin_lock_irqsave(&dev->txq.lock, flags); |
| 1331 | retval = usb_autopm_get_interface_async(dev->intf); | 1336 | retval = usb_autopm_get_interface_async(dev->intf); |
| @@ -1509,6 +1514,7 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
| 1509 | 1514 | ||
| 1510 | usb_kill_urb(dev->interrupt); | 1515 | usb_kill_urb(dev->interrupt); |
| 1511 | usb_free_urb(dev->interrupt); | 1516 | usb_free_urb(dev->interrupt); |
| 1517 | kfree(dev->padding_pkt); | ||
| 1512 | 1518 | ||
| 1513 | free_netdev(net); | 1519 | free_netdev(net); |
| 1514 | } | 1520 | } |
| @@ -1679,9 +1685,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
| 1679 | /* initialize max rx_qlen and tx_qlen */ | 1685 | /* initialize max rx_qlen and tx_qlen */ |
| 1680 | usbnet_update_max_qlen(dev); | 1686 | usbnet_update_max_qlen(dev); |
| 1681 | 1687 | ||
| 1688 | if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) && | ||
| 1689 | !(info->flags & FLAG_MULTI_PACKET)) { | ||
| 1690 | dev->padding_pkt = kzalloc(1, GFP_KERNEL); | ||
| 1691 | if (!dev->padding_pkt) | ||
| 1692 | goto out4; | ||
| 1693 | } | ||
| 1694 | |||
| 1682 | status = register_netdev (net); | 1695 | status = register_netdev (net); |
| 1683 | if (status) | 1696 | if (status) |
| 1684 | goto out4; | 1697 | goto out5; |
| 1685 | netif_info(dev, probe, dev->net, | 1698 | netif_info(dev, probe, dev->net, |
| 1686 | "register '%s' at usb-%s-%s, %s, %pM\n", | 1699 | "register '%s' at usb-%s-%s, %s, %pM\n", |
| 1687 | udev->dev.driver->name, | 1700 | udev->dev.driver->name, |
| @@ -1699,6 +1712,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
| 1699 | 1712 | ||
| 1700 | return 0; | 1713 | return 0; |
| 1701 | 1714 | ||
| 1715 | out5: | ||
| 1716 | kfree(dev->padding_pkt); | ||
| 1702 | out4: | 1717 | out4: |
| 1703 | usb_free_urb(dev->interrupt); | 1718 | usb_free_urb(dev->interrupt); |
| 1704 | out3: | 1719 | out3: |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index d1292fe746bc..2ef5b6219f3f 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
| @@ -952,8 +952,7 @@ void vxlan_sock_release(struct vxlan_sock *vs) | |||
| 952 | 952 | ||
| 953 | spin_lock(&vn->sock_lock); | 953 | spin_lock(&vn->sock_lock); |
| 954 | hlist_del_rcu(&vs->hlist); | 954 | hlist_del_rcu(&vs->hlist); |
| 955 | smp_wmb(); | 955 | rcu_assign_sk_user_data(vs->sock->sk, NULL); |
| 956 | vs->sock->sk->sk_user_data = NULL; | ||
| 957 | vxlan_notify_del_rx_port(sk); | 956 | vxlan_notify_del_rx_port(sk); |
| 958 | spin_unlock(&vn->sock_lock); | 957 | spin_unlock(&vn->sock_lock); |
| 959 | 958 | ||
| @@ -1048,8 +1047,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) | |||
| 1048 | 1047 | ||
| 1049 | port = inet_sk(sk)->inet_sport; | 1048 | port = inet_sk(sk)->inet_sport; |
| 1050 | 1049 | ||
| 1051 | smp_read_barrier_depends(); | 1050 | vs = rcu_dereference_sk_user_data(sk); |
| 1052 | vs = (struct vxlan_sock *)sk->sk_user_data; | ||
| 1053 | if (!vs) | 1051 | if (!vs) |
| 1054 | goto drop; | 1052 | goto drop; |
| 1055 | 1053 | ||
| @@ -2302,8 +2300,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, __be16 port, | |||
| 2302 | atomic_set(&vs->refcnt, 1); | 2300 | atomic_set(&vs->refcnt, 1); |
| 2303 | vs->rcv = rcv; | 2301 | vs->rcv = rcv; |
| 2304 | vs->data = data; | 2302 | vs->data = data; |
| 2305 | smp_wmb(); | 2303 | rcu_assign_sk_user_data(vs->sock->sk, vs); |
| 2306 | vs->sock->sk->sk_user_data = vs; | ||
| 2307 | 2304 | ||
| 2308 | spin_lock(&vn->sock_lock); | 2305 | spin_lock(&vn->sock_lock); |
| 2309 | hlist_add_head_rcu(&vs->hlist, vs_head(net, port)); | 2306 | hlist_add_head_rcu(&vs->hlist, vs_head(net, port)); |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 4ee472a5a4e4..ab9e3a8410bc 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
| @@ -1270,13 +1270,6 @@ static void ath9k_antenna_check(struct ath_softc *sc, | |||
| 1270 | return; | 1270 | return; |
| 1271 | 1271 | ||
| 1272 | /* | 1272 | /* |
| 1273 | * All MPDUs in an aggregate will use the same LNA | ||
| 1274 | * as the first MPDU. | ||
| 1275 | */ | ||
| 1276 | if (rs->rs_isaggr && !rs->rs_firstaggr) | ||
| 1277 | return; | ||
| 1278 | |||
| 1279 | /* | ||
| 1280 | * Change the default rx antenna if rx diversity | 1273 | * Change the default rx antenna if rx diversity |
| 1281 | * chooses the other antenna 3 times in a row. | 1274 | * chooses the other antenna 3 times in a row. |
| 1282 | */ | 1275 | */ |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 35b515fe3ffa..5ac713d2ff5d 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
| @@ -399,6 +399,7 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) | |||
| 399 | tbf->bf_buf_addr = bf->bf_buf_addr; | 399 | tbf->bf_buf_addr = bf->bf_buf_addr; |
| 400 | memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); | 400 | memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); |
| 401 | tbf->bf_state = bf->bf_state; | 401 | tbf->bf_state = bf->bf_state; |
| 402 | tbf->bf_state.stale = false; | ||
| 402 | 403 | ||
| 403 | return tbf; | 404 | return tbf; |
| 404 | } | 405 | } |
| @@ -1389,11 +1390,15 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
| 1389 | u16 tid, u16 *ssn) | 1390 | u16 tid, u16 *ssn) |
| 1390 | { | 1391 | { |
| 1391 | struct ath_atx_tid *txtid; | 1392 | struct ath_atx_tid *txtid; |
| 1393 | struct ath_txq *txq; | ||
| 1392 | struct ath_node *an; | 1394 | struct ath_node *an; |
| 1393 | u8 density; | 1395 | u8 density; |
| 1394 | 1396 | ||
| 1395 | an = (struct ath_node *)sta->drv_priv; | 1397 | an = (struct ath_node *)sta->drv_priv; |
| 1396 | txtid = ATH_AN_2_TID(an, tid); | 1398 | txtid = ATH_AN_2_TID(an, tid); |
| 1399 | txq = txtid->ac->txq; | ||
| 1400 | |||
| 1401 | ath_txq_lock(sc, txq); | ||
| 1397 | 1402 | ||
| 1398 | /* update ampdu factor/density, they may have changed. This may happen | 1403 | /* update ampdu factor/density, they may have changed. This may happen |
| 1399 | * in HT IBSS when a beacon with HT-info is received after the station | 1404 | * in HT IBSS when a beacon with HT-info is received after the station |
| @@ -1417,6 +1422,8 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
| 1417 | memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf)); | 1422 | memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf)); |
| 1418 | txtid->baw_head = txtid->baw_tail = 0; | 1423 | txtid->baw_head = txtid->baw_tail = 0; |
| 1419 | 1424 | ||
| 1425 | ath_txq_unlock_complete(sc, txq); | ||
| 1426 | |||
| 1420 | return 0; | 1427 | return 0; |
| 1421 | } | 1428 | } |
| 1422 | 1429 | ||
| @@ -1555,8 +1562,10 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw, | |||
| 1555 | __skb_unlink(bf->bf_mpdu, tid_q); | 1562 | __skb_unlink(bf->bf_mpdu, tid_q); |
| 1556 | list_add_tail(&bf->list, &bf_q); | 1563 | list_add_tail(&bf->list, &bf_q); |
| 1557 | ath_set_rates(tid->an->vif, tid->an->sta, bf); | 1564 | ath_set_rates(tid->an->vif, tid->an->sta, bf); |
| 1558 | ath_tx_addto_baw(sc, tid, bf); | 1565 | if (bf_isampdu(bf)) { |
| 1559 | bf->bf_state.bf_type &= ~BUF_AGGR; | 1566 | ath_tx_addto_baw(sc, tid, bf); |
| 1567 | bf->bf_state.bf_type &= ~BUF_AGGR; | ||
| 1568 | } | ||
| 1560 | if (bf_tail) | 1569 | if (bf_tail) |
| 1561 | bf_tail->bf_next = bf; | 1570 | bf_tail->bf_next = bf; |
| 1562 | 1571 | ||
| @@ -1950,7 +1959,9 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | |||
| 1950 | if (bf_is_ampdu_not_probing(bf)) | 1959 | if (bf_is_ampdu_not_probing(bf)) |
| 1951 | txq->axq_ampdu_depth++; | 1960 | txq->axq_ampdu_depth++; |
| 1952 | 1961 | ||
| 1953 | bf = bf->bf_lastbf->bf_next; | 1962 | bf_last = bf->bf_lastbf; |
| 1963 | bf = bf_last->bf_next; | ||
| 1964 | bf_last->bf_next = NULL; | ||
| 1954 | } | 1965 | } |
| 1955 | } | 1966 | } |
| 1956 | } | 1967 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 64f4a2bc8dde..c3462b75bd08 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | |||
| @@ -464,8 +464,6 @@ static struct sdio_driver brcmf_sdmmc_driver = { | |||
| 464 | 464 | ||
| 465 | static int brcmf_sdio_pd_probe(struct platform_device *pdev) | 465 | static int brcmf_sdio_pd_probe(struct platform_device *pdev) |
| 466 | { | 466 | { |
| 467 | int ret; | ||
| 468 | |||
| 469 | brcmf_dbg(SDIO, "Enter\n"); | 467 | brcmf_dbg(SDIO, "Enter\n"); |
| 470 | 468 | ||
| 471 | brcmfmac_sdio_pdata = pdev->dev.platform_data; | 469 | brcmfmac_sdio_pdata = pdev->dev.platform_data; |
| @@ -473,11 +471,7 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev) | |||
| 473 | if (brcmfmac_sdio_pdata->power_on) | 471 | if (brcmfmac_sdio_pdata->power_on) |
| 474 | brcmfmac_sdio_pdata->power_on(); | 472 | brcmfmac_sdio_pdata->power_on(); |
| 475 | 473 | ||
| 476 | ret = sdio_register_driver(&brcmf_sdmmc_driver); | 474 | return 0; |
| 477 | if (ret) | ||
| 478 | brcmf_err("sdio_register_driver failed: %d\n", ret); | ||
| 479 | |||
| 480 | return ret; | ||
| 481 | } | 475 | } |
| 482 | 476 | ||
| 483 | static int brcmf_sdio_pd_remove(struct platform_device *pdev) | 477 | static int brcmf_sdio_pd_remove(struct platform_device *pdev) |
| @@ -500,6 +494,15 @@ static struct platform_driver brcmf_sdio_pd = { | |||
| 500 | } | 494 | } |
| 501 | }; | 495 | }; |
| 502 | 496 | ||
| 497 | void brcmf_sdio_register(void) | ||
| 498 | { | ||
| 499 | int ret; | ||
| 500 | |||
| 501 | ret = sdio_register_driver(&brcmf_sdmmc_driver); | ||
| 502 | if (ret) | ||
| 503 | brcmf_err("sdio_register_driver failed: %d\n", ret); | ||
| 504 | } | ||
| 505 | |||
| 503 | void brcmf_sdio_exit(void) | 506 | void brcmf_sdio_exit(void) |
| 504 | { | 507 | { |
| 505 | brcmf_dbg(SDIO, "Enter\n"); | 508 | brcmf_dbg(SDIO, "Enter\n"); |
| @@ -510,18 +513,13 @@ void brcmf_sdio_exit(void) | |||
| 510 | sdio_unregister_driver(&brcmf_sdmmc_driver); | 513 | sdio_unregister_driver(&brcmf_sdmmc_driver); |
| 511 | } | 514 | } |
| 512 | 515 | ||
| 513 | void brcmf_sdio_init(void) | 516 | void __init brcmf_sdio_init(void) |
| 514 | { | 517 | { |
| 515 | int ret; | 518 | int ret; |
| 516 | 519 | ||
| 517 | brcmf_dbg(SDIO, "Enter\n"); | 520 | brcmf_dbg(SDIO, "Enter\n"); |
| 518 | 521 | ||
| 519 | ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe); | 522 | ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe); |
| 520 | if (ret == -ENODEV) { | 523 | if (ret == -ENODEV) |
| 521 | brcmf_dbg(SDIO, "No platform data available, registering without.\n"); | 524 | brcmf_dbg(SDIO, "No platform data available.\n"); |
| 522 | ret = sdio_register_driver(&brcmf_sdmmc_driver); | ||
| 523 | } | ||
| 524 | |||
| 525 | if (ret) | ||
| 526 | brcmf_err("driver registration failed: %d\n", ret); | ||
| 527 | } | 525 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h index f7c1985844e4..74156f84180c 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | |||
| @@ -156,10 +156,11 @@ extern int brcmf_bus_start(struct device *dev); | |||
| 156 | #ifdef CONFIG_BRCMFMAC_SDIO | 156 | #ifdef CONFIG_BRCMFMAC_SDIO |
| 157 | extern void brcmf_sdio_exit(void); | 157 | extern void brcmf_sdio_exit(void); |
| 158 | extern void brcmf_sdio_init(void); | 158 | extern void brcmf_sdio_init(void); |
| 159 | extern void brcmf_sdio_register(void); | ||
| 159 | #endif | 160 | #endif |
| 160 | #ifdef CONFIG_BRCMFMAC_USB | 161 | #ifdef CONFIG_BRCMFMAC_USB |
| 161 | extern void brcmf_usb_exit(void); | 162 | extern void brcmf_usb_exit(void); |
| 162 | extern void brcmf_usb_init(void); | 163 | extern void brcmf_usb_register(void); |
| 163 | #endif | 164 | #endif |
| 164 | 165 | ||
| 165 | #endif /* _BRCMF_BUS_H_ */ | 166 | #endif /* _BRCMF_BUS_H_ */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index e067aec1fbf1..40e7f854e10f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
| @@ -1231,21 +1231,23 @@ u32 brcmf_get_chip_info(struct brcmf_if *ifp) | |||
| 1231 | return bus->chip << 4 | bus->chiprev; | 1231 | return bus->chip << 4 | bus->chiprev; |
| 1232 | } | 1232 | } |
| 1233 | 1233 | ||
| 1234 | static void brcmf_driver_init(struct work_struct *work) | 1234 | static void brcmf_driver_register(struct work_struct *work) |
| 1235 | { | 1235 | { |
| 1236 | brcmf_debugfs_init(); | ||
| 1237 | |||
| 1238 | #ifdef CONFIG_BRCMFMAC_SDIO | 1236 | #ifdef CONFIG_BRCMFMAC_SDIO |
| 1239 | brcmf_sdio_init(); | 1237 | brcmf_sdio_register(); |
| 1240 | #endif | 1238 | #endif |
| 1241 | #ifdef CONFIG_BRCMFMAC_USB | 1239 | #ifdef CONFIG_BRCMFMAC_USB |
| 1242 | brcmf_usb_init(); | 1240 | brcmf_usb_register(); |
| 1243 | #endif | 1241 | #endif |
| 1244 | } | 1242 | } |
| 1245 | static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init); | 1243 | static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register); |
| 1246 | 1244 | ||
| 1247 | static int __init brcmfmac_module_init(void) | 1245 | static int __init brcmfmac_module_init(void) |
| 1248 | { | 1246 | { |
| 1247 | brcmf_debugfs_init(); | ||
| 1248 | #ifdef CONFIG_BRCMFMAC_SDIO | ||
| 1249 | brcmf_sdio_init(); | ||
| 1250 | #endif | ||
| 1249 | if (!schedule_work(&brcmf_driver_work)) | 1251 | if (!schedule_work(&brcmf_driver_work)) |
| 1250 | return -EBUSY; | 1252 | return -EBUSY; |
| 1251 | 1253 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index 39e01a7c8556..f4aea47e0730 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c | |||
| @@ -1539,7 +1539,7 @@ void brcmf_usb_exit(void) | |||
| 1539 | brcmf_release_fw(&fw_image_list); | 1539 | brcmf_release_fw(&fw_image_list); |
| 1540 | } | 1540 | } |
| 1541 | 1541 | ||
| 1542 | void brcmf_usb_init(void) | 1542 | void brcmf_usb_register(void) |
| 1543 | { | 1543 | { |
| 1544 | brcmf_dbg(USB, "Enter\n"); | 1544 | brcmf_dbg(USB, "Enter\n"); |
| 1545 | INIT_LIST_HEAD(&fw_image_list); | 1545 | INIT_LIST_HEAD(&fw_image_list); |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index 3a6544710c8a..edc5d105ff98 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
| @@ -457,6 +457,8 @@ static int brcms_ops_start(struct ieee80211_hw *hw) | |||
| 457 | if (err != 0) | 457 | if (err != 0) |
| 458 | brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n", | 458 | brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n", |
| 459 | __func__, err); | 459 | __func__, err); |
| 460 | |||
| 461 | bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, true); | ||
| 460 | return err; | 462 | return err; |
| 461 | } | 463 | } |
| 462 | 464 | ||
| @@ -479,6 +481,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw) | |||
| 479 | return; | 481 | return; |
| 480 | } | 482 | } |
| 481 | 483 | ||
| 484 | bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, false); | ||
| 485 | |||
| 482 | /* put driver in down state */ | 486 | /* put driver in down state */ |
| 483 | spin_lock_bh(&wl->lock); | 487 | spin_lock_bh(&wl->lock); |
| 484 | brcms_down(wl); | 488 | brcms_down(wl); |
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index f5e6b489ed32..899cad34ccd3 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
| @@ -42,7 +42,6 @@ struct hwbus_priv { | |||
| 42 | spinlock_t lock; /* Serialize all bus operations */ | 42 | spinlock_t lock; /* Serialize all bus operations */ |
| 43 | wait_queue_head_t wq; | 43 | wait_queue_head_t wq; |
| 44 | int claimed; | 44 | int claimed; |
| 45 | int irq_disabled; | ||
| 46 | }; | 45 | }; |
| 47 | 46 | ||
| 48 | #define SDIO_TO_SPI_ADDR(addr) ((addr & 0x1f)>>2) | 47 | #define SDIO_TO_SPI_ADDR(addr) ((addr & 0x1f)>>2) |
| @@ -238,8 +237,6 @@ static irqreturn_t cw1200_spi_irq_handler(int irq, void *dev_id) | |||
| 238 | struct hwbus_priv *self = dev_id; | 237 | struct hwbus_priv *self = dev_id; |
| 239 | 238 | ||
| 240 | if (self->core) { | 239 | if (self->core) { |
| 241 | disable_irq_nosync(self->func->irq); | ||
| 242 | self->irq_disabled = 1; | ||
| 243 | cw1200_irq_handler(self->core); | 240 | cw1200_irq_handler(self->core); |
| 244 | return IRQ_HANDLED; | 241 | return IRQ_HANDLED; |
| 245 | } else { | 242 | } else { |
| @@ -253,9 +250,10 @@ static int cw1200_spi_irq_subscribe(struct hwbus_priv *self) | |||
| 253 | 250 | ||
| 254 | pr_debug("SW IRQ subscribe\n"); | 251 | pr_debug("SW IRQ subscribe\n"); |
| 255 | 252 | ||
| 256 | ret = request_any_context_irq(self->func->irq, cw1200_spi_irq_handler, | 253 | ret = request_threaded_irq(self->func->irq, NULL, |
| 257 | IRQF_TRIGGER_HIGH, | 254 | cw1200_spi_irq_handler, |
| 258 | "cw1200_wlan_irq", self); | 255 | IRQF_TRIGGER_HIGH | IRQF_ONESHOT, |
| 256 | "cw1200_wlan_irq", self); | ||
| 259 | if (WARN_ON(ret < 0)) | 257 | if (WARN_ON(ret < 0)) |
| 260 | goto exit; | 258 | goto exit; |
| 261 | 259 | ||
| @@ -273,22 +271,13 @@ exit: | |||
| 273 | 271 | ||
| 274 | static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self) | 272 | static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self) |
| 275 | { | 273 | { |
| 274 | int ret = 0; | ||
| 275 | |||
| 276 | pr_debug("SW IRQ unsubscribe\n"); | 276 | pr_debug("SW IRQ unsubscribe\n"); |
| 277 | disable_irq_wake(self->func->irq); | 277 | disable_irq_wake(self->func->irq); |
| 278 | free_irq(self->func->irq, self); | 278 | free_irq(self->func->irq, self); |
| 279 | 279 | ||
| 280 | return 0; | 280 | return ret; |
| 281 | } | ||
| 282 | |||
| 283 | static int cw1200_spi_irq_enable(struct hwbus_priv *self, int enable) | ||
| 284 | { | ||
| 285 | /* Disables are handled by the interrupt handler */ | ||
| 286 | if (enable && self->irq_disabled) { | ||
| 287 | enable_irq(self->func->irq); | ||
| 288 | self->irq_disabled = 0; | ||
| 289 | } | ||
| 290 | |||
| 291 | return 0; | ||
| 292 | } | 281 | } |
| 293 | 282 | ||
| 294 | static int cw1200_spi_off(const struct cw1200_platform_data_spi *pdata) | 283 | static int cw1200_spi_off(const struct cw1200_platform_data_spi *pdata) |
| @@ -368,7 +357,6 @@ static struct hwbus_ops cw1200_spi_hwbus_ops = { | |||
| 368 | .unlock = cw1200_spi_unlock, | 357 | .unlock = cw1200_spi_unlock, |
| 369 | .align_size = cw1200_spi_align_size, | 358 | .align_size = cw1200_spi_align_size, |
| 370 | .power_mgmt = cw1200_spi_pm, | 359 | .power_mgmt = cw1200_spi_pm, |
| 371 | .irq_enable = cw1200_spi_irq_enable, | ||
| 372 | }; | 360 | }; |
| 373 | 361 | ||
| 374 | /* Probe Function to be called by SPI stack when device is discovered */ | 362 | /* Probe Function to be called by SPI stack when device is discovered */ |
diff --git a/drivers/net/wireless/cw1200/fwio.c b/drivers/net/wireless/cw1200/fwio.c index 0b2061bbc68b..acdff0f7f952 100644 --- a/drivers/net/wireless/cw1200/fwio.c +++ b/drivers/net/wireless/cw1200/fwio.c | |||
| @@ -485,7 +485,7 @@ int cw1200_load_firmware(struct cw1200_common *priv) | |||
| 485 | 485 | ||
| 486 | /* Enable interrupt signalling */ | 486 | /* Enable interrupt signalling */ |
| 487 | priv->hwbus_ops->lock(priv->hwbus_priv); | 487 | priv->hwbus_ops->lock(priv->hwbus_priv); |
| 488 | ret = __cw1200_irq_enable(priv, 2); | 488 | ret = __cw1200_irq_enable(priv, 1); |
| 489 | priv->hwbus_ops->unlock(priv->hwbus_priv); | 489 | priv->hwbus_ops->unlock(priv->hwbus_priv); |
| 490 | if (ret < 0) | 490 | if (ret < 0) |
| 491 | goto unsubscribe; | 491 | goto unsubscribe; |
diff --git a/drivers/net/wireless/cw1200/hwbus.h b/drivers/net/wireless/cw1200/hwbus.h index 51dfb3a90735..8b2fc831c3de 100644 --- a/drivers/net/wireless/cw1200/hwbus.h +++ b/drivers/net/wireless/cw1200/hwbus.h | |||
| @@ -28,7 +28,6 @@ struct hwbus_ops { | |||
| 28 | void (*unlock)(struct hwbus_priv *self); | 28 | void (*unlock)(struct hwbus_priv *self); |
| 29 | size_t (*align_size)(struct hwbus_priv *self, size_t size); | 29 | size_t (*align_size)(struct hwbus_priv *self, size_t size); |
| 30 | int (*power_mgmt)(struct hwbus_priv *self, bool suspend); | 30 | int (*power_mgmt)(struct hwbus_priv *self, bool suspend); |
| 31 | int (*irq_enable)(struct hwbus_priv *self, int enable); | ||
| 32 | }; | 31 | }; |
| 33 | 32 | ||
| 34 | #endif /* CW1200_HWBUS_H */ | 33 | #endif /* CW1200_HWBUS_H */ |
diff --git a/drivers/net/wireless/cw1200/hwio.c b/drivers/net/wireless/cw1200/hwio.c index 41bd7615ccaa..ff230b7aeedd 100644 --- a/drivers/net/wireless/cw1200/hwio.c +++ b/drivers/net/wireless/cw1200/hwio.c | |||
| @@ -273,21 +273,6 @@ int __cw1200_irq_enable(struct cw1200_common *priv, int enable) | |||
| 273 | u16 val16; | 273 | u16 val16; |
| 274 | int ret; | 274 | int ret; |
| 275 | 275 | ||
| 276 | /* We need to do this hack because the SPI layer can sleep on I/O | ||
| 277 | and the general path involves I/O to the device in interrupt | ||
| 278 | context. | ||
| 279 | |||
| 280 | However, the initial enable call needs to go to the hardware. | ||
| 281 | |||
| 282 | We don't worry about shutdown because we do a full reset which | ||
| 283 | clears the interrupt enabled bits. | ||
| 284 | */ | ||
| 285 | if (priv->hwbus_ops->irq_enable) { | ||
| 286 | ret = priv->hwbus_ops->irq_enable(priv->hwbus_priv, enable); | ||
| 287 | if (ret || enable < 2) | ||
| 288 | return ret; | ||
| 289 | } | ||
| 290 | |||
| 291 | if (HIF_8601_SILICON == priv->hw_type) { | 276 | if (HIF_8601_SILICON == priv->hw_type) { |
| 292 | ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32); | 277 | ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32); |
| 293 | if (ret < 0) { | 278 | if (ret < 0) { |
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c index 21c688264708..1214c587fd08 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.c +++ b/drivers/net/wireless/mwifiex/11n_aggr.c | |||
| @@ -150,7 +150,7 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv, | |||
| 150 | */ | 150 | */ |
| 151 | int | 151 | int |
| 152 | mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | 152 | mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, |
| 153 | struct mwifiex_ra_list_tbl *pra_list, int headroom, | 153 | struct mwifiex_ra_list_tbl *pra_list, |
| 154 | int ptrindex, unsigned long ra_list_flags) | 154 | int ptrindex, unsigned long ra_list_flags) |
| 155 | __releases(&priv->wmm.ra_list_spinlock) | 155 | __releases(&priv->wmm.ra_list_spinlock) |
| 156 | { | 156 | { |
| @@ -160,6 +160,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
| 160 | int pad = 0, ret; | 160 | int pad = 0, ret; |
| 161 | struct mwifiex_tx_param tx_param; | 161 | struct mwifiex_tx_param tx_param; |
| 162 | struct txpd *ptx_pd = NULL; | 162 | struct txpd *ptx_pd = NULL; |
| 163 | int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN; | ||
| 163 | 164 | ||
| 164 | skb_src = skb_peek(&pra_list->skb_head); | 165 | skb_src = skb_peek(&pra_list->skb_head); |
| 165 | if (!skb_src) { | 166 | if (!skb_src) { |
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.h b/drivers/net/wireless/mwifiex/11n_aggr.h index 900e1c62a0cc..892098d6a696 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.h +++ b/drivers/net/wireless/mwifiex/11n_aggr.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, | 26 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, |
| 27 | struct sk_buff *skb); | 27 | struct sk_buff *skb); |
| 28 | int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | 28 | int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, |
| 29 | struct mwifiex_ra_list_tbl *ptr, int headroom, | 29 | struct mwifiex_ra_list_tbl *ptr, |
| 30 | int ptr_index, unsigned long flags) | 30 | int ptr_index, unsigned long flags) |
| 31 | __releases(&priv->wmm.ra_list_spinlock); | 31 | __releases(&priv->wmm.ra_list_spinlock); |
| 32 | 32 | ||
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 2d761477d15e..a6c46f3b6e3a 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
| @@ -1155,7 +1155,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, | |||
| 1155 | uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions); | 1155 | uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions); |
| 1156 | 1156 | ||
| 1157 | if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) && | 1157 | if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) && |
| 1158 | adapter->iface_type == MWIFIEX_SDIO) { | 1158 | adapter->iface_type != MWIFIEX_USB) { |
| 1159 | mwifiex_hs_activated_event(priv, true); | 1159 | mwifiex_hs_activated_event(priv, true); |
| 1160 | return 0; | 1160 | return 0; |
| 1161 | } else { | 1161 | } else { |
| @@ -1167,8 +1167,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, | |||
| 1167 | } | 1167 | } |
| 1168 | if (conditions != HS_CFG_CANCEL) { | 1168 | if (conditions != HS_CFG_CANCEL) { |
| 1169 | adapter->is_hs_configured = true; | 1169 | adapter->is_hs_configured = true; |
| 1170 | if (adapter->iface_type == MWIFIEX_USB || | 1170 | if (adapter->iface_type == MWIFIEX_USB) |
| 1171 | adapter->iface_type == MWIFIEX_PCIE) | ||
| 1172 | mwifiex_hs_activated_event(priv, true); | 1171 | mwifiex_hs_activated_event(priv, true); |
| 1173 | } else { | 1172 | } else { |
| 1174 | adapter->is_hs_configured = false; | 1173 | adapter->is_hs_configured = false; |
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index 2472d4b7f00e..1c70b8d09227 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c | |||
| @@ -447,9 +447,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
| 447 | */ | 447 | */ |
| 448 | adapter->is_suspended = true; | 448 | adapter->is_suspended = true; |
| 449 | 449 | ||
| 450 | for (i = 0; i < adapter->priv_num; i++) | ||
| 451 | netif_carrier_off(adapter->priv[i]->netdev); | ||
| 452 | |||
| 453 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) | 450 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) |
| 454 | usb_kill_urb(card->rx_cmd.urb); | 451 | usb_kill_urb(card->rx_cmd.urb); |
| 455 | 452 | ||
| @@ -509,10 +506,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf) | |||
| 509 | MWIFIEX_RX_CMD_BUF_SIZE); | 506 | MWIFIEX_RX_CMD_BUF_SIZE); |
| 510 | } | 507 | } |
| 511 | 508 | ||
| 512 | for (i = 0; i < adapter->priv_num; i++) | ||
| 513 | if (adapter->priv[i]->media_connected) | ||
| 514 | netif_carrier_on(adapter->priv[i]->netdev); | ||
| 515 | |||
| 516 | /* Disable Host Sleep */ | 509 | /* Disable Host Sleep */ |
| 517 | if (adapter->hs_activated) | 510 | if (adapter->hs_activated) |
| 518 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, | 511 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, |
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index 2e8f9cdea54d..95fa3599b407 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
| @@ -1239,8 +1239,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) | |||
| 1239 | if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) && | 1239 | if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) && |
| 1240 | mwifiex_is_11n_aggragation_possible(priv, ptr, | 1240 | mwifiex_is_11n_aggragation_possible(priv, ptr, |
| 1241 | adapter->tx_buf_size)) | 1241 | adapter->tx_buf_size)) |
| 1242 | mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN, | 1242 | mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags); |
| 1243 | ptr_index, flags); | ||
| 1244 | /* ra_list_spinlock has been freed in | 1243 | /* ra_list_spinlock has been freed in |
| 1245 | mwifiex_11n_aggregate_pkt() */ | 1244 | mwifiex_11n_aggregate_pkt() */ |
| 1246 | else | 1245 | else |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index b9deef66cf4b..e328d3058c41 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
| @@ -83,6 +83,7 @@ static struct usb_device_id p54u_table[] = { | |||
| 83 | {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ | 83 | {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ |
| 84 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ | 84 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ |
| 85 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ | 85 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
| 86 | {USB_DEVICE(0x07aa, 0x0020)}, /* Corega WLUSB2GTST USB */ | ||
| 86 | {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ | 87 | {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ |
| 87 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ | 88 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
| 88 | {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */ | 89 | {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */ |
| @@ -979,6 +980,7 @@ static int p54u_load_firmware(struct ieee80211_hw *dev, | |||
| 979 | if (err) { | 980 | if (err) { |
| 980 | dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " | 981 | dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " |
| 981 | "(%d)!\n", p54u_fwlist[i].fw, err); | 982 | "(%d)!\n", p54u_fwlist[i].fw, err); |
| 983 | usb_put_dev(udev); | ||
| 982 | } | 984 | } |
| 983 | 985 | ||
| 984 | return err; | 986 | return err; |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index cc03e7c87cbe..703258742d28 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
| @@ -2057,7 +2057,7 @@ struct rtl_priv { | |||
| 2057 | that it points to the data allocated | 2057 | that it points to the data allocated |
| 2058 | beyond this structure like: | 2058 | beyond this structure like: |
| 2059 | rtl_pci_priv or rtl_usb_priv */ | 2059 | rtl_pci_priv or rtl_usb_priv */ |
| 2060 | u8 priv[0]; | 2060 | u8 priv[0] __aligned(sizeof(void *)); |
| 2061 | }; | 2061 | }; |
| 2062 | 2062 | ||
| 2063 | #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv)) | 2063 | #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv)) |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index a53782ef1540..b45bce20ad76 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
| @@ -24,6 +24,12 @@ | |||
| 24 | struct backend_info { | 24 | struct backend_info { |
| 25 | struct xenbus_device *dev; | 25 | struct xenbus_device *dev; |
| 26 | struct xenvif *vif; | 26 | struct xenvif *vif; |
| 27 | |||
| 28 | /* This is the state that will be reflected in xenstore when any | ||
| 29 | * active hotplug script completes. | ||
| 30 | */ | ||
| 31 | enum xenbus_state state; | ||
| 32 | |||
| 27 | enum xenbus_state frontend_state; | 33 | enum xenbus_state frontend_state; |
| 28 | struct xenbus_watch hotplug_status_watch; | 34 | struct xenbus_watch hotplug_status_watch; |
| 29 | u8 have_hotplug_status_watch:1; | 35 | u8 have_hotplug_status_watch:1; |
| @@ -136,6 +142,8 @@ static int netback_probe(struct xenbus_device *dev, | |||
| 136 | if (err) | 142 | if (err) |
| 137 | goto fail; | 143 | goto fail; |
| 138 | 144 | ||
| 145 | be->state = XenbusStateInitWait; | ||
| 146 | |||
| 139 | /* This kicks hotplug scripts, so do it immediately. */ | 147 | /* This kicks hotplug scripts, so do it immediately. */ |
| 140 | backend_create_xenvif(be); | 148 | backend_create_xenvif(be); |
| 141 | 149 | ||
| @@ -208,24 +216,113 @@ static void backend_create_xenvif(struct backend_info *be) | |||
| 208 | kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); | 216 | kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); |
| 209 | } | 217 | } |
| 210 | 218 | ||
| 211 | 219 | static void backend_disconnect(struct backend_info *be) | |
| 212 | static void disconnect_backend(struct xenbus_device *dev) | ||
| 213 | { | 220 | { |
| 214 | struct backend_info *be = dev_get_drvdata(&dev->dev); | ||
| 215 | |||
| 216 | if (be->vif) | 221 | if (be->vif) |
| 217 | xenvif_disconnect(be->vif); | 222 | xenvif_disconnect(be->vif); |
| 218 | } | 223 | } |
| 219 | 224 | ||
| 220 | static void destroy_backend(struct xenbus_device *dev) | 225 | static void backend_connect(struct backend_info *be) |
| 221 | { | 226 | { |
| 222 | struct backend_info *be = dev_get_drvdata(&dev->dev); | 227 | if (be->vif) |
| 228 | connect(be); | ||
| 229 | } | ||
| 223 | 230 | ||
| 224 | if (be->vif) { | 231 | static inline void backend_switch_state(struct backend_info *be, |
| 225 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); | 232 | enum xenbus_state state) |
| 226 | xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); | 233 | { |
| 227 | xenvif_free(be->vif); | 234 | struct xenbus_device *dev = be->dev; |
| 228 | be->vif = NULL; | 235 | |
| 236 | pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state)); | ||
| 237 | be->state = state; | ||
| 238 | |||
| 239 | /* If we are waiting for a hotplug script then defer the | ||
| 240 | * actual xenbus state change. | ||
| 241 | */ | ||
| 242 | if (!be->have_hotplug_status_watch) | ||
| 243 | xenbus_switch_state(dev, state); | ||
| 244 | } | ||
| 245 | |||
| 246 | /* Handle backend state transitions: | ||
| 247 | * | ||
| 248 | * The backend state starts in InitWait and the following transitions are | ||
| 249 | * allowed. | ||
| 250 | * | ||
| 251 | * InitWait -> Connected | ||
| 252 | * | ||
| 253 | * ^ \ | | ||
| 254 | * | \ | | ||
| 255 | * | \ | | ||
| 256 | * | \ | | ||
| 257 | * | \ | | ||
| 258 | * | \ | | ||
| 259 | * | V V | ||
| 260 | * | ||
| 261 | * Closed <-> Closing | ||
| 262 | * | ||
| 263 | * The state argument specifies the eventual state of the backend and the | ||
| 264 | * function transitions to that state via the shortest path. | ||
| 265 | */ | ||
| 266 | static void set_backend_state(struct backend_info *be, | ||
| 267 | enum xenbus_state state) | ||
| 268 | { | ||
| 269 | while (be->state != state) { | ||
| 270 | switch (be->state) { | ||
| 271 | case XenbusStateClosed: | ||
| 272 | switch (state) { | ||
| 273 | case XenbusStateInitWait: | ||
| 274 | case XenbusStateConnected: | ||
| 275 | pr_info("%s: prepare for reconnect\n", | ||
| 276 | be->dev->nodename); | ||
| 277 | backend_switch_state(be, XenbusStateInitWait); | ||
| 278 | break; | ||
| 279 | case XenbusStateClosing: | ||
| 280 | backend_switch_state(be, XenbusStateClosing); | ||
| 281 | break; | ||
| 282 | default: | ||
| 283 | BUG(); | ||
| 284 | } | ||
| 285 | break; | ||
| 286 | case XenbusStateInitWait: | ||
| 287 | switch (state) { | ||
| 288 | case XenbusStateConnected: | ||
| 289 | backend_connect(be); | ||
| 290 | backend_switch_state(be, XenbusStateConnected); | ||
| 291 | break; | ||
| 292 | case XenbusStateClosing: | ||
| 293 | case XenbusStateClosed: | ||
| 294 | backend_switch_state(be, XenbusStateClosing); | ||
| 295 | break; | ||
| 296 | default: | ||
| 297 | BUG(); | ||
| 298 | } | ||
| 299 | break; | ||
| 300 | case XenbusStateConnected: | ||
| 301 | switch (state) { | ||
| 302 | case XenbusStateInitWait: | ||
| 303 | case XenbusStateClosing: | ||
| 304 | case XenbusStateClosed: | ||
| 305 | backend_disconnect(be); | ||
| 306 | backend_switch_state(be, XenbusStateClosing); | ||
| 307 | break; | ||
| 308 | default: | ||
| 309 | BUG(); | ||
| 310 | } | ||
| 311 | break; | ||
| 312 | case XenbusStateClosing: | ||
| 313 | switch (state) { | ||
| 314 | case XenbusStateInitWait: | ||
| 315 | case XenbusStateConnected: | ||
| 316 | case XenbusStateClosed: | ||
| 317 | backend_switch_state(be, XenbusStateClosed); | ||
| 318 | break; | ||
| 319 | default: | ||
| 320 | BUG(); | ||
| 321 | } | ||
| 322 | break; | ||
| 323 | default: | ||
| 324 | BUG(); | ||
| 325 | } | ||
| 229 | } | 326 | } |
| 230 | } | 327 | } |
| 231 | 328 | ||
| @@ -237,40 +334,33 @@ static void frontend_changed(struct xenbus_device *dev, | |||
| 237 | { | 334 | { |
| 238 | struct backend_info *be = dev_get_drvdata(&dev->dev); | 335 | struct backend_info *be = dev_get_drvdata(&dev->dev); |
| 239 | 336 | ||
| 240 | pr_debug("frontend state %s\n", xenbus_strstate(frontend_state)); | 337 | pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state)); |
| 241 | 338 | ||
| 242 | be->frontend_state = frontend_state; | 339 | be->frontend_state = frontend_state; |
| 243 | 340 | ||
| 244 | switch (frontend_state) { | 341 | switch (frontend_state) { |
| 245 | case XenbusStateInitialising: | 342 | case XenbusStateInitialising: |
| 246 | if (dev->state == XenbusStateClosed) { | 343 | set_backend_state(be, XenbusStateInitWait); |
| 247 | pr_info("%s: prepare for reconnect\n", dev->nodename); | ||
| 248 | xenbus_switch_state(dev, XenbusStateInitWait); | ||
| 249 | } | ||
| 250 | break; | 344 | break; |
| 251 | 345 | ||
| 252 | case XenbusStateInitialised: | 346 | case XenbusStateInitialised: |
| 253 | break; | 347 | break; |
| 254 | 348 | ||
| 255 | case XenbusStateConnected: | 349 | case XenbusStateConnected: |
| 256 | if (dev->state == XenbusStateConnected) | 350 | set_backend_state(be, XenbusStateConnected); |
| 257 | break; | ||
| 258 | if (be->vif) | ||
| 259 | connect(be); | ||
| 260 | break; | 351 | break; |
| 261 | 352 | ||
| 262 | case XenbusStateClosing: | 353 | case XenbusStateClosing: |
| 263 | disconnect_backend(dev); | 354 | set_backend_state(be, XenbusStateClosing); |
| 264 | xenbus_switch_state(dev, XenbusStateClosing); | ||
| 265 | break; | 355 | break; |
| 266 | 356 | ||
| 267 | case XenbusStateClosed: | 357 | case XenbusStateClosed: |
| 268 | xenbus_switch_state(dev, XenbusStateClosed); | 358 | set_backend_state(be, XenbusStateClosed); |
| 269 | if (xenbus_dev_is_online(dev)) | 359 | if (xenbus_dev_is_online(dev)) |
| 270 | break; | 360 | break; |
| 271 | destroy_backend(dev); | ||
| 272 | /* fall through if not online */ | 361 | /* fall through if not online */ |
| 273 | case XenbusStateUnknown: | 362 | case XenbusStateUnknown: |
| 363 | set_backend_state(be, XenbusStateClosed); | ||
| 274 | device_unregister(&dev->dev); | 364 | device_unregister(&dev->dev); |
| 275 | break; | 365 | break; |
| 276 | 366 | ||
| @@ -363,7 +453,9 @@ static void hotplug_status_changed(struct xenbus_watch *watch, | |||
| 363 | if (IS_ERR(str)) | 453 | if (IS_ERR(str)) |
| 364 | return; | 454 | return; |
| 365 | if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) { | 455 | if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) { |
| 366 | xenbus_switch_state(be->dev, XenbusStateConnected); | 456 | /* Complete any pending state change */ |
| 457 | xenbus_switch_state(be->dev, be->state); | ||
| 458 | |||
| 367 | /* Not interested in this watch anymore. */ | 459 | /* Not interested in this watch anymore. */ |
| 368 | unregister_hotplug_status_watch(be); | 460 | unregister_hotplug_status_watch(be); |
| 369 | } | 461 | } |
| @@ -393,12 +485,8 @@ static void connect(struct backend_info *be) | |||
| 393 | err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, | 485 | err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, |
| 394 | hotplug_status_changed, | 486 | hotplug_status_changed, |
| 395 | "%s/%s", dev->nodename, "hotplug-status"); | 487 | "%s/%s", dev->nodename, "hotplug-status"); |
| 396 | if (err) { | 488 | if (!err) |
| 397 | /* Switch now, since we can't do a watch. */ | ||
| 398 | xenbus_switch_state(dev, XenbusStateConnected); | ||
| 399 | } else { | ||
| 400 | be->have_hotplug_status_watch = 1; | 489 | be->have_hotplug_status_watch = 1; |
| 401 | } | ||
| 402 | 490 | ||
| 403 | netif_wake_queue(be->vif->dev); | 491 | netif_wake_queue(be->vif->dev); |
| 404 | } | 492 | } |
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index a138965c01cb..b8fcc38c0d11 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c | |||
| @@ -490,7 +490,7 @@ exit: | |||
| 490 | * <devicename> <state> <pinname> are values that should match the pinctrl-maps | 490 | * <devicename> <state> <pinname> are values that should match the pinctrl-maps |
| 491 | * <newvalue> reflects the new config and is driver dependant | 491 | * <newvalue> reflects the new config and is driver dependant |
| 492 | */ | 492 | */ |
| 493 | static int pinconf_dbg_config_write(struct file *file, | 493 | static ssize_t pinconf_dbg_config_write(struct file *file, |
| 494 | const char __user *user_buf, size_t count, loff_t *ppos) | 494 | const char __user *user_buf, size_t count, loff_t *ppos) |
| 495 | { | 495 | { |
| 496 | struct pinctrl_maps *maps_node; | 496 | struct pinctrl_maps *maps_node; |
| @@ -508,7 +508,7 @@ static int pinconf_dbg_config_write(struct file *file, | |||
| 508 | int i; | 508 | int i; |
| 509 | 509 | ||
| 510 | /* Get userspace string and assure termination */ | 510 | /* Get userspace string and assure termination */ |
| 511 | buf_size = min(count, (size_t)(sizeof(buf)-1)); | 511 | buf_size = min(count, sizeof(buf) - 1); |
| 512 | if (copy_from_user(buf, user_buf, buf_size)) | 512 | if (copy_from_user(buf, user_buf, buf_size)) |
| 513 | return -EFAULT; | 513 | return -EFAULT; |
| 514 | buf[buf_size] = 0; | 514 | buf[buf_size] = 0; |
diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index 2689f8d01a1e..155b1b3a0e7a 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c | |||
| @@ -663,18 +663,18 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) | |||
| 663 | /* pin banks of s5pv210 pin-controller */ | 663 | /* pin banks of s5pv210 pin-controller */ |
| 664 | static struct samsung_pin_bank s5pv210_pin_bank[] = { | 664 | static struct samsung_pin_bank s5pv210_pin_bank[] = { |
| 665 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), | 665 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), |
| 666 | EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), | 666 | EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04), |
| 667 | EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), | 667 | EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), |
| 668 | EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c), | 668 | EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c), |
| 669 | EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10), | 669 | EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10), |
| 670 | EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14), | 670 | EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14), |
| 671 | EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18), | 671 | EXYNOS_PIN_BANK_EINTG(6, 0x0c0, "gpd1", 0x18), |
| 672 | EXYNOS_PIN_BANK_EINTG(5, 0x0e0, "gpe0", 0x1c), | 672 | EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe0", 0x1c), |
| 673 | EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20), | 673 | EXYNOS_PIN_BANK_EINTG(5, 0x100, "gpe1", 0x20), |
| 674 | EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpf0", 0x24), | 674 | EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpf0", 0x24), |
| 675 | EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28), | 675 | EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28), |
| 676 | EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c), | 676 | EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c), |
| 677 | EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf3", 0x30), | 677 | EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30), |
| 678 | EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34), | 678 | EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34), |
| 679 | EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38), | 679 | EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38), |
| 680 | EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c), | 680 | EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c), |
diff --git a/drivers/pinctrl/pinctrl-palmas.c b/drivers/pinctrl/pinctrl-palmas.c index 82638fac3cfa..30c4d356cb33 100644 --- a/drivers/pinctrl/pinctrl-palmas.c +++ b/drivers/pinctrl/pinctrl-palmas.c | |||
| @@ -891,9 +891,10 @@ static int palmas_pinconf_set(struct pinctrl_dev *pctldev, | |||
| 891 | param = pinconf_to_config_param(configs[i]); | 891 | param = pinconf_to_config_param(configs[i]); |
| 892 | param_val = pinconf_to_config_argument(configs[i]); | 892 | param_val = pinconf_to_config_argument(configs[i]); |
| 893 | 893 | ||
| 894 | if (param == PIN_CONFIG_BIAS_PULL_PIN_DEFAULT) | ||
| 895 | continue; | ||
| 896 | |||
| 894 | switch (param) { | 897 | switch (param) { |
| 895 | case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: | ||
| 896 | return 0; | ||
| 897 | case PIN_CONFIG_BIAS_DISABLE: | 898 | case PIN_CONFIG_BIAS_DISABLE: |
| 898 | case PIN_CONFIG_BIAS_PULL_UP: | 899 | case PIN_CONFIG_BIAS_PULL_UP: |
| 899 | case PIN_CONFIG_BIAS_PULL_DOWN: | 900 | case PIN_CONFIG_BIAS_PULL_DOWN: |
diff --git a/drivers/pinctrl/pinctrl-tegra114.c b/drivers/pinctrl/pinctrl-tegra114.c index 622c4854977e..93c9e3899d5e 100644 --- a/drivers/pinctrl/pinctrl-tegra114.c +++ b/drivers/pinctrl/pinctrl-tegra114.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. |
| 5 | * | 5 | * |
| 6 | * Arthur: Pritesh Raithatha <praithatha@nvidia.com> | 6 | * Author: Pritesh Raithatha <praithatha@nvidia.com> |
| 7 | * | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms and conditions of the GNU General Public License, | 9 | * under the terms and conditions of the GNU General Public License, |
| @@ -2763,7 +2763,6 @@ static struct platform_driver tegra114_pinctrl_driver = { | |||
| 2763 | }; | 2763 | }; |
| 2764 | module_platform_driver(tegra114_pinctrl_driver); | 2764 | module_platform_driver(tegra114_pinctrl_driver); |
| 2765 | 2765 | ||
| 2766 | MODULE_ALIAS("platform:tegra114-pinctrl"); | ||
| 2767 | MODULE_AUTHOR("Pritesh Raithatha <praithatha@nvidia.com>"); | 2766 | MODULE_AUTHOR("Pritesh Raithatha <praithatha@nvidia.com>"); |
| 2768 | MODULE_DESCRIPTION("NVIDIA Tegra114 pincontrol driver"); | 2767 | MODULE_DESCRIPTION("NVIDIA Tegra114 pinctrl driver"); |
| 2769 | MODULE_LICENSE("GPL v2"); | 2768 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index 1a7816390773..b9f2653e4ef9 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c | |||
| @@ -709,7 +709,7 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt( | |||
| 709 | struct of_regulator_match **da9063_reg_matches) | 709 | struct of_regulator_match **da9063_reg_matches) |
| 710 | { | 710 | { |
| 711 | da9063_reg_matches = NULL; | 711 | da9063_reg_matches = NULL; |
| 712 | return PTR_ERR(-ENODEV); | 712 | return ERR_PTR(-ENODEV); |
| 713 | } | 713 | } |
| 714 | #endif | 714 | #endif |
| 715 | 715 | ||
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 488dfe7ce9a6..7e2b165972e6 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
| @@ -201,13 +201,7 @@ static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500}; | |||
| 201 | #define SMPS_CTRL_MODE_ECO 0x02 | 201 | #define SMPS_CTRL_MODE_ECO 0x02 |
| 202 | #define SMPS_CTRL_MODE_PWM 0x03 | 202 | #define SMPS_CTRL_MODE_PWM 0x03 |
| 203 | 203 | ||
| 204 | /* These values are derived from the data sheet. And are the number of steps | 204 | #define PALMAS_SMPS_NUM_VOLTAGES 122 |
| 205 | * where there is a voltage change, the ranges at beginning and end of register | ||
| 206 | * max/min values where there are no change are ommitted. | ||
| 207 | * | ||
| 208 | * So they are basically (maxV-minV)/stepV | ||
| 209 | */ | ||
| 210 | #define PALMAS_SMPS_NUM_VOLTAGES 117 | ||
| 211 | #define PALMAS_SMPS10_NUM_VOLTAGES 2 | 205 | #define PALMAS_SMPS10_NUM_VOLTAGES 2 |
| 212 | #define PALMAS_LDO_NUM_VOLTAGES 50 | 206 | #define PALMAS_LDO_NUM_VOLTAGES 50 |
| 213 | 207 | ||
| @@ -979,6 +973,7 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
| 979 | pmic->desc[id].min_uV = 900000; | 973 | pmic->desc[id].min_uV = 900000; |
| 980 | pmic->desc[id].uV_step = 50000; | 974 | pmic->desc[id].uV_step = 50000; |
| 981 | pmic->desc[id].linear_min_sel = 1; | 975 | pmic->desc[id].linear_min_sel = 1; |
| 976 | pmic->desc[id].enable_time = 500; | ||
| 982 | pmic->desc[id].vsel_reg = | 977 | pmic->desc[id].vsel_reg = |
| 983 | PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, | 978 | PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, |
| 984 | palmas_regs_info[id].vsel_addr); | 979 | palmas_regs_info[id].vsel_addr); |
| @@ -997,6 +992,11 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
| 997 | pmic->desc[id].min_uV = 450000; | 992 | pmic->desc[id].min_uV = 450000; |
| 998 | pmic->desc[id].uV_step = 25000; | 993 | pmic->desc[id].uV_step = 25000; |
| 999 | } | 994 | } |
| 995 | |||
| 996 | /* LOD6 in vibrator mode will have enable time 2000us */ | ||
| 997 | if (pdata && pdata->ldo6_vibrator && | ||
| 998 | (id == PALMAS_REG_LDO6)) | ||
| 999 | pmic->desc[id].enable_time = 2000; | ||
| 1000 | } else { | 1000 | } else { |
| 1001 | pmic->desc[id].n_voltages = 1; | 1001 | pmic->desc[id].n_voltages = 1; |
| 1002 | pmic->desc[id].ops = &palmas_ops_extreg; | 1002 | pmic->desc[id].ops = &palmas_ops_extreg; |
diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c index d8e3e1262bc2..20c271d49dcb 100644 --- a/drivers/regulator/ti-abb-regulator.c +++ b/drivers/regulator/ti-abb-regulator.c | |||
| @@ -279,8 +279,12 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb, | |||
| 279 | ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, regs->control_reg, | 279 | ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, regs->control_reg, |
| 280 | abb->base); | 280 | abb->base); |
| 281 | 281 | ||
| 282 | /* program LDO VBB vset override if needed */ | 282 | /* |
| 283 | if (abb->ldo_base) | 283 | * program LDO VBB vset override if needed for !bypass mode |
| 284 | * XXX: Do not switch sequence - for !bypass, LDO override reset *must* | ||
| 285 | * be performed *before* switch to bias mode else VBB glitches. | ||
| 286 | */ | ||
| 287 | if (abb->ldo_base && info->opp_sel != TI_ABB_NOMINAL_OPP) | ||
| 284 | ti_abb_program_ldovbb(dev, abb, info); | 288 | ti_abb_program_ldovbb(dev, abb, info); |
| 285 | 289 | ||
| 286 | /* Initiate ABB ldo change */ | 290 | /* Initiate ABB ldo change */ |
| @@ -295,6 +299,14 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb, | |||
| 295 | if (ret) | 299 | if (ret) |
| 296 | goto out; | 300 | goto out; |
| 297 | 301 | ||
| 302 | /* | ||
| 303 | * Reset LDO VBB vset override bypass mode | ||
| 304 | * XXX: Do not switch sequence - for bypass, LDO override reset *must* | ||
| 305 | * be performed *after* switch to bypass else VBB glitches. | ||
| 306 | */ | ||
| 307 | if (abb->ldo_base && info->opp_sel == TI_ABB_NOMINAL_OPP) | ||
| 308 | ti_abb_program_ldovbb(dev, abb, info); | ||
| 309 | |||
| 298 | out: | 310 | out: |
| 299 | return ret; | 311 | return ret; |
| 300 | } | 312 | } |
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 1432b26ef2e9..2205fbc2c37b 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
| @@ -63,7 +63,7 @@ static irqreturn_t wm831x_ldo_uv_irq(int irq, void *data) | |||
| 63 | */ | 63 | */ |
| 64 | 64 | ||
| 65 | static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = { | 65 | static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = { |
| 66 | { .min_uV = 900000, .max_uV = 1650000, .min_sel = 0, .max_sel = 14, | 66 | { .min_uV = 900000, .max_uV = 1600000, .min_sel = 0, .max_sel = 14, |
| 67 | .uV_step = 50000 }, | 67 | .uV_step = 50000 }, |
| 68 | { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31, | 68 | { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31, |
| 69 | .uV_step = 100000 }, | 69 | .uV_step = 100000 }, |
| @@ -332,7 +332,7 @@ static struct platform_driver wm831x_gp_ldo_driver = { | |||
| 332 | */ | 332 | */ |
| 333 | 333 | ||
| 334 | static const struct regulator_linear_range wm831x_aldo_ranges[] = { | 334 | static const struct regulator_linear_range wm831x_aldo_ranges[] = { |
| 335 | { .min_uV = 1000000, .max_uV = 1650000, .min_sel = 0, .max_sel = 12, | 335 | { .min_uV = 1000000, .max_uV = 1600000, .min_sel = 0, .max_sel = 12, |
| 336 | .uV_step = 50000 }, | 336 | .uV_step = 50000 }, |
| 337 | { .min_uV = 1700000, .max_uV = 3500000, .min_sel = 13, .max_sel = 31, | 337 | { .min_uV = 1700000, .max_uV = 3500000, .min_sel = 13, .max_sel = 31, |
| 338 | .uV_step = 100000 }, | 338 | .uV_step = 100000 }, |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 835b5f0f344e..61ca9292a429 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
| @@ -543,7 +543,7 @@ static int wm8350_dcdc_set_suspend_mode(struct regulator_dev *rdev, | |||
| 543 | } | 543 | } |
| 544 | 544 | ||
| 545 | static const struct regulator_linear_range wm8350_ldo_ranges[] = { | 545 | static const struct regulator_linear_range wm8350_ldo_ranges[] = { |
| 546 | { .min_uV = 900000, .max_uV = 1750000, .min_sel = 0, .max_sel = 15, | 546 | { .min_uV = 900000, .max_uV = 1650000, .min_sel = 0, .max_sel = 15, |
| 547 | .uV_step = 50000 }, | 547 | .uV_step = 50000 }, |
| 548 | { .min_uV = 1800000, .max_uV = 3300000, .min_sel = 16, .max_sel = 31, | 548 | { .min_uV = 1800000, .max_uV = 3300000, .min_sel = 16, .max_sel = 31, |
| 549 | .uV_step = 100000 }, | 549 | .uV_step = 100000 }, |
diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index 3ba4c5712dff..853f62b2b1a9 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c | |||
| @@ -369,28 +369,23 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, | |||
| 369 | { | 369 | { |
| 370 | const struct ni_65xx_board *board = comedi_board(dev); | 370 | const struct ni_65xx_board *board = comedi_board(dev); |
| 371 | struct ni_65xx_private *devpriv = dev->private; | 371 | struct ni_65xx_private *devpriv = dev->private; |
| 372 | unsigned base_bitfield_channel; | 372 | int base_bitfield_channel; |
| 373 | const unsigned max_ports_per_bitfield = 5; | ||
| 374 | unsigned read_bits = 0; | 373 | unsigned read_bits = 0; |
| 375 | unsigned j; | 374 | int last_port_offset = ni_65xx_port_by_channel(s->n_chan - 1); |
| 375 | int port_offset; | ||
| 376 | 376 | ||
| 377 | base_bitfield_channel = CR_CHAN(insn->chanspec); | 377 | base_bitfield_channel = CR_CHAN(insn->chanspec); |
| 378 | for (j = 0; j < max_ports_per_bitfield; ++j) { | 378 | for (port_offset = ni_65xx_port_by_channel(base_bitfield_channel); |
| 379 | const unsigned port_offset = | 379 | port_offset <= last_port_offset; port_offset++) { |
| 380 | ni_65xx_port_by_channel(base_bitfield_channel) + j; | 380 | unsigned port = sprivate(s)->base_port + port_offset; |
| 381 | const unsigned port = | 381 | int base_port_channel = port_offset * ni_65xx_channels_per_port; |
| 382 | sprivate(s)->base_port + port_offset; | ||
| 383 | unsigned base_port_channel; | ||
| 384 | unsigned port_mask, port_data, port_read_bits; | 382 | unsigned port_mask, port_data, port_read_bits; |
| 385 | int bitshift; | 383 | int bitshift = base_port_channel - base_bitfield_channel; |
| 386 | if (port >= ni_65xx_total_num_ports(board)) | 384 | |
| 385 | if (bitshift >= 32) | ||
| 387 | break; | 386 | break; |
| 388 | base_port_channel = port_offset * ni_65xx_channels_per_port; | ||
| 389 | port_mask = data[0]; | 387 | port_mask = data[0]; |
| 390 | port_data = data[1]; | 388 | port_data = data[1]; |
| 391 | bitshift = base_port_channel - base_bitfield_channel; | ||
| 392 | if (bitshift >= 32 || bitshift <= -32) | ||
| 393 | break; | ||
| 394 | if (bitshift > 0) { | 389 | if (bitshift > 0) { |
| 395 | port_mask >>= bitshift; | 390 | port_mask >>= bitshift; |
| 396 | port_data >>= bitshift; | 391 | port_data >>= bitshift; |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 35b61f7d6c63..38e44b9abf0f 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
| @@ -753,7 +753,8 @@ static void iscsit_unmap_iovec(struct iscsi_cmd *cmd) | |||
| 753 | 753 | ||
| 754 | static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn) | 754 | static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn) |
| 755 | { | 755 | { |
| 756 | struct iscsi_cmd *cmd; | 756 | LIST_HEAD(ack_list); |
| 757 | struct iscsi_cmd *cmd, *cmd_p; | ||
| 757 | 758 | ||
| 758 | conn->exp_statsn = exp_statsn; | 759 | conn->exp_statsn = exp_statsn; |
| 759 | 760 | ||
| @@ -761,19 +762,23 @@ static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn) | |||
| 761 | return; | 762 | return; |
| 762 | 763 | ||
| 763 | spin_lock_bh(&conn->cmd_lock); | 764 | spin_lock_bh(&conn->cmd_lock); |
| 764 | list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { | 765 | list_for_each_entry_safe(cmd, cmd_p, &conn->conn_cmd_list, i_conn_node) { |
| 765 | spin_lock(&cmd->istate_lock); | 766 | spin_lock(&cmd->istate_lock); |
| 766 | if ((cmd->i_state == ISTATE_SENT_STATUS) && | 767 | if ((cmd->i_state == ISTATE_SENT_STATUS) && |
| 767 | iscsi_sna_lt(cmd->stat_sn, exp_statsn)) { | 768 | iscsi_sna_lt(cmd->stat_sn, exp_statsn)) { |
| 768 | cmd->i_state = ISTATE_REMOVE; | 769 | cmd->i_state = ISTATE_REMOVE; |
| 769 | spin_unlock(&cmd->istate_lock); | 770 | spin_unlock(&cmd->istate_lock); |
| 770 | iscsit_add_cmd_to_immediate_queue(cmd, conn, | 771 | list_move_tail(&cmd->i_conn_node, &ack_list); |
| 771 | cmd->i_state); | ||
| 772 | continue; | 772 | continue; |
| 773 | } | 773 | } |
| 774 | spin_unlock(&cmd->istate_lock); | 774 | spin_unlock(&cmd->istate_lock); |
| 775 | } | 775 | } |
| 776 | spin_unlock_bh(&conn->cmd_lock); | 776 | spin_unlock_bh(&conn->cmd_lock); |
| 777 | |||
| 778 | list_for_each_entry_safe(cmd, cmd_p, &ack_list, i_conn_node) { | ||
| 779 | list_del(&cmd->i_conn_node); | ||
| 780 | iscsit_free_cmd(cmd, false); | ||
| 781 | } | ||
| 777 | } | 782 | } |
| 778 | 783 | ||
| 779 | static int iscsit_allocate_iovecs(struct iscsi_cmd *cmd) | 784 | static int iscsit_allocate_iovecs(struct iscsi_cmd *cmd) |
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 14d1aed5af1d..ef6d836a4d09 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c | |||
| @@ -1192,7 +1192,7 @@ get_target: | |||
| 1192 | */ | 1192 | */ |
| 1193 | alloc_tags: | 1193 | alloc_tags: |
| 1194 | tag_num = max_t(u32, ISCSIT_MIN_TAGS, queue_depth); | 1194 | tag_num = max_t(u32, ISCSIT_MIN_TAGS, queue_depth); |
| 1195 | tag_num += ISCSIT_EXTRA_TAGS; | 1195 | tag_num += (tag_num / 2) + ISCSIT_EXTRA_TAGS; |
| 1196 | tag_size = sizeof(struct iscsi_cmd) + conn->conn_transport->priv_size; | 1196 | tag_size = sizeof(struct iscsi_cmd) + conn->conn_transport->priv_size; |
| 1197 | 1197 | ||
| 1198 | ret = transport_alloc_session_tags(sess->se_sess, tag_num, tag_size); | 1198 | ret = transport_alloc_session_tags(sess->se_sess, tag_num, tag_size); |
diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index f2de28e178fd..b0cac0c342e1 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c | |||
| @@ -736,7 +736,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) | |||
| 736 | * Fallthrough | 736 | * Fallthrough |
| 737 | */ | 737 | */ |
| 738 | case ISCSI_OP_SCSI_TMFUNC: | 738 | case ISCSI_OP_SCSI_TMFUNC: |
| 739 | rc = transport_generic_free_cmd(&cmd->se_cmd, 1); | 739 | rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); |
| 740 | if (!rc && shutdown && se_cmd && se_cmd->se_sess) { | 740 | if (!rc && shutdown && se_cmd && se_cmd->se_sess) { |
| 741 | __iscsit_free_cmd(cmd, true, shutdown); | 741 | __iscsit_free_cmd(cmd, true, shutdown); |
| 742 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); | 742 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); |
| @@ -752,7 +752,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) | |||
| 752 | se_cmd = &cmd->se_cmd; | 752 | se_cmd = &cmd->se_cmd; |
| 753 | __iscsit_free_cmd(cmd, true, shutdown); | 753 | __iscsit_free_cmd(cmd, true, shutdown); |
| 754 | 754 | ||
| 755 | rc = transport_generic_free_cmd(&cmd->se_cmd, 1); | 755 | rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); |
| 756 | if (!rc && shutdown && se_cmd->se_sess) { | 756 | if (!rc && shutdown && se_cmd->se_sess) { |
| 757 | __iscsit_free_cmd(cmd, true, shutdown); | 757 | __iscsit_free_cmd(cmd, true, shutdown); |
| 758 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); | 758 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); |
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 6c17295e8d7c..4714c6f8da4b 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
| @@ -349,7 +349,16 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd) | |||
| 349 | { | 349 | { |
| 350 | struct se_device *dev = cmd->se_dev; | 350 | struct se_device *dev = cmd->se_dev; |
| 351 | 351 | ||
| 352 | cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST; | 352 | /* |
| 353 | * Only set SCF_COMPARE_AND_WRITE_POST to force a response fall-through | ||
| 354 | * within target_complete_ok_work() if the command was successfully | ||
| 355 | * sent to the backend driver. | ||
| 356 | */ | ||
| 357 | spin_lock_irq(&cmd->t_state_lock); | ||
| 358 | if ((cmd->transport_state & CMD_T_SENT) && !cmd->scsi_status) | ||
| 359 | cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST; | ||
| 360 | spin_unlock_irq(&cmd->t_state_lock); | ||
| 361 | |||
| 353 | /* | 362 | /* |
| 354 | * Unlock ->caw_sem originally obtained during sbc_compare_and_write() | 363 | * Unlock ->caw_sem originally obtained during sbc_compare_and_write() |
| 355 | * before the original READ I/O submission. | 364 | * before the original READ I/O submission. |
| @@ -363,7 +372,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) | |||
| 363 | { | 372 | { |
| 364 | struct se_device *dev = cmd->se_dev; | 373 | struct se_device *dev = cmd->se_dev; |
| 365 | struct scatterlist *write_sg = NULL, *sg; | 374 | struct scatterlist *write_sg = NULL, *sg; |
| 366 | unsigned char *buf, *addr; | 375 | unsigned char *buf = NULL, *addr; |
| 367 | struct sg_mapping_iter m; | 376 | struct sg_mapping_iter m; |
| 368 | unsigned int offset = 0, len; | 377 | unsigned int offset = 0, len; |
| 369 | unsigned int nlbas = cmd->t_task_nolb; | 378 | unsigned int nlbas = cmd->t_task_nolb; |
| @@ -378,6 +387,15 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) | |||
| 378 | */ | 387 | */ |
| 379 | if (!cmd->t_data_sg || !cmd->t_bidi_data_sg) | 388 | if (!cmd->t_data_sg || !cmd->t_bidi_data_sg) |
| 380 | return TCM_NO_SENSE; | 389 | return TCM_NO_SENSE; |
| 390 | /* | ||
| 391 | * Immediately exit + release dev->caw_sem if command has already | ||
| 392 | * been failed with a non-zero SCSI status. | ||
| 393 | */ | ||
| 394 | if (cmd->scsi_status) { | ||
| 395 | pr_err("compare_and_write_callback: non zero scsi_status:" | ||
| 396 | " 0x%02x\n", cmd->scsi_status); | ||
| 397 | goto out; | ||
| 398 | } | ||
| 381 | 399 | ||
| 382 | buf = kzalloc(cmd->data_length, GFP_KERNEL); | 400 | buf = kzalloc(cmd->data_length, GFP_KERNEL); |
| 383 | if (!buf) { | 401 | if (!buf) { |
| @@ -508,6 +526,12 @@ sbc_compare_and_write(struct se_cmd *cmd) | |||
| 508 | cmd->transport_complete_callback = NULL; | 526 | cmd->transport_complete_callback = NULL; |
| 509 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 527 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; |
| 510 | } | 528 | } |
| 529 | /* | ||
| 530 | * Reset cmd->data_length to individual block_size in order to not | ||
| 531 | * confuse backend drivers that depend on this value matching the | ||
| 532 | * size of the I/O being submitted. | ||
| 533 | */ | ||
| 534 | cmd->data_length = cmd->t_task_nolb * dev->dev_attrib.block_size; | ||
| 511 | 535 | ||
| 512 | ret = cmd->execute_rw(cmd, cmd->t_bidi_data_sg, cmd->t_bidi_data_nents, | 536 | ret = cmd->execute_rw(cmd, cmd->t_bidi_data_sg, cmd->t_bidi_data_nents, |
| 513 | DMA_FROM_DEVICE); | 537 | DMA_FROM_DEVICE); |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 84747cc1aac0..81e945eefbbd 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
| @@ -236,17 +236,24 @@ int transport_alloc_session_tags(struct se_session *se_sess, | |||
| 236 | { | 236 | { |
| 237 | int rc; | 237 | int rc; |
| 238 | 238 | ||
| 239 | se_sess->sess_cmd_map = kzalloc(tag_num * tag_size, GFP_KERNEL); | 239 | se_sess->sess_cmd_map = kzalloc(tag_num * tag_size, |
| 240 | GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); | ||
| 240 | if (!se_sess->sess_cmd_map) { | 241 | if (!se_sess->sess_cmd_map) { |
| 241 | pr_err("Unable to allocate se_sess->sess_cmd_map\n"); | 242 | se_sess->sess_cmd_map = vzalloc(tag_num * tag_size); |
| 242 | return -ENOMEM; | 243 | if (!se_sess->sess_cmd_map) { |
| 244 | pr_err("Unable to allocate se_sess->sess_cmd_map\n"); | ||
| 245 | return -ENOMEM; | ||
| 246 | } | ||
| 243 | } | 247 | } |
| 244 | 248 | ||
| 245 | rc = percpu_ida_init(&se_sess->sess_tag_pool, tag_num); | 249 | rc = percpu_ida_init(&se_sess->sess_tag_pool, tag_num); |
| 246 | if (rc < 0) { | 250 | if (rc < 0) { |
| 247 | pr_err("Unable to init se_sess->sess_tag_pool," | 251 | pr_err("Unable to init se_sess->sess_tag_pool," |
| 248 | " tag_num: %u\n", tag_num); | 252 | " tag_num: %u\n", tag_num); |
| 249 | kfree(se_sess->sess_cmd_map); | 253 | if (is_vmalloc_addr(se_sess->sess_cmd_map)) |
| 254 | vfree(se_sess->sess_cmd_map); | ||
| 255 | else | ||
| 256 | kfree(se_sess->sess_cmd_map); | ||
| 250 | se_sess->sess_cmd_map = NULL; | 257 | se_sess->sess_cmd_map = NULL; |
| 251 | return -ENOMEM; | 258 | return -ENOMEM; |
| 252 | } | 259 | } |
| @@ -412,7 +419,10 @@ void transport_free_session(struct se_session *se_sess) | |||
| 412 | { | 419 | { |
| 413 | if (se_sess->sess_cmd_map) { | 420 | if (se_sess->sess_cmd_map) { |
| 414 | percpu_ida_destroy(&se_sess->sess_tag_pool); | 421 | percpu_ida_destroy(&se_sess->sess_tag_pool); |
| 415 | kfree(se_sess->sess_cmd_map); | 422 | if (is_vmalloc_addr(se_sess->sess_cmd_map)) |
| 423 | vfree(se_sess->sess_cmd_map); | ||
| 424 | else | ||
| 425 | kfree(se_sess->sess_cmd_map); | ||
| 416 | } | 426 | } |
| 417 | kmem_cache_free(se_sess_cache, se_sess); | 427 | kmem_cache_free(se_sess_cache, se_sess); |
| 418 | } | 428 | } |
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 4d22e7d2adca..3da4fd10b9f8 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
| @@ -298,8 +298,8 @@ static int target_xcopy_parse_segdesc_02(struct se_cmd *se_cmd, struct xcopy_op | |||
| 298 | (unsigned long long)xop->dst_lba); | 298 | (unsigned long long)xop->dst_lba); |
| 299 | 299 | ||
| 300 | if (dc != 0) { | 300 | if (dc != 0) { |
| 301 | xop->dbl = (desc[29] << 16) & 0xff; | 301 | xop->dbl = (desc[29] & 0xff) << 16; |
| 302 | xop->dbl |= (desc[30] << 8) & 0xff; | 302 | xop->dbl |= (desc[30] & 0xff) << 8; |
| 303 | xop->dbl |= desc[31] & 0xff; | 303 | xop->dbl |= desc[31] & 0xff; |
| 304 | 304 | ||
| 305 | pr_debug("XCOPY seg desc 0x02: DC=1 w/ dbl: %u\n", xop->dbl); | 305 | pr_debug("XCOPY seg desc 0x02: DC=1 w/ dbl: %u\n", xop->dbl); |
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index e61c36cbb866..c193af6a628f 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c | |||
| @@ -636,6 +636,7 @@ struct console xenboot_console = { | |||
| 636 | .name = "xenboot", | 636 | .name = "xenboot", |
| 637 | .write = xenboot_write_console, | 637 | .write = xenboot_write_console, |
| 638 | .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME, | 638 | .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME, |
| 639 | .index = -1, | ||
| 639 | }; | 640 | }; |
| 640 | #endif /* CONFIG_EARLY_PRINTK */ | 641 | #endif /* CONFIG_EARLY_PRINTK */ |
| 641 | 642 | ||
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 01bf5eb4f238..7a744b69c3d1 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
| @@ -2183,28 +2183,34 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, | |||
| 2183 | 2183 | ||
| 2184 | if (!input_available_p(tty, 0)) { | 2184 | if (!input_available_p(tty, 0)) { |
| 2185 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { | 2185 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { |
| 2186 | retval = -EIO; | 2186 | up_read(&tty->termios_rwsem); |
| 2187 | break; | 2187 | tty_flush_to_ldisc(tty); |
| 2188 | } | 2188 | down_read(&tty->termios_rwsem); |
| 2189 | if (tty_hung_up_p(file)) | 2189 | if (!input_available_p(tty, 0)) { |
| 2190 | break; | 2190 | retval = -EIO; |
| 2191 | if (!timeout) | 2191 | break; |
| 2192 | break; | 2192 | } |
| 2193 | if (file->f_flags & O_NONBLOCK) { | 2193 | } else { |
| 2194 | retval = -EAGAIN; | 2194 | if (tty_hung_up_p(file)) |
| 2195 | break; | 2195 | break; |
| 2196 | } | 2196 | if (!timeout) |
| 2197 | if (signal_pending(current)) { | 2197 | break; |
| 2198 | retval = -ERESTARTSYS; | 2198 | if (file->f_flags & O_NONBLOCK) { |
| 2199 | break; | 2199 | retval = -EAGAIN; |
| 2200 | } | 2200 | break; |
| 2201 | n_tty_set_room(tty); | 2201 | } |
| 2202 | up_read(&tty->termios_rwsem); | 2202 | if (signal_pending(current)) { |
| 2203 | retval = -ERESTARTSYS; | ||
| 2204 | break; | ||
| 2205 | } | ||
| 2206 | n_tty_set_room(tty); | ||
| 2207 | up_read(&tty->termios_rwsem); | ||
| 2203 | 2208 | ||
| 2204 | timeout = schedule_timeout(timeout); | 2209 | timeout = schedule_timeout(timeout); |
| 2205 | 2210 | ||
| 2206 | down_read(&tty->termios_rwsem); | 2211 | down_read(&tty->termios_rwsem); |
| 2207 | continue; | 2212 | continue; |
| 2213 | } | ||
| 2208 | } | 2214 | } |
| 2209 | __set_current_state(TASK_RUNNING); | 2215 | __set_current_state(TASK_RUNNING); |
| 2210 | 2216 | ||
diff --git a/drivers/usb/chipidea/ci_hdrc_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c index 042320a6c6c7..d514332ac081 100644 --- a/drivers/usb/chipidea/ci_hdrc_pci.c +++ b/drivers/usb/chipidea/ci_hdrc_pci.c | |||
| @@ -129,7 +129,12 @@ static DEFINE_PCI_DEVICE_TABLE(ci_hdrc_pci_id_table) = { | |||
| 129 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829), | 129 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829), |
| 130 | .driver_data = (kernel_ulong_t)&penwell_pci_platdata, | 130 | .driver_data = (kernel_ulong_t)&penwell_pci_platdata, |
| 131 | }, | 131 | }, |
| 132 | { 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ } | 132 | { |
| 133 | /* Intel Clovertrail */ | ||
| 134 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xe006), | ||
| 135 | .driver_data = (kernel_ulong_t)&penwell_pci_platdata, | ||
| 136 | }, | ||
| 137 | { 0 } /* end: all zeroes */ | ||
| 133 | }; | 138 | }; |
| 134 | MODULE_DEVICE_TABLE(pci, ci_hdrc_pci_id_table); | 139 | MODULE_DEVICE_TABLE(pci, ci_hdrc_pci_id_table); |
| 135 | 140 | ||
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 0658908d8968..44cf775a8627 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
| @@ -2256,6 +2256,8 @@ static int ffs_func_bind(struct usb_configuration *c, | |||
| 2256 | data->raw_descs + ret, | 2256 | data->raw_descs + ret, |
| 2257 | (sizeof data->raw_descs) - ret, | 2257 | (sizeof data->raw_descs) - ret, |
| 2258 | __ffs_func_bind_do_descs, func); | 2258 | __ffs_func_bind_do_descs, func); |
| 2259 | if (unlikely(ret < 0)) | ||
| 2260 | goto error; | ||
| 2259 | } | 2261 | } |
| 2260 | 2262 | ||
| 2261 | /* | 2263 | /* |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index cc9207473dbc..0ac6064aa3b8 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
| @@ -2054,7 +2054,7 @@ static struct pxa25x_udc memory = { | |||
| 2054 | /* | 2054 | /* |
| 2055 | * probe - binds to the platform device | 2055 | * probe - binds to the platform device |
| 2056 | */ | 2056 | */ |
| 2057 | static int __init pxa25x_udc_probe(struct platform_device *pdev) | 2057 | static int pxa25x_udc_probe(struct platform_device *pdev) |
| 2058 | { | 2058 | { |
| 2059 | struct pxa25x_udc *dev = &memory; | 2059 | struct pxa25x_udc *dev = &memory; |
| 2060 | int retval, irq; | 2060 | int retval, irq; |
| @@ -2203,7 +2203,7 @@ static void pxa25x_udc_shutdown(struct platform_device *_dev) | |||
| 2203 | pullup_off(); | 2203 | pullup_off(); |
| 2204 | } | 2204 | } |
| 2205 | 2205 | ||
| 2206 | static int __exit pxa25x_udc_remove(struct platform_device *pdev) | 2206 | static int pxa25x_udc_remove(struct platform_device *pdev) |
| 2207 | { | 2207 | { |
| 2208 | struct pxa25x_udc *dev = platform_get_drvdata(pdev); | 2208 | struct pxa25x_udc *dev = platform_get_drvdata(pdev); |
| 2209 | 2209 | ||
| @@ -2294,7 +2294,8 @@ static int pxa25x_udc_resume(struct platform_device *dev) | |||
| 2294 | 2294 | ||
| 2295 | static struct platform_driver udc_driver = { | 2295 | static struct platform_driver udc_driver = { |
| 2296 | .shutdown = pxa25x_udc_shutdown, | 2296 | .shutdown = pxa25x_udc_shutdown, |
| 2297 | .remove = __exit_p(pxa25x_udc_remove), | 2297 | .probe = pxa25x_udc_probe, |
| 2298 | .remove = pxa25x_udc_remove, | ||
| 2298 | .suspend = pxa25x_udc_suspend, | 2299 | .suspend = pxa25x_udc_suspend, |
| 2299 | .resume = pxa25x_udc_resume, | 2300 | .resume = pxa25x_udc_resume, |
| 2300 | .driver = { | 2301 | .driver = { |
| @@ -2303,7 +2304,7 @@ static struct platform_driver udc_driver = { | |||
| 2303 | }, | 2304 | }, |
| 2304 | }; | 2305 | }; |
| 2305 | 2306 | ||
| 2306 | module_platform_driver_probe(udc_driver, pxa25x_udc_probe); | 2307 | module_platform_driver(udc_driver); |
| 2307 | 2308 | ||
| 2308 | MODULE_DESCRIPTION(DRIVER_DESC); | 2309 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 2309 | MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); | 2310 | MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 6bddf1aa2347..a8a99e4748d5 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
| @@ -543,7 +543,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, | |||
| 543 | * FIFO, requests of >512 cause the endpoint to get stuck with a | 543 | * FIFO, requests of >512 cause the endpoint to get stuck with a |
| 544 | * fragment of the end of the transfer in it. | 544 | * fragment of the end of the transfer in it. |
| 545 | */ | 545 | */ |
| 546 | if (can_write > 512) | 546 | if (can_write > 512 && !periodic) |
| 547 | can_write = 512; | 547 | can_write = 512; |
| 548 | 548 | ||
| 549 | /* | 549 | /* |
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 4047cbb91bac..bd4138d80a48 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
| @@ -535,6 +535,9 @@ static int dsps_probe(struct platform_device *pdev) | |||
| 535 | struct dsps_glue *glue; | 535 | struct dsps_glue *glue; |
| 536 | int ret; | 536 | int ret; |
| 537 | 537 | ||
| 538 | if (!strcmp(pdev->name, "musb-hdrc")) | ||
| 539 | return -ENODEV; | ||
| 540 | |||
| 538 | match = of_match_node(musb_dsps_of_match, pdev->dev.of_node); | 541 | match = of_match_node(musb_dsps_of_match, pdev->dev.of_node); |
| 539 | if (!match) { | 542 | if (!match) { |
| 540 | dev_err(&pdev->dev, "fail to get matching of_match struct\n"); | 543 | dev_err(&pdev->dev, "fail to get matching of_match struct\n"); |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 9a08679d204d..b19ed213ab85 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -1790,6 +1790,10 @@ int musb_gadget_setup(struct musb *musb) | |||
| 1790 | musb->g.max_speed = USB_SPEED_HIGH; | 1790 | musb->g.max_speed = USB_SPEED_HIGH; |
| 1791 | musb->g.speed = USB_SPEED_UNKNOWN; | 1791 | musb->g.speed = USB_SPEED_UNKNOWN; |
| 1792 | 1792 | ||
| 1793 | MUSB_DEV_MODE(musb); | ||
| 1794 | musb->xceiv->otg->default_a = 0; | ||
| 1795 | musb->xceiv->state = OTG_STATE_B_IDLE; | ||
| 1796 | |||
| 1793 | /* this "gadget" abstracts/virtualizes the controller */ | 1797 | /* this "gadget" abstracts/virtualizes the controller */ |
| 1794 | musb->g.name = musb_driver_name; | 1798 | musb->g.name = musb_driver_name; |
| 1795 | musb->g.is_otg = 1; | 1799 | musb->g.is_otg = 1; |
| @@ -1849,7 +1853,6 @@ static int musb_gadget_start(struct usb_gadget *g, | |||
| 1849 | musb->gadget_driver = driver; | 1853 | musb->gadget_driver = driver; |
| 1850 | 1854 | ||
| 1851 | spin_lock_irqsave(&musb->lock, flags); | 1855 | spin_lock_irqsave(&musb->lock, flags); |
| 1852 | musb->is_active = 1; | ||
| 1853 | 1856 | ||
| 1854 | otg_set_peripheral(otg, &musb->g); | 1857 | otg_set_peripheral(otg, &musb->g); |
| 1855 | musb->xceiv->state = OTG_STATE_B_IDLE; | 1858 | musb->xceiv->state = OTG_STATE_B_IDLE; |
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c index b2f29c9aebbf..02799a5efcd4 100644 --- a/drivers/usb/phy/phy-gpio-vbus-usb.c +++ b/drivers/usb/phy/phy-gpio-vbus-usb.c | |||
| @@ -241,7 +241,7 @@ static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend) | |||
| 241 | 241 | ||
| 242 | /* platform driver interface */ | 242 | /* platform driver interface */ |
| 243 | 243 | ||
| 244 | static int __init gpio_vbus_probe(struct platform_device *pdev) | 244 | static int gpio_vbus_probe(struct platform_device *pdev) |
| 245 | { | 245 | { |
| 246 | struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); | 246 | struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); |
| 247 | struct gpio_vbus_data *gpio_vbus; | 247 | struct gpio_vbus_data *gpio_vbus; |
| @@ -349,7 +349,7 @@ err_gpio: | |||
| 349 | return err; | 349 | return err; |
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | static int __exit gpio_vbus_remove(struct platform_device *pdev) | 352 | static int gpio_vbus_remove(struct platform_device *pdev) |
| 353 | { | 353 | { |
| 354 | struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev); | 354 | struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev); |
| 355 | struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); | 355 | struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); |
| @@ -398,8 +398,6 @@ static const struct dev_pm_ops gpio_vbus_dev_pm_ops = { | |||
| 398 | }; | 398 | }; |
| 399 | #endif | 399 | #endif |
| 400 | 400 | ||
| 401 | /* NOTE: the gpio-vbus device may *NOT* be hotplugged */ | ||
| 402 | |||
| 403 | MODULE_ALIAS("platform:gpio-vbus"); | 401 | MODULE_ALIAS("platform:gpio-vbus"); |
| 404 | 402 | ||
| 405 | static struct platform_driver gpio_vbus_driver = { | 403 | static struct platform_driver gpio_vbus_driver = { |
| @@ -410,10 +408,11 @@ static struct platform_driver gpio_vbus_driver = { | |||
| 410 | .pm = &gpio_vbus_dev_pm_ops, | 408 | .pm = &gpio_vbus_dev_pm_ops, |
| 411 | #endif | 409 | #endif |
| 412 | }, | 410 | }, |
| 413 | .remove = __exit_p(gpio_vbus_remove), | 411 | .probe = gpio_vbus_probe, |
| 412 | .remove = gpio_vbus_remove, | ||
| 414 | }; | 413 | }; |
| 415 | 414 | ||
| 416 | module_platform_driver_probe(gpio_vbus_driver, gpio_vbus_probe); | 415 | module_platform_driver(gpio_vbus_driver); |
| 417 | 416 | ||
| 418 | MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver"); | 417 | MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver"); |
| 419 | MODULE_AUTHOR("Philipp Zabel"); | 418 | MODULE_AUTHOR("Philipp Zabel"); |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 1cf6f125f5f0..80a7104d5ddb 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -81,6 +81,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 81 | 81 | ||
| 82 | #define HUAWEI_VENDOR_ID 0x12D1 | 82 | #define HUAWEI_VENDOR_ID 0x12D1 |
| 83 | #define HUAWEI_PRODUCT_E173 0x140C | 83 | #define HUAWEI_PRODUCT_E173 0x140C |
| 84 | #define HUAWEI_PRODUCT_E1750 0x1406 | ||
| 84 | #define HUAWEI_PRODUCT_K4505 0x1464 | 85 | #define HUAWEI_PRODUCT_K4505 0x1464 |
| 85 | #define HUAWEI_PRODUCT_K3765 0x1465 | 86 | #define HUAWEI_PRODUCT_K3765 0x1465 |
| 86 | #define HUAWEI_PRODUCT_K4605 0x14C6 | 87 | #define HUAWEI_PRODUCT_K4605 0x14C6 |
| @@ -567,6 +568,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 567 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) }, | 568 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) }, |
| 568 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff), | 569 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff), |
| 569 | .driver_info = (kernel_ulong_t) &net_intf1_blacklist }, | 570 | .driver_info = (kernel_ulong_t) &net_intf1_blacklist }, |
| 571 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1750, 0xff, 0xff, 0xff), | ||
| 572 | .driver_info = (kernel_ulong_t) &net_intf2_blacklist }, | ||
| 570 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) }, | 573 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) }, |
| 571 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) }, | 574 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) }, |
| 572 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff), | 575 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff), |
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 592b31698fc8..ce5221fa393a 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
| @@ -728,7 +728,12 @@ vhost_scsi_get_tag(struct vhost_virtqueue *vq, | |||
| 728 | } | 728 | } |
| 729 | se_sess = tv_nexus->tvn_se_sess; | 729 | se_sess = tv_nexus->tvn_se_sess; |
| 730 | 730 | ||
| 731 | tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_KERNEL); | 731 | tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_ATOMIC); |
| 732 | if (tag < 0) { | ||
| 733 | pr_err("Unable to obtain tag for tcm_vhost_cmd\n"); | ||
| 734 | return ERR_PTR(-ENOMEM); | ||
| 735 | } | ||
| 736 | |||
| 732 | cmd = &((struct tcm_vhost_cmd *)se_sess->sess_cmd_map)[tag]; | 737 | cmd = &((struct tcm_vhost_cmd *)se_sess->sess_cmd_map)[tag]; |
| 733 | sg = cmd->tvc_sgl; | 738 | sg = cmd->tvc_sgl; |
| 734 | pages = cmd->tvc_upages; | 739 | pages = cmd->tvc_upages; |
