Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'omap-for-v3.11/fixes-non-critical-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/fixes-non-critical

From Tony Lindgren:
Non-critical fixes for omaps for v3.11 merge window.

* tag 'omap-for-v3.11/fixes-non-critical-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2+: omap-usb-host: Fix memory leaks
ARM: OMAP2+: Fix serial init for device tree based booting
arm/omap: use const char properly
ARM: OMAP2+: devices: Do not print error when dss_hdmi hwmod lookup fails
ARM: OMAP2+: devices: Do not print error when DMIC hwmod lookup fails
ARM: OMAP2+: devices: Do not print error when McPDM hwmod lookup fails
ARM: OMAP: add vdds_sdi supply for omapdss_sdi.0
ARM: OMAP: add vdds_dsi supply for omapdss_dpi.0
ARM: OMAP: fix dsi regulator names
+ Linux 3.10-rc5

Signed-off-by: Olof Johansson <olof@lixom.net>

+2980 -1479
+3 -3
Documentation/dmatest.txt
··· 34 34 After a while you will start to get messages about current status or error like 35 35 in the original code. 36 36 37 - Note that running a new test will stop any in progress test. 37 + Note that running a new test will not stop any in progress test. 38 38 39 39 The following command should return actual state of the test. 40 40 % cat /sys/kernel/debug/dmatest/run ··· 52 52 53 53 The module parameters that is supplied to the kernel command line will be used 54 54 for the first performed test. After user gets a control, the test could be 55 - interrupted or re-run with same or different parameters. For the details see 56 - the above section "Part 2 - When dmatest is built as a module..." 55 + re-run with the same or different parameters. For the details see the above 56 + section "Part 2 - When dmatest is built as a module..." 57 57 58 58 In both cases the module parameters are used as initial values for the test case. 59 59 You always could check them at run-time by running
+3
Documentation/filesystems/xfs.txt
··· 33 33 removing extended attributes) the on-disk superblock feature 34 34 bit field will be updated to reflect this format being in use. 35 35 36 + CRC enabled filesystems always use the attr2 format, and so 37 + will reject the noattr2 mount option if it is set. 38 + 36 39 barrier 37 40 Enables the use of block layer write barriers for writes into 38 41 the journal and unwritten extent conversion. This allows for
+11 -1
MAINTAINERS
··· 2890 2890 2891 2891 ECRYPT FILE SYSTEM 2892 2892 M: Tyler Hicks <tyhicks@canonical.com> 2893 - M: Dustin Kirkland <dustin.kirkland@gazzang.com> 2894 2893 L: ecryptfs@vger.kernel.org 2894 + W: http://ecryptfs.org 2895 2895 W: https://launchpad.net/ecryptfs 2896 2896 S: Supported 2897 2897 F: Documentation/filesystems/ecryptfs.txt ··· 4447 4447 S: Maintained 4448 4448 F: drivers/scsi/*iscsi* 4449 4449 F: include/scsi/*iscsi* 4450 + 4451 + ISCSI EXTENSIONS FOR RDMA (ISER) INITIATOR 4452 + M: Or Gerlitz <ogerlitz@mellanox.com> 4453 + M: Roi Dayan <roid@mellanox.com> 4454 + L: linux-rdma@vger.kernel.org 4455 + S: Supported 4456 + W: http://www.openfabrics.org 4457 + W: www.open-iscsi.org 4458 + Q: http://patchwork.kernel.org/project/linux-rdma/list/ 4459 + F: drivers/infiniband/ulp/iser 4450 4460 4451 4461 ISDN SUBSYSTEM 4452 4462 M: Karsten Keil <isdn@linux-pingi.de>
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 10 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc4 4 + EXTRAVERSION = -rc5 5 5 NAME = Unicycling Gorilla 6 6 7 7 # *DOCUMENTATION*
+1
arch/arm/boot/dts/bcm2835.dtsi
··· 44 44 reg = <0x7e201000 0x1000>; 45 45 interrupts = <2 25>; 46 46 clock-frequency = <3000000>; 47 + arm,primecell-periphid = <0x00241011>; 47 48 }; 48 49 49 50 gpio: gpio {
+6 -6
arch/arm/boot/dts/imx25.dtsi
··· 141 141 #size-cells = <0>; 142 142 compatible = "fsl,imx25-cspi", "fsl,imx35-cspi"; 143 143 reg = <0x43fa4000 0x4000>; 144 - clocks = <&clks 62>; 145 - clock-names = "ipg"; 144 + clocks = <&clks 62>, <&clks 62>; 145 + clock-names = "ipg", "per"; 146 146 interrupts = <14>; 147 147 status = "disabled"; 148 148 }; ··· 182 182 compatible = "fsl,imx25-cspi", "fsl,imx35-cspi"; 183 183 reg = <0x50004000 0x4000>; 184 184 interrupts = <0>; 185 - clocks = <&clks 80>; 186 - clock-names = "ipg"; 185 + clocks = <&clks 80>, <&clks 80>; 186 + clock-names = "ipg", "per"; 187 187 status = "disabled"; 188 188 }; 189 189 ··· 210 210 #size-cells = <0>; 211 211 compatible = "fsl,imx25-cspi", "fsl,imx35-cspi"; 212 212 reg = <0x50010000 0x4000>; 213 - clocks = <&clks 79>; 214 - clock-names = "ipg"; 213 + clocks = <&clks 79>, <&clks 79>; 214 + clock-names = "ipg", "per"; 215 215 interrupts = <13>; 216 216 status = "disabled"; 217 217 };
+3 -3
arch/arm/boot/dts/imx27.dtsi
··· 131 131 compatible = "fsl,imx27-cspi"; 132 132 reg = <0x1000e000 0x1000>; 133 133 interrupts = <16>; 134 - clocks = <&clks 53>, <&clks 0>; 134 + clocks = <&clks 53>, <&clks 53>; 135 135 clock-names = "ipg", "per"; 136 136 status = "disabled"; 137 137 }; ··· 142 142 compatible = "fsl,imx27-cspi"; 143 143 reg = <0x1000f000 0x1000>; 144 144 interrupts = <15>; 145 - clocks = <&clks 52>, <&clks 0>; 145 + clocks = <&clks 52>, <&clks 52>; 146 146 clock-names = "ipg", "per"; 147 147 status = "disabled"; 148 148 }; ··· 223 223 compatible = "fsl,imx27-cspi"; 224 224 reg = <0x10017000 0x1000>; 225 225 interrupts = <6>; 226 - clocks = <&clks 51>, <&clks 0>; 226 + clocks = <&clks 51>, <&clks 51>; 227 227 clock-names = "ipg", "per"; 228 228 status = "disabled"; 229 229 };
+1 -1
arch/arm/boot/dts/imx51.dtsi
··· 631 631 compatible = "fsl,imx51-cspi", "fsl,imx35-cspi"; 632 632 reg = <0x83fc0000 0x4000>; 633 633 interrupts = <38>; 634 - clocks = <&clks 55>, <&clks 0>; 634 + clocks = <&clks 55>, <&clks 55>; 635 635 clock-names = "ipg", "per"; 636 636 status = "disabled"; 637 637 };
+1 -1
arch/arm/boot/dts/imx53.dtsi
··· 714 714 compatible = "fsl,imx53-cspi", "fsl,imx35-cspi"; 715 715 reg = <0x63fc0000 0x4000>; 716 716 interrupts = <38>; 717 - clocks = <&clks 55>, <&clks 0>; 717 + clocks = <&clks 55>, <&clks 55>; 718 718 clock-names = "ipg", "per"; 719 719 status = "disabled"; 720 720 };
+4 -23
arch/arm/include/asm/tlb.h
··· 33 33 #include <asm/pgalloc.h> 34 34 #include <asm/tlbflush.h> 35 35 36 - /* 37 - * We need to delay page freeing for SMP as other CPUs can access pages 38 - * which have been removed but not yet had their TLB entries invalidated. 39 - * Also, as ARMv7 speculative prefetch can drag new entries into the TLB, 40 - * we need to apply this same delaying tactic to ensure correct operation. 41 - */ 42 - #if defined(CONFIG_SMP) || defined(CONFIG_CPU_32v7) 43 - #define tlb_fast_mode(tlb) 0 44 - #else 45 - #define tlb_fast_mode(tlb) 1 46 - #endif 47 - 48 36 #define MMU_GATHER_BUNDLE 8 49 37 50 38 /* ··· 100 112 static inline void tlb_flush_mmu(struct mmu_gather *tlb) 101 113 { 102 114 tlb_flush(tlb); 103 - if (!tlb_fast_mode(tlb)) { 104 - free_pages_and_swap_cache(tlb->pages, tlb->nr); 105 - tlb->nr = 0; 106 - if (tlb->pages == tlb->local) 107 - __tlb_alloc_page(tlb); 108 - } 115 + free_pages_and_swap_cache(tlb->pages, tlb->nr); 116 + tlb->nr = 0; 117 + if (tlb->pages == tlb->local) 118 + __tlb_alloc_page(tlb); 109 119 } 110 120 111 121 static inline void ··· 164 178 165 179 static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) 166 180 { 167 - if (tlb_fast_mode(tlb)) { 168 - free_page_and_swap_cache(page); 169 - return 1; /* avoid calling tlb_flush_mmu */ 170 - } 171 - 172 181 tlb->pages[tlb->nr++] = page; 173 182 VM_BUG_ON(tlb->nr > tlb->max); 174 183 return tlb->max - tlb->nr;
+13 -2
arch/arm/kvm/arm.c
··· 492 492 wait_event_interruptible(*wq, !vcpu->arch.pause); 493 493 } 494 494 495 + static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu) 496 + { 497 + return vcpu->arch.target >= 0; 498 + } 499 + 495 500 /** 496 501 * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code 497 502 * @vcpu: The VCPU pointer ··· 513 508 int ret; 514 509 sigset_t sigsaved; 515 510 516 - /* Make sure they initialize the vcpu with KVM_ARM_VCPU_INIT */ 517 - if (unlikely(vcpu->arch.target < 0)) 511 + if (unlikely(!kvm_vcpu_initialized(vcpu))) 518 512 return -ENOEXEC; 519 513 520 514 ret = kvm_vcpu_first_run_init(vcpu); ··· 714 710 case KVM_SET_ONE_REG: 715 711 case KVM_GET_ONE_REG: { 716 712 struct kvm_one_reg reg; 713 + 714 + if (unlikely(!kvm_vcpu_initialized(vcpu))) 715 + return -ENOEXEC; 716 + 717 717 if (copy_from_user(&reg, argp, sizeof(reg))) 718 718 return -EFAULT; 719 719 if (ioctl == KVM_SET_ONE_REG) ··· 729 721 struct kvm_reg_list __user *user_list = argp; 730 722 struct kvm_reg_list reg_list; 731 723 unsigned n; 724 + 725 + if (unlikely(!kvm_vcpu_initialized(vcpu))) 726 + return -ENOEXEC; 732 727 733 728 if (copy_from_user(&reg_list, user_list, sizeof(reg_list))) 734 729 return -EFAULT;
+26 -15
arch/arm/kvm/mmu.c
··· 43 43 44 44 static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) 45 45 { 46 - kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa); 46 + /* 47 + * This function also gets called when dealing with HYP page 48 + * tables. As HYP doesn't have an associated struct kvm (and 49 + * the HYP page tables are fairly static), we don't do 50 + * anything there. 51 + */ 52 + if (kvm) 53 + kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa); 47 54 } 48 55 49 56 static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache, ··· 85 78 return p; 86 79 } 87 80 88 - static void clear_pud_entry(pud_t *pud) 81 + static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr) 89 82 { 90 83 pmd_t *pmd_table = pmd_offset(pud, 0); 91 84 pud_clear(pud); 85 + kvm_tlb_flush_vmid_ipa(kvm, addr); 92 86 pmd_free(NULL, pmd_table); 93 87 put_page(virt_to_page(pud)); 94 88 } 95 89 96 - static void clear_pmd_entry(pmd_t *pmd) 90 + static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr) 97 91 { 98 92 pte_t *pte_table = pte_offset_kernel(pmd, 0); 99 93 pmd_clear(pmd); 94 + kvm_tlb_flush_vmid_ipa(kvm, addr); 100 95 pte_free_kernel(NULL, pte_table); 101 96 put_page(virt_to_page(pmd)); 102 97 } ··· 109 100 return page_count(pmd_page) == 1; 110 101 } 111 102 112 - static void clear_pte_entry(pte_t *pte) 103 + static void clear_pte_entry(struct kvm *kvm, pte_t *pte, phys_addr_t addr) 113 104 { 114 105 if (pte_present(*pte)) { 115 106 kvm_set_pte(pte, __pte(0)); 116 107 put_page(virt_to_page(pte)); 108 + kvm_tlb_flush_vmid_ipa(kvm, addr); 117 109 } 118 110 } 119 111 ··· 124 114 return page_count(pte_page) == 1; 125 115 } 126 116 127 - static void unmap_range(pgd_t *pgdp, unsigned long long start, u64 size) 117 + static void unmap_range(struct kvm *kvm, pgd_t *pgdp, 118 + unsigned long long start, u64 size) 128 119 { 129 120 pgd_t *pgd; 130 121 pud_t *pud; ··· 149 138 } 150 139 151 140 pte = pte_offset_kernel(pmd, addr); 152 - clear_pte_entry(pte); 141 + clear_pte_entry(kvm, pte, addr); 153 142 range = PAGE_SIZE; 154 143 155 144 /* If we emptied the pte, walk back up the ladder */ 156 145 if (pte_empty(pte)) { 157 - clear_pmd_entry(pmd); 146 + clear_pmd_entry(kvm, pmd, addr); 158 147 range = PMD_SIZE; 159 148 if (pmd_empty(pmd)) { 160 - clear_pud_entry(pud); 149 + clear_pud_entry(kvm, pud, addr); 161 150 range = PUD_SIZE; 162 151 } 163 152 } ··· 176 165 mutex_lock(&kvm_hyp_pgd_mutex); 177 166 178 167 if (boot_hyp_pgd) { 179 - unmap_range(boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); 180 - unmap_range(boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); 168 + unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); 169 + unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); 181 170 kfree(boot_hyp_pgd); 182 171 boot_hyp_pgd = NULL; 183 172 } 184 173 185 174 if (hyp_pgd) 186 - unmap_range(hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); 175 + unmap_range(NULL, hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); 187 176 188 177 kfree(init_bounce_page); 189 178 init_bounce_page = NULL; ··· 211 200 212 201 if (hyp_pgd) { 213 202 for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE) 214 - unmap_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 203 + unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 215 204 for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE) 216 - unmap_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 205 + unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 206 + 217 207 kfree(hyp_pgd); 218 208 hyp_pgd = NULL; 219 209 } ··· 405 393 */ 406 394 static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size) 407 395 { 408 - unmap_range(kvm->arch.pgd, start, size); 396 + unmap_range(kvm, kvm->arch.pgd, start, size); 409 397 } 410 398 411 399 /** ··· 687 675 static void kvm_unmap_hva_handler(struct kvm *kvm, gpa_t gpa, void *data) 688 676 { 689 677 unmap_stage2_range(kvm, gpa, PAGE_SIZE); 690 - kvm_tlb_flush_vmid_ipa(kvm, gpa); 691 678 } 692 679 693 680 int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
+2
arch/arm/mach-exynos/common.c
··· 386 386 387 387 void __init exynos_init_io(struct map_desc *mach_desc, int size) 388 388 { 389 + debug_ll_io_init(); 390 + 389 391 #ifdef CONFIG_OF 390 392 if (initial_boot_params) 391 393 of_scan_flat_dt(exynos_fdt_map_chipid, NULL);
+2 -2
arch/arm/mach-imx/clk-imx6q.c
··· 181 181 static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", }; 182 182 static const char *periph_sels[] = { "periph_pre", "periph_clk2", }; 183 183 static const char *periph2_sels[] = { "periph2_pre", "periph2_clk2", }; 184 - static const char *axi_sels[] = { "periph", "pll2_pfd2_396m", "pll3_pfd1_540m", }; 184 + static const char *axi_sels[] = { "periph", "pll2_pfd2_396m", "periph", "pll3_pfd1_540m", }; 185 185 static const char *audio_sels[] = { "pll4_post_div", "pll3_pfd2_508m", "pll3_pfd3_454m", "pll3_usb_otg", }; 186 186 static const char *gpu_axi_sels[] = { "axi", "ahb", }; 187 187 static const char *gpu2d_core_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", }; 188 188 static const char *gpu3d_core_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd2_396m", }; 189 189 static const char *gpu3d_shader_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll3_pfd0_720m", }; 190 190 static const char *ipu_sels[] = { "mmdc_ch0_axi", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", }; 191 - static const char *ldb_di_sels[] = { "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", }; 191 + static const char *ldb_di_sels[] = { "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", }; 192 192 static const char *ipu_di_pre_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd1_540m", }; 193 193 static const char *ipu1_di0_sels[] = { "ipu1_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", }; 194 194 static const char *ipu1_di1_sels[] = { "ipu1_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
-10
arch/arm/mach-kirkwood/board-ts219.c
··· 41 41 42 42 pm_power_off = qnap_tsx1x_power_off; 43 43 } 44 - 45 - /* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */ 46 - static int __init ts219_pci_init(void) 47 - { 48 - if (machine_is_ts219()) 49 - kirkwood_pcie_init(KW_PCIE0); 50 - 51 - return 0; 52 - } 53 - subsys_initcall(ts219_pci_init);
+11 -5
arch/arm/mach-mvebu/coherency_ll.S
··· 32 32 33 33 /* Add CPU to SMP group - Atomic */ 34 34 add r3, r0, #ARMADA_XP_CFB_CTL_REG_OFFSET 35 - ldr r2, [r3] 35 + 1: 36 + ldrex r2, [r3] 36 37 orr r2, r2, r1 37 - str r2, [r3] 38 + strex r0, r2, [r3] 39 + cmp r0, #0 40 + bne 1b 38 41 39 42 /* Enable coherency on CPU - Atomic */ 40 - add r3, r0, #ARMADA_XP_CFB_CFG_REG_OFFSET 41 - ldr r2, [r3] 43 + add r3, r3, #ARMADA_XP_CFB_CFG_REG_OFFSET 44 + 1: 45 + ldrex r2, [r3] 42 46 orr r2, r2, r1 43 - str r2, [r3] 47 + strex r0, r2, [r3] 48 + cmp r0, #0 49 + bne 1b 44 50 45 51 dsb 46 52
+2 -1
arch/arm/mach-omap2/board-cm-t35.c
··· 293 293 static struct regulator_consumer_supply cm_t35_vio_supplies[] = { 294 294 REGULATOR_SUPPLY("vcc", "spi1.0"), 295 295 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 296 - REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), 296 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 297 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 297 298 }; 298 299 299 300 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
+1
arch/arm/mach-omap2/board-devkit8000.c
··· 222 222 223 223 static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = { 224 224 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 225 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 225 226 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 226 227 }; 227 228
+2 -1
arch/arm/mach-omap2/board-ldp.c
··· 272 272 273 273 static struct regulator_consumer_supply ldp_vpll2_supplies[] = { 274 274 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 275 - REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), 275 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 276 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 276 277 }; 277 278 278 279 static struct regulator_init_data ldp_vpll2 = {
+1
arch/arm/mach-omap2/board-omap3pandora.c
··· 343 343 static struct regulator_consumer_supply pandora_vdds_supplies[] = { 344 344 REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 345 345 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 346 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 346 347 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 347 348 }; 348 349
+1
arch/arm/mach-omap2/board-rx51-peripherals.c
··· 553 553 554 554 static struct regulator_consumer_supply rx51_vaux1_consumers[] = { 555 555 REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 556 + REGULATOR_SUPPLY("vdds_sdi", "omapdss_sdi.0"), 556 557 /* Si4713 supply */ 557 558 REGULATOR_SUPPLY("vdd", "2-0063"), 558 559 /* lis3lv02d */
+1
arch/arm/mach-omap2/control.c
··· 249 249 u32 offset = cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTADDR : 250 250 cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTADDR : 251 251 cpu_is_omap44xx() ? OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR : 252 + soc_is_omap54xx() ? OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR : 252 253 0; 253 254 254 255 if (!offset) {
+3 -9
arch/arm/mach-omap2/devices.c
··· 374 374 struct platform_device *pdev; 375 375 376 376 oh = omap_hwmod_lookup("mcpdm"); 377 - if (!oh) { 378 - printk(KERN_ERR "Could not look up mcpdm hw_mod\n"); 377 + if (!oh) 379 378 return; 380 - } 381 379 382 380 pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0); 383 381 WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n"); ··· 393 395 struct platform_device *pdev; 394 396 395 397 oh = omap_hwmod_lookup("dmic"); 396 - if (!oh) { 397 - pr_err("Could not look up dmic hw_mod\n"); 398 + if (!oh) 398 399 return; 399 - } 400 400 401 401 pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0); 402 402 WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n"); ··· 417 421 struct platform_device *pdev; 418 422 419 423 oh = omap_hwmod_lookup("dss_hdmi"); 420 - if (!oh) { 421 - printk(KERN_ERR "Could not look up dss_hdmi hw_mod\n"); 424 + if (!oh) 422 425 return; 423 - } 424 426 425 427 pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0); 426 428 WARN(IS_ERR(pdev),
+1 -1
arch/arm/mach-omap2/id.c
··· 601 601 602 602 #ifdef CONFIG_SOC_BUS 603 603 604 - static const char const *omap_types[] = { 604 + static const char * const omap_types[] = { 605 605 [OMAP2_DEVICE_TYPE_TEST] = "TST", 606 606 [OMAP2_DEVICE_TYPE_EMU] = "EMU", 607 607 [OMAP2_DEVICE_TYPE_SEC] = "HS",
+3
arch/arm/mach-omap2/serial.c
··· 176 176 177 177 static int __init omap_serial_early_init(void) 178 178 { 179 + if (of_have_populated_dt()) 180 + return -ENODEV; 181 + 179 182 do { 180 183 char oh_name[MAX_UART_HWMOD_NAME_LEN]; 181 184 struct omap_hwmod *oh;
+1
arch/arm/mach-omap2/twl-common.c
··· 140 140 141 141 static struct regulator_consumer_supply omap3_vpll2_supplies[] = { 142 142 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 143 + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 143 144 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 144 145 }; 145 146
+56 -50
arch/arm/mach-omap2/usb-host.c
··· 28 28 #include <linux/io.h> 29 29 #include <linux/gpio.h> 30 30 #include <linux/usb/phy.h> 31 + #include <linux/usb/nop-usb-xceiv.h> 31 32 32 33 #include "soc.h" 33 34 #include "omap_device.h" ··· 561 560 struct regulator_init_data *reg_data; 562 561 struct fixed_voltage_config *config; 563 562 struct platform_device *pdev; 564 - int ret; 563 + struct platform_device_info pdevinfo; 564 + int ret = -ENOMEM; 565 565 566 566 supplies = kzalloc(sizeof(*supplies), GFP_KERNEL); 567 567 if (!supplies) ··· 573 571 574 572 reg_data = kzalloc(sizeof(*reg_data), GFP_KERNEL); 575 573 if (!reg_data) 576 - return -ENOMEM; 574 + goto err_data; 577 575 578 576 reg_data->constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS; 579 577 reg_data->consumer_supplies = supplies; ··· 582 580 config = kmemdup(&hsusb_reg_config, sizeof(hsusb_reg_config), 583 581 GFP_KERNEL); 584 582 if (!config) 585 - return -ENOMEM; 583 + goto err_config; 586 584 587 - config->supply_name = name; 585 + config->supply_name = kstrdup(name, GFP_KERNEL); 586 + if (!config->supply_name) 587 + goto err_supplyname; 588 + 588 589 config->gpio = gpio; 589 590 config->enable_high = polarity; 590 591 config->init_data = reg_data; 591 592 592 593 /* create a regulator device */ 593 - pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); 594 - if (!pdev) 595 - return -ENOMEM; 594 + memset(&pdevinfo, 0, sizeof(pdevinfo)); 595 + pdevinfo.name = reg_name; 596 + pdevinfo.id = PLATFORM_DEVID_AUTO; 597 + pdevinfo.data = config; 598 + pdevinfo.size_data = sizeof(*config); 596 599 597 - pdev->id = PLATFORM_DEVID_AUTO; 598 - pdev->name = reg_name; 599 - pdev->dev.platform_data = config; 600 + pdev = platform_device_register_full(&pdevinfo); 601 + if (IS_ERR(pdev)) { 602 + ret = PTR_ERR(pdev); 603 + pr_err("%s: Failed registering regulator %s for %s : %d\n", 604 + __func__, name, dev_id, ret); 605 + goto err_register; 606 + } 600 607 601 - ret = platform_device_register(pdev); 602 - if (ret) 603 - pr_err("%s: Failed registering regulator %s for %s\n", 604 - __func__, name, dev_id); 608 + return 0; 605 609 610 + err_register: 611 + kfree(config->supply_name); 612 + err_supplyname: 613 + kfree(config); 614 + err_config: 615 + kfree(reg_data); 616 + err_data: 617 + kfree(supplies); 606 618 return ret; 607 619 } 608 620 621 + #define MAX_STR 20 622 + 609 623 int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys) 610 624 { 611 - char *rail_name; 612 - int i, len; 625 + char rail_name[MAX_STR]; 626 + int i; 613 627 struct platform_device *pdev; 614 628 char *phy_id; 615 - 616 - /* the phy_id will be something like "nop_usb_xceiv.1" */ 617 - len = strlen(nop_name) + 3; /* 3 -> ".1" and NULL terminator */ 629 + struct platform_device_info pdevinfo; 618 630 619 631 for (i = 0; i < num_phys; i++) { 620 632 ··· 643 627 !gpio_is_valid(phy->vcc_gpio)) 644 628 continue; 645 629 630 + phy_id = kmalloc(MAX_STR, GFP_KERNEL); 631 + if (!phy_id) { 632 + pr_err("%s: kmalloc() failed\n", __func__); 633 + return -ENOMEM; 634 + } 635 + 646 636 /* create a NOP PHY device */ 647 - pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); 648 - if (!pdev) 649 - return -ENOMEM; 637 + memset(&pdevinfo, 0, sizeof(pdevinfo)); 638 + pdevinfo.name = nop_name; 639 + pdevinfo.id = phy->port; 640 + pdevinfo.data = phy->platform_data; 641 + pdevinfo.size_data = sizeof(struct nop_usb_xceiv_platform_data); 650 642 651 - pdev->id = phy->port; 652 - pdev->name = nop_name; 653 - pdev->dev.platform_data = phy->platform_data; 654 - 655 - phy_id = kmalloc(len, GFP_KERNEL); 656 - if (!phy_id) 657 - return -ENOMEM; 658 - 659 - scnprintf(phy_id, len, "nop_usb_xceiv.%d\n", 660 - pdev->id); 661 - 662 - if (platform_device_register(pdev)) { 663 - pr_err("%s: Failed to register device %s\n", 664 - __func__, phy_id); 643 + scnprintf(phy_id, MAX_STR, "nop_usb_xceiv.%d", 644 + phy->port); 645 + pdev = platform_device_register_full(&pdevinfo); 646 + if (IS_ERR(pdev)) { 647 + pr_err("%s: Failed to register device %s : %ld\n", 648 + __func__, phy_id, PTR_ERR(pdev)); 649 + kfree(phy_id); 665 650 continue; 666 651 } 667 652 ··· 670 653 671 654 /* Do we need RESET regulator ? */ 672 655 if (gpio_is_valid(phy->reset_gpio)) { 673 - 674 - rail_name = kmalloc(13, GFP_KERNEL); 675 - if (!rail_name) 676 - return -ENOMEM; 677 - 678 - scnprintf(rail_name, 13, "hsusb%d_reset", phy->port); 679 - 656 + scnprintf(rail_name, MAX_STR, 657 + "hsusb%d_reset", phy->port); 680 658 usbhs_add_regulator(rail_name, phy_id, "reset", 681 659 phy->reset_gpio, 1); 682 660 } 683 661 684 662 /* Do we need VCC regulator ? */ 685 663 if (gpio_is_valid(phy->vcc_gpio)) { 686 - 687 - rail_name = kmalloc(13, GFP_KERNEL); 688 - if (!rail_name) 689 - return -ENOMEM; 690 - 691 - scnprintf(rail_name, 13, "hsusb%d_vcc", phy->port); 692 - 664 + scnprintf(rail_name, MAX_STR, "hsusb%d_vcc", phy->port); 693 665 usbhs_add_regulator(rail_name, phy_id, "vcc", 694 666 phy->vcc_gpio, phy->vcc_polarity); 695 667 }
+1 -1
arch/arm/mach-shmobile/setup-sh73a0.c
··· 252 252 .name = "CMT10", 253 253 .channel_offset = 0x10, 254 254 .timer_bit = 0, 255 - .clockevent_rating = 125, 255 + .clockevent_rating = 80, 256 256 .clocksource_rating = 125, 257 257 }; 258 258
+3
arch/arm/mach-ux500/board-mop500-regulators.c
··· 374 374 static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = { 375 375 /* supplies to the display/camera */ 376 376 [AB8500_LDO_AUX1] = { 377 + .supply_regulator = "ab8500-ext-supply3", 377 378 .constraints = { 378 379 .name = "V-DISPLAY", 379 380 .min_uV = 2800000, ··· 388 387 }, 389 388 /* supplies to the on-board eMMC */ 390 389 [AB8500_LDO_AUX2] = { 390 + .supply_regulator = "ab8500-ext-supply3", 391 391 .constraints = { 392 392 .name = "V-eMMC1", 393 393 .min_uV = 1100000, ··· 404 402 }, 405 403 /* supply for VAUX3, supplies to SDcard slots */ 406 404 [AB8500_LDO_AUX3] = { 405 + .supply_regulator = "ab8500-ext-supply3", 407 406 .constraints = { 408 407 .name = "V-MMC-SD", 409 408 .min_uV = 1100000,
+4
arch/arm/mach-ux500/cpuidle.c
··· 21 21 #include <asm/proc-fns.h> 22 22 23 23 #include "db8500-regs.h" 24 + #include "id.h" 24 25 25 26 static atomic_t master = ATOMIC_INIT(0); 26 27 static DEFINE_SPINLOCK(master_lock); ··· 115 114 116 115 int __init ux500_idle_init(void) 117 116 { 117 + if (!(cpu_is_u8500_family() || cpu_is_ux540_family())) 118 + return -ENODEV; 119 + 118 120 /* Configure wake up reasons */ 119 121 prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | 120 122 PRCMU_WAKEUP(ABB));
+9 -1
arch/arm/plat-samsung/include/plat/uncompress.h
··· 66 66 67 67 static void putc(int ch) 68 68 { 69 + if (!config_enabled(CONFIG_DEBUG_LL)) 70 + return; 71 + 69 72 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) { 70 73 int level; 71 74 ··· 121 118 #ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO 122 119 static inline void arch_enable_uart_fifo(void) 123 120 { 124 - u32 fifocon = uart_rd(S3C2410_UFCON); 121 + u32 fifocon; 122 + 123 + if (!config_enabled(CONFIG_DEBUG_LL)) 124 + return; 125 + 126 + fifocon = uart_rd(S3C2410_UFCON); 125 127 126 128 if (!(fifocon & S3C2410_UFCON_FIFOMODE)) { 127 129 fifocon |= S3C2410_UFCON_RESETBOTH;
+8 -33
arch/ia64/include/asm/tlb.h
··· 46 46 #include <asm/tlbflush.h> 47 47 #include <asm/machvec.h> 48 48 49 - #ifdef CONFIG_SMP 50 - # define tlb_fast_mode(tlb) ((tlb)->nr == ~0U) 51 - #else 52 - # define tlb_fast_mode(tlb) (1) 53 - #endif 54 - 55 49 /* 56 50 * If we can't allocate a page to make a big batch of page pointers 57 51 * to work on, then just handle a few from the on-stack structure. ··· 54 60 55 61 struct mmu_gather { 56 62 struct mm_struct *mm; 57 - unsigned int nr; /* == ~0U => fast mode */ 63 + unsigned int nr; 58 64 unsigned int max; 59 65 unsigned char fullmm; /* non-zero means full mm flush */ 60 66 unsigned char need_flush; /* really unmapped some PTEs? */ ··· 97 103 static inline void 98 104 ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) 99 105 { 106 + unsigned long i; 100 107 unsigned int nr; 101 108 102 109 if (!tlb->need_flush) ··· 136 141 137 142 /* lastly, release the freed pages */ 138 143 nr = tlb->nr; 139 - if (!tlb_fast_mode(tlb)) { 140 - unsigned long i; 141 - tlb->nr = 0; 142 - tlb->start_addr = ~0UL; 143 - for (i = 0; i < nr; ++i) 144 - free_page_and_swap_cache(tlb->pages[i]); 145 - } 144 + 145 + tlb->nr = 0; 146 + tlb->start_addr = ~0UL; 147 + for (i = 0; i < nr; ++i) 148 + free_page_and_swap_cache(tlb->pages[i]); 146 149 } 147 150 148 151 static inline void __tlb_alloc_page(struct mmu_gather *tlb) ··· 160 167 tlb->mm = mm; 161 168 tlb->max = ARRAY_SIZE(tlb->local); 162 169 tlb->pages = tlb->local; 163 - /* 164 - * Use fast mode if only 1 CPU is online. 165 - * 166 - * It would be tempting to turn on fast-mode for full_mm_flush as well. But this 167 - * doesn't work because of speculative accesses and software prefetching: the page 168 - * table of "mm" may (and usually is) the currently active page table and even 169 - * though the kernel won't do any user-space accesses during the TLB shoot down, a 170 - * compiler might use speculation or lfetch.fault on what happens to be a valid 171 - * user-space address. This in turn could trigger a TLB miss fault (or a VHPT 172 - * walk) and re-insert a TLB entry we just removed. Slow mode avoids such 173 - * problems. (We could make fast-mode work by switching the current task to a 174 - * different "mm" during the shootdown.) --davidm 08/02/2002 175 - */ 176 - tlb->nr = (num_online_cpus() == 1) ? ~0U : 0; 170 + tlb->nr = 0; 177 171 tlb->fullmm = full_mm_flush; 178 172 tlb->start_addr = ~0UL; 179 173 } ··· 193 213 static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) 194 214 { 195 215 tlb->need_flush = 1; 196 - 197 - if (tlb_fast_mode(tlb)) { 198 - free_page_and_swap_cache(page); 199 - return 1; /* avoid calling tlb_flush_mmu */ 200 - } 201 216 202 217 if (!tlb->nr && tlb->pages == tlb->local) 203 218 __tlb_alloc_page(tlb);
+2 -1
arch/m68k/include/asm/gpio.h
··· 86 86 return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio); 87 87 } 88 88 89 + #ifndef CONFIG_GPIOLIB 89 90 static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) 90 91 { 91 92 int err; ··· 106 105 107 106 return err; 108 107 } 109 - 108 + #endif /* !CONFIG_GPIOLIB */ 110 109 #endif
+19 -10
arch/m68k/kernel/head.S
··· 2752 2752 #ifdef CONFIG_MAC 2753 2753 2754 2754 L(scc_initable_mac): 2755 - .byte 9,12 /* Reset */ 2756 2755 .byte 4,0x44 /* x16, 1 stopbit, no parity */ 2757 2756 .byte 3,0xc0 /* receiver: 8 bpc */ 2758 2757 .byte 5,0xe2 /* transmitter: 8 bpc, assert dtr/rts */ 2759 - .byte 9,0 /* no interrupts */ 2760 2758 .byte 10,0 /* NRZ */ 2761 2759 .byte 11,0x50 /* use baud rate generator */ 2762 2760 .byte 12,1,13,0 /* 38400 baud */ ··· 2897 2899 is_not_mac(L(serial_init_not_mac)) 2898 2900 2899 2901 #ifdef SERIAL_DEBUG 2902 + 2900 2903 /* You may define either or both of these. */ 2901 2904 #define MAC_USE_SCC_A /* Modem port */ 2902 2905 #define MAC_USE_SCC_B /* Printer port */ ··· 2907 2908 #define mac_scc_cha_b_data_offset 0x4 2908 2909 #define mac_scc_cha_a_data_offset 0x6 2909 2910 2911 + #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) 2912 + movel %pc@(L(mac_sccbase)),%a0 2913 + /* Reset SCC device */ 2914 + moveb #9,%a0@(mac_scc_cha_a_ctrl_offset) 2915 + moveb #0xc0,%a0@(mac_scc_cha_a_ctrl_offset) 2916 + /* Wait for 5 PCLK cycles, which is about 68 CPU cycles */ 2917 + /* 5 / 3.6864 MHz = approx. 1.36 us = 68 / 50 MHz */ 2918 + movel #35,%d0 2919 + 5: 2920 + subq #1,%d0 2921 + jne 5b 2922 + #endif 2923 + 2910 2924 #ifdef MAC_USE_SCC_A 2911 2925 /* Initialize channel A */ 2912 - movel %pc@(L(mac_sccbase)),%a0 2913 2926 lea %pc@(L(scc_initable_mac)),%a1 2914 2927 5: moveb %a1@+,%d0 2915 2928 jmi 6f ··· 2933 2922 2934 2923 #ifdef MAC_USE_SCC_B 2935 2924 /* Initialize channel B */ 2936 - #ifndef MAC_USE_SCC_A /* Load mac_sccbase only if needed */ 2937 - movel %pc@(L(mac_sccbase)),%a0 2938 - #endif /* MAC_USE_SCC_A */ 2939 2925 lea %pc@(L(scc_initable_mac)),%a1 2940 2926 7: moveb %a1@+,%d0 2941 2927 jmi 8f ··· 2941 2933 jra 7b 2942 2934 8: 2943 2935 #endif /* MAC_USE_SCC_B */ 2936 + 2944 2937 #endif /* SERIAL_DEBUG */ 2945 2938 2946 2939 jra L(serial_init_done) ··· 3015 3006 3016 3007 #ifdef SERIAL_DEBUG 3017 3008 3018 - #ifdef MAC_USE_SCC_A 3009 + #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) 3019 3010 movel %pc@(L(mac_sccbase)),%a1 3011 + #endif 3012 + 3013 + #ifdef MAC_USE_SCC_A 3020 3014 3: btst #2,%a1@(mac_scc_cha_a_ctrl_offset) 3021 3015 jeq 3b 3022 3016 moveb %d0,%a1@(mac_scc_cha_a_data_offset) 3023 3017 #endif /* MAC_USE_SCC_A */ 3024 3018 3025 3019 #ifdef MAC_USE_SCC_B 3026 - #ifndef MAC_USE_SCC_A /* Load mac_sccbase only if needed */ 3027 - movel %pc@(L(mac_sccbase)),%a1 3028 - #endif /* MAC_USE_SCC_A */ 3029 3020 4: btst #2,%a1@(mac_scc_cha_b_ctrl_offset) 3030 3021 jeq 4b 3031 3022 moveb %d0,%a1@(mac_scc_cha_b_data_offset)
+17 -15
arch/microblaze/include/asm/cacheflush.h
··· 102 102 103 103 #define flush_cache_range(vma, start, len) do { } while (0) 104 104 105 - #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 106 - do { \ 107 - u32 addr = virt_to_phys(dst); \ 108 - memcpy((dst), (src), (len)); \ 109 - if (vma->vm_flags & VM_EXEC) { \ 110 - invalidate_icache_range((unsigned) (addr), \ 111 - (unsigned) (addr) + PAGE_SIZE); \ 112 - flush_dcache_range((unsigned) (addr), \ 113 - (unsigned) (addr) + PAGE_SIZE); \ 114 - } \ 115 - } while (0) 105 + static inline void copy_to_user_page(struct vm_area_struct *vma, 106 + struct page *page, unsigned long vaddr, 107 + void *dst, void *src, int len) 108 + { 109 + u32 addr = virt_to_phys(dst); 110 + memcpy(dst, src, len); 111 + if (vma->vm_flags & VM_EXEC) { 112 + invalidate_icache_range(addr, addr + PAGE_SIZE); 113 + flush_dcache_range(addr, addr + PAGE_SIZE); 114 + } 115 + } 116 116 117 - #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 118 - do { \ 119 - memcpy((dst), (src), (len)); \ 120 - } while (0) 117 + static inline void copy_from_user_page(struct vm_area_struct *vma, 118 + struct page *page, unsigned long vaddr, 119 + void *dst, void *src, int len) 120 + { 121 + memcpy(dst, src, len); 122 + } 121 123 122 124 #endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */
+2 -2
arch/microblaze/include/asm/uaccess.h
··· 99 99 if ((get_fs().seg < ((unsigned long)addr)) || 100 100 (get_fs().seg < ((unsigned long)addr + size - 1))) { 101 101 pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n", 102 - type ? "WRITE" : "READ ", (u32)addr, (u32)size, 102 + type ? "WRITE" : "READ ", (__force u32)addr, (u32)size, 103 103 (u32)get_fs().seg); 104 104 return 0; 105 105 } 106 106 ok: 107 107 pr_debug("ACCESS OK: %s at 0x%08x (size 0x%x), seg 0x%08x\n", 108 - type ? "WRITE" : "READ ", (u32)addr, (u32)size, 108 + type ? "WRITE" : "READ ", (__force u32)addr, (u32)size, 109 109 (u32)get_fs().seg); 110 110 return 1; 111 111 }
+9 -6
arch/mips/cavium-octeon/setup.c
··· 428 428 */ 429 429 static void octeon_kill_core(void *arg) 430 430 { 431 - mb(); 432 - if (octeon_is_simulation()) { 433 - /* The simulator needs the watchdog to stop for dead cores */ 434 - cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0); 431 + if (octeon_is_simulation()) 435 432 /* A break instruction causes the simulator stop a core */ 436 - asm volatile ("sync\nbreak"); 437 - } 433 + asm volatile ("break" ::: "memory"); 434 + 435 + local_irq_disable(); 436 + /* Disable watchdog on this core. */ 437 + cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0); 438 + /* Spin in a low power mode. */ 439 + while (true) 440 + asm volatile ("wait" ::: "memory"); 438 441 } 439 442 440 443
-4
arch/mips/include/asm/kvm_host.h
··· 496 496 uint32_t cause); 497 497 int (*irq_clear) (struct kvm_vcpu *vcpu, unsigned int priority, 498 498 uint32_t cause); 499 - int (*vcpu_ioctl_get_regs) (struct kvm_vcpu *vcpu, 500 - struct kvm_regs *regs); 501 - int (*vcpu_ioctl_set_regs) (struct kvm_vcpu *vcpu, 502 - struct kvm_regs *regs); 503 499 }; 504 500 extern struct kvm_mips_callbacks *kvm_mips_callbacks; 505 501 int kvm_mips_emulation_init(struct kvm_mips_callbacks **install_callbacks);
+32
arch/mips/include/asm/ptrace.h
··· 16 16 #include <asm/isadep.h> 17 17 #include <uapi/asm/ptrace.h> 18 18 19 + /* 20 + * This struct defines the way the registers are stored on the stack during a 21 + * system call/exception. As usual the registers k0/k1 aren't being saved. 22 + */ 23 + struct pt_regs { 24 + #ifdef CONFIG_32BIT 25 + /* Pad bytes for argument save space on the stack. */ 26 + unsigned long pad0[6]; 27 + #endif 28 + 29 + /* Saved main processor registers. */ 30 + unsigned long regs[32]; 31 + 32 + /* Saved special registers. */ 33 + unsigned long cp0_status; 34 + unsigned long hi; 35 + unsigned long lo; 36 + #ifdef CONFIG_CPU_HAS_SMARTMIPS 37 + unsigned long acx; 38 + #endif 39 + unsigned long cp0_badvaddr; 40 + unsigned long cp0_cause; 41 + unsigned long cp0_epc; 42 + #ifdef CONFIG_MIPS_MT_SMTC 43 + unsigned long cp0_tcstatus; 44 + #endif /* CONFIG_MIPS_MT_SMTC */ 45 + #ifdef CONFIG_CPU_CAVIUM_OCTEON 46 + unsigned long long mpl[3]; /* MTM{0,1,2} */ 47 + unsigned long long mtp[3]; /* MTP{0,1,2} */ 48 + #endif 49 + } __aligned(8); 50 + 19 51 struct task_struct; 20 52 21 53 extern int ptrace_getregs(struct task_struct *child, __s64 __user *data);
+110 -27
arch/mips/include/uapi/asm/kvm.h
··· 1 1 /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 7 - * Authors: Sanjay Lal <sanjayl@kymasys.com> 8 - */ 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 6 + * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 7 + * Copyright (C) 2013 Cavium, Inc. 8 + * Authors: Sanjay Lal <sanjayl@kymasys.com> 9 + */ 9 10 10 11 #ifndef __LINUX_KVM_MIPS_H 11 12 #define __LINUX_KVM_MIPS_H 12 13 13 14 #include <linux/types.h> 14 15 15 - #define __KVM_MIPS 16 + /* 17 + * KVM MIPS specific structures and definitions. 18 + * 19 + * Some parts derived from the x86 version of this file. 20 + */ 16 21 17 - #define N_MIPS_COPROC_REGS 32 18 - #define N_MIPS_COPROC_SEL 8 19 - 20 - /* for KVM_GET_REGS and KVM_SET_REGS */ 22 + /* 23 + * for KVM_GET_REGS and KVM_SET_REGS 24 + * 25 + * If Config[AT] is zero (32-bit CPU), the register contents are 26 + * stored in the lower 32-bits of the struct kvm_regs fields and sign 27 + * extended to 64-bits. 28 + */ 21 29 struct kvm_regs { 22 - __u32 gprs[32]; 23 - __u32 hi; 24 - __u32 lo; 25 - __u32 pc; 26 - 27 - __u32 cp0reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL]; 30 + /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ 31 + __u64 gpr[32]; 32 + __u64 hi; 33 + __u64 lo; 34 + __u64 pc; 28 35 }; 29 36 30 - /* for KVM_GET_SREGS and KVM_SET_SREGS */ 31 - struct kvm_sregs { 32 - }; 33 - 34 - /* for KVM_GET_FPU and KVM_SET_FPU */ 37 + /* 38 + * for KVM_GET_FPU and KVM_SET_FPU 39 + * 40 + * If Status[FR] is zero (32-bit FPU), the upper 32-bits of the FPRs 41 + * are zero filled. 42 + */ 35 43 struct kvm_fpu { 44 + __u64 fpr[32]; 45 + __u32 fir; 46 + __u32 fccr; 47 + __u32 fexr; 48 + __u32 fenr; 49 + __u32 fcsr; 50 + __u32 pad; 36 51 }; 37 52 53 + 54 + /* 55 + * For MIPS, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access CP0 56 + * registers. The id field is broken down as follows: 57 + * 58 + * bits[2..0] - Register 'sel' index. 59 + * bits[7..3] - Register 'rd' index. 60 + * bits[15..8] - Must be zero. 61 + * bits[63..16] - 1 -> CP0 registers. 62 + * 63 + * Other sets registers may be added in the future. Each set would 64 + * have its own identifier in bits[63..16]. 65 + * 66 + * The addr field of struct kvm_one_reg must point to an aligned 67 + * 64-bit wide location. For registers that are narrower than 68 + * 64-bits, the value is stored in the low order bits of the location, 69 + * and sign extended to 64-bits. 70 + * 71 + * The registers defined in struct kvm_regs are also accessible, the 72 + * id values for these are below. 73 + */ 74 + 75 + #define KVM_REG_MIPS_R0 0 76 + #define KVM_REG_MIPS_R1 1 77 + #define KVM_REG_MIPS_R2 2 78 + #define KVM_REG_MIPS_R3 3 79 + #define KVM_REG_MIPS_R4 4 80 + #define KVM_REG_MIPS_R5 5 81 + #define KVM_REG_MIPS_R6 6 82 + #define KVM_REG_MIPS_R7 7 83 + #define KVM_REG_MIPS_R8 8 84 + #define KVM_REG_MIPS_R9 9 85 + #define KVM_REG_MIPS_R10 10 86 + #define KVM_REG_MIPS_R11 11 87 + #define KVM_REG_MIPS_R12 12 88 + #define KVM_REG_MIPS_R13 13 89 + #define KVM_REG_MIPS_R14 14 90 + #define KVM_REG_MIPS_R15 15 91 + #define KVM_REG_MIPS_R16 16 92 + #define KVM_REG_MIPS_R17 17 93 + #define KVM_REG_MIPS_R18 18 94 + #define KVM_REG_MIPS_R19 19 95 + #define KVM_REG_MIPS_R20 20 96 + #define KVM_REG_MIPS_R21 21 97 + #define KVM_REG_MIPS_R22 22 98 + #define KVM_REG_MIPS_R23 23 99 + #define KVM_REG_MIPS_R24 24 100 + #define KVM_REG_MIPS_R25 25 101 + #define KVM_REG_MIPS_R26 26 102 + #define KVM_REG_MIPS_R27 27 103 + #define KVM_REG_MIPS_R28 28 104 + #define KVM_REG_MIPS_R29 29 105 + #define KVM_REG_MIPS_R30 30 106 + #define KVM_REG_MIPS_R31 31 107 + 108 + #define KVM_REG_MIPS_HI 32 109 + #define KVM_REG_MIPS_LO 33 110 + #define KVM_REG_MIPS_PC 34 111 + 112 + /* 113 + * KVM MIPS specific structures and definitions 114 + * 115 + */ 38 116 struct kvm_debug_exit_arch { 117 + __u64 epc; 39 118 }; 40 119 41 120 /* for KVM_SET_GUEST_DEBUG */ 42 121 struct kvm_guest_debug_arch { 43 122 }; 44 123 124 + /* definition of registers in kvm_run */ 125 + struct kvm_sync_regs { 126 + }; 127 + 128 + /* dummy definition */ 129 + struct kvm_sregs { 130 + }; 131 + 45 132 struct kvm_mips_interrupt { 46 133 /* in */ 47 134 __u32 cpu; 48 135 __u32 irq; 49 - }; 50 - 51 - /* definition of registers in kvm_run */ 52 - struct kvm_sync_regs { 53 136 }; 54 137 55 138 #endif /* __LINUX_KVM_MIPS_H */
+2 -15
arch/mips/include/uapi/asm/ptrace.h
··· 22 22 #define DSP_CONTROL 77 23 23 #define ACX 78 24 24 25 + #ifndef __KERNEL__ 25 26 /* 26 27 * This struct defines the way the registers are stored on the stack during a 27 28 * system call/exception. As usual the registers k0/k1 aren't being saved. 28 29 */ 29 30 struct pt_regs { 30 - #ifdef CONFIG_32BIT 31 - /* Pad bytes for argument save space on the stack. */ 32 - unsigned long pad0[6]; 33 - #endif 34 - 35 31 /* Saved main processor registers. */ 36 32 unsigned long regs[32]; 37 33 ··· 35 39 unsigned long cp0_status; 36 40 unsigned long hi; 37 41 unsigned long lo; 38 - #ifdef CONFIG_CPU_HAS_SMARTMIPS 39 - unsigned long acx; 40 - #endif 41 42 unsigned long cp0_badvaddr; 42 43 unsigned long cp0_cause; 43 44 unsigned long cp0_epc; 44 - #ifdef CONFIG_MIPS_MT_SMTC 45 - unsigned long cp0_tcstatus; 46 - #endif /* CONFIG_MIPS_MT_SMTC */ 47 - #ifdef CONFIG_CPU_CAVIUM_OCTEON 48 - unsigned long long mpl[3]; /* MTM{0,1,2} */ 49 - unsigned long long mtp[3]; /* MTP{0,1,2} */ 50 - #endif 51 45 } __attribute__ ((aligned (8))); 46 + #endif /* __KERNEL__ */ 52 47 53 48 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 54 49 #define PTRACE_GETREGS 12
+11
arch/mips/kernel/binfmt_elfn32.c
··· 119 119 #undef TASK_SIZE 120 120 #define TASK_SIZE TASK_SIZE32 121 121 122 + #undef cputime_to_timeval 123 + #define cputime_to_timeval cputime_to_compat_timeval 124 + static __inline__ void 125 + cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) 126 + { 127 + unsigned long jiffies = cputime_to_jiffies(cputime); 128 + 129 + value->tv_usec = (jiffies % HZ) * (1000000L / HZ); 130 + value->tv_sec = jiffies / HZ; 131 + } 132 + 122 133 #include "../../../fs/binfmt_elf.c"
+11
arch/mips/kernel/binfmt_elfo32.c
··· 162 162 #undef TASK_SIZE 163 163 #define TASK_SIZE TASK_SIZE32 164 164 165 + #undef cputime_to_timeval 166 + #define cputime_to_timeval cputime_to_compat_timeval 167 + static __inline__ void 168 + cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) 169 + { 170 + unsigned long jiffies = cputime_to_jiffies(cputime); 171 + 172 + value->tv_usec = (jiffies % HZ) * (1000000L / HZ); 173 + value->tv_sec = jiffies / HZ; 174 + } 175 + 165 176 #include "../../../fs/binfmt_elf.c"
+1
arch/mips/kernel/rtlx.c
··· 40 40 #include <asm/processor.h> 41 41 #include <asm/vpe.h> 42 42 #include <asm/rtlx.h> 43 + #include <asm/setup.h> 43 44 44 45 static struct rtlx_info *rtlx; 45 46 static int major;
+15 -13
arch/mips/kernel/traps.c
··· 897 897 898 898 asmlinkage void do_tr(struct pt_regs *regs) 899 899 { 900 - unsigned int opcode, tcode = 0; 900 + u32 opcode, tcode = 0; 901 901 u16 instr[2]; 902 - unsigned long epc = exception_epc(regs); 902 + unsigned long epc = msk_isa16_mode(exception_epc(regs)); 903 903 904 - if ((__get_user(instr[0], (u16 __user *)msk_isa16_mode(epc))) || 905 - (__get_user(instr[1], (u16 __user *)msk_isa16_mode(epc + 2)))) 904 + if (get_isa16_mode(regs->cp0_epc)) { 905 + if (__get_user(instr[0], (u16 __user *)(epc + 0)) || 906 + __get_user(instr[1], (u16 __user *)(epc + 2))) 906 907 goto out_sigsegv; 907 - opcode = (instr[0] << 16) | instr[1]; 908 - 909 - /* Immediate versions don't provide a code. */ 910 - if (!(opcode & OPCODE)) { 911 - if (get_isa16_mode(regs->cp0_epc)) 912 - /* microMIPS */ 913 - tcode = (opcode >> 12) & 0x1f; 914 - else 915 - tcode = ((opcode >> 6) & ((1 << 10) - 1)); 908 + opcode = (instr[0] << 16) | instr[1]; 909 + /* Immediate versions don't provide a code. */ 910 + if (!(opcode & OPCODE)) 911 + tcode = (opcode >> 12) & ((1 << 4) - 1); 912 + } else { 913 + if (__get_user(opcode, (u32 __user *)epc)) 914 + goto out_sigsegv; 915 + /* Immediate versions don't provide a code. */ 916 + if (!(opcode & OPCODE)) 917 + tcode = (opcode >> 6) & ((1 << 10) - 1); 916 918 } 917 919 918 920 do_trap_or_bp(regs, tcode, "Trap");
+259 -21
arch/mips/kvm/kvm_mips.c
··· 195 195 long 196 196 kvm_arch_dev_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) 197 197 { 198 - return -EINVAL; 198 + return -ENOIOCTLCMD; 199 199 } 200 200 201 201 void kvm_arch_free_memslot(struct kvm_memory_slot *free, ··· 401 401 kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, 402 402 struct kvm_guest_debug *dbg) 403 403 { 404 - return -EINVAL; 404 + return -ENOIOCTLCMD; 405 405 } 406 406 407 407 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) ··· 475 475 kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, 476 476 struct kvm_mp_state *mp_state) 477 477 { 478 - return -EINVAL; 478 + return -ENOIOCTLCMD; 479 479 } 480 480 481 481 int 482 482 kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, 483 483 struct kvm_mp_state *mp_state) 484 484 { 485 - return -EINVAL; 485 + return -ENOIOCTLCMD; 486 + } 487 + 488 + #define KVM_REG_MIPS_CP0_INDEX (0x10000 + 8 * 0 + 0) 489 + #define KVM_REG_MIPS_CP0_ENTRYLO0 (0x10000 + 8 * 2 + 0) 490 + #define KVM_REG_MIPS_CP0_ENTRYLO1 (0x10000 + 8 * 3 + 0) 491 + #define KVM_REG_MIPS_CP0_CONTEXT (0x10000 + 8 * 4 + 0) 492 + #define KVM_REG_MIPS_CP0_USERLOCAL (0x10000 + 8 * 4 + 2) 493 + #define KVM_REG_MIPS_CP0_PAGEMASK (0x10000 + 8 * 5 + 0) 494 + #define KVM_REG_MIPS_CP0_PAGEGRAIN (0x10000 + 8 * 5 + 1) 495 + #define KVM_REG_MIPS_CP0_WIRED (0x10000 + 8 * 6 + 0) 496 + #define KVM_REG_MIPS_CP0_HWRENA (0x10000 + 8 * 7 + 0) 497 + #define KVM_REG_MIPS_CP0_BADVADDR (0x10000 + 8 * 8 + 0) 498 + #define KVM_REG_MIPS_CP0_COUNT (0x10000 + 8 * 9 + 0) 499 + #define KVM_REG_MIPS_CP0_ENTRYHI (0x10000 + 8 * 10 + 0) 500 + #define KVM_REG_MIPS_CP0_COMPARE (0x10000 + 8 * 11 + 0) 501 + #define KVM_REG_MIPS_CP0_STATUS (0x10000 + 8 * 12 + 0) 502 + #define KVM_REG_MIPS_CP0_CAUSE (0x10000 + 8 * 13 + 0) 503 + #define KVM_REG_MIPS_CP0_EBASE (0x10000 + 8 * 15 + 1) 504 + #define KVM_REG_MIPS_CP0_CONFIG (0x10000 + 8 * 16 + 0) 505 + #define KVM_REG_MIPS_CP0_CONFIG1 (0x10000 + 8 * 16 + 1) 506 + #define KVM_REG_MIPS_CP0_CONFIG2 (0x10000 + 8 * 16 + 2) 507 + #define KVM_REG_MIPS_CP0_CONFIG3 (0x10000 + 8 * 16 + 3) 508 + #define KVM_REG_MIPS_CP0_CONFIG7 (0x10000 + 8 * 16 + 7) 509 + #define KVM_REG_MIPS_CP0_XCONTEXT (0x10000 + 8 * 20 + 0) 510 + #define KVM_REG_MIPS_CP0_ERROREPC (0x10000 + 8 * 30 + 0) 511 + 512 + static u64 kvm_mips_get_one_regs[] = { 513 + KVM_REG_MIPS_R0, 514 + KVM_REG_MIPS_R1, 515 + KVM_REG_MIPS_R2, 516 + KVM_REG_MIPS_R3, 517 + KVM_REG_MIPS_R4, 518 + KVM_REG_MIPS_R5, 519 + KVM_REG_MIPS_R6, 520 + KVM_REG_MIPS_R7, 521 + KVM_REG_MIPS_R8, 522 + KVM_REG_MIPS_R9, 523 + KVM_REG_MIPS_R10, 524 + KVM_REG_MIPS_R11, 525 + KVM_REG_MIPS_R12, 526 + KVM_REG_MIPS_R13, 527 + KVM_REG_MIPS_R14, 528 + KVM_REG_MIPS_R15, 529 + KVM_REG_MIPS_R16, 530 + KVM_REG_MIPS_R17, 531 + KVM_REG_MIPS_R18, 532 + KVM_REG_MIPS_R19, 533 + KVM_REG_MIPS_R20, 534 + KVM_REG_MIPS_R21, 535 + KVM_REG_MIPS_R22, 536 + KVM_REG_MIPS_R23, 537 + KVM_REG_MIPS_R24, 538 + KVM_REG_MIPS_R25, 539 + KVM_REG_MIPS_R26, 540 + KVM_REG_MIPS_R27, 541 + KVM_REG_MIPS_R28, 542 + KVM_REG_MIPS_R29, 543 + KVM_REG_MIPS_R30, 544 + KVM_REG_MIPS_R31, 545 + 546 + KVM_REG_MIPS_HI, 547 + KVM_REG_MIPS_LO, 548 + KVM_REG_MIPS_PC, 549 + 550 + KVM_REG_MIPS_CP0_INDEX, 551 + KVM_REG_MIPS_CP0_CONTEXT, 552 + KVM_REG_MIPS_CP0_PAGEMASK, 553 + KVM_REG_MIPS_CP0_WIRED, 554 + KVM_REG_MIPS_CP0_BADVADDR, 555 + KVM_REG_MIPS_CP0_ENTRYHI, 556 + KVM_REG_MIPS_CP0_STATUS, 557 + KVM_REG_MIPS_CP0_CAUSE, 558 + /* EPC set via kvm_regs, et al. */ 559 + KVM_REG_MIPS_CP0_CONFIG, 560 + KVM_REG_MIPS_CP0_CONFIG1, 561 + KVM_REG_MIPS_CP0_CONFIG2, 562 + KVM_REG_MIPS_CP0_CONFIG3, 563 + KVM_REG_MIPS_CP0_CONFIG7, 564 + KVM_REG_MIPS_CP0_ERROREPC 565 + }; 566 + 567 + static int kvm_mips_get_reg(struct kvm_vcpu *vcpu, 568 + const struct kvm_one_reg *reg) 569 + { 570 + u64 __user *uaddr = (u64 __user *)(long)reg->addr; 571 + 572 + struct mips_coproc *cop0 = vcpu->arch.cop0; 573 + s64 v; 574 + 575 + switch (reg->id) { 576 + case KVM_REG_MIPS_R0 ... KVM_REG_MIPS_R31: 577 + v = (long)vcpu->arch.gprs[reg->id - KVM_REG_MIPS_R0]; 578 + break; 579 + case KVM_REG_MIPS_HI: 580 + v = (long)vcpu->arch.hi; 581 + break; 582 + case KVM_REG_MIPS_LO: 583 + v = (long)vcpu->arch.lo; 584 + break; 585 + case KVM_REG_MIPS_PC: 586 + v = (long)vcpu->arch.pc; 587 + break; 588 + 589 + case KVM_REG_MIPS_CP0_INDEX: 590 + v = (long)kvm_read_c0_guest_index(cop0); 591 + break; 592 + case KVM_REG_MIPS_CP0_CONTEXT: 593 + v = (long)kvm_read_c0_guest_context(cop0); 594 + break; 595 + case KVM_REG_MIPS_CP0_PAGEMASK: 596 + v = (long)kvm_read_c0_guest_pagemask(cop0); 597 + break; 598 + case KVM_REG_MIPS_CP0_WIRED: 599 + v = (long)kvm_read_c0_guest_wired(cop0); 600 + break; 601 + case KVM_REG_MIPS_CP0_BADVADDR: 602 + v = (long)kvm_read_c0_guest_badvaddr(cop0); 603 + break; 604 + case KVM_REG_MIPS_CP0_ENTRYHI: 605 + v = (long)kvm_read_c0_guest_entryhi(cop0); 606 + break; 607 + case KVM_REG_MIPS_CP0_STATUS: 608 + v = (long)kvm_read_c0_guest_status(cop0); 609 + break; 610 + case KVM_REG_MIPS_CP0_CAUSE: 611 + v = (long)kvm_read_c0_guest_cause(cop0); 612 + break; 613 + case KVM_REG_MIPS_CP0_ERROREPC: 614 + v = (long)kvm_read_c0_guest_errorepc(cop0); 615 + break; 616 + case KVM_REG_MIPS_CP0_CONFIG: 617 + v = (long)kvm_read_c0_guest_config(cop0); 618 + break; 619 + case KVM_REG_MIPS_CP0_CONFIG1: 620 + v = (long)kvm_read_c0_guest_config1(cop0); 621 + break; 622 + case KVM_REG_MIPS_CP0_CONFIG2: 623 + v = (long)kvm_read_c0_guest_config2(cop0); 624 + break; 625 + case KVM_REG_MIPS_CP0_CONFIG3: 626 + v = (long)kvm_read_c0_guest_config3(cop0); 627 + break; 628 + case KVM_REG_MIPS_CP0_CONFIG7: 629 + v = (long)kvm_read_c0_guest_config7(cop0); 630 + break; 631 + default: 632 + return -EINVAL; 633 + } 634 + return put_user(v, uaddr); 635 + } 636 + 637 + static int kvm_mips_set_reg(struct kvm_vcpu *vcpu, 638 + const struct kvm_one_reg *reg) 639 + { 640 + u64 __user *uaddr = (u64 __user *)(long)reg->addr; 641 + struct mips_coproc *cop0 = vcpu->arch.cop0; 642 + u64 v; 643 + 644 + if (get_user(v, uaddr) != 0) 645 + return -EFAULT; 646 + 647 + switch (reg->id) { 648 + case KVM_REG_MIPS_R0: 649 + /* Silently ignore requests to set $0 */ 650 + break; 651 + case KVM_REG_MIPS_R1 ... KVM_REG_MIPS_R31: 652 + vcpu->arch.gprs[reg->id - KVM_REG_MIPS_R0] = v; 653 + break; 654 + case KVM_REG_MIPS_HI: 655 + vcpu->arch.hi = v; 656 + break; 657 + case KVM_REG_MIPS_LO: 658 + vcpu->arch.lo = v; 659 + break; 660 + case KVM_REG_MIPS_PC: 661 + vcpu->arch.pc = v; 662 + break; 663 + 664 + case KVM_REG_MIPS_CP0_INDEX: 665 + kvm_write_c0_guest_index(cop0, v); 666 + break; 667 + case KVM_REG_MIPS_CP0_CONTEXT: 668 + kvm_write_c0_guest_context(cop0, v); 669 + break; 670 + case KVM_REG_MIPS_CP0_PAGEMASK: 671 + kvm_write_c0_guest_pagemask(cop0, v); 672 + break; 673 + case KVM_REG_MIPS_CP0_WIRED: 674 + kvm_write_c0_guest_wired(cop0, v); 675 + break; 676 + case KVM_REG_MIPS_CP0_BADVADDR: 677 + kvm_write_c0_guest_badvaddr(cop0, v); 678 + break; 679 + case KVM_REG_MIPS_CP0_ENTRYHI: 680 + kvm_write_c0_guest_entryhi(cop0, v); 681 + break; 682 + case KVM_REG_MIPS_CP0_STATUS: 683 + kvm_write_c0_guest_status(cop0, v); 684 + break; 685 + case KVM_REG_MIPS_CP0_CAUSE: 686 + kvm_write_c0_guest_cause(cop0, v); 687 + break; 688 + case KVM_REG_MIPS_CP0_ERROREPC: 689 + kvm_write_c0_guest_errorepc(cop0, v); 690 + break; 691 + default: 692 + return -EINVAL; 693 + } 694 + return 0; 486 695 } 487 696 488 697 long ··· 700 491 struct kvm_vcpu *vcpu = filp->private_data; 701 492 void __user *argp = (void __user *)arg; 702 493 long r; 703 - int intr; 704 494 705 495 switch (ioctl) { 496 + case KVM_SET_ONE_REG: 497 + case KVM_GET_ONE_REG: { 498 + struct kvm_one_reg reg; 499 + if (copy_from_user(&reg, argp, sizeof(reg))) 500 + return -EFAULT; 501 + if (ioctl == KVM_SET_ONE_REG) 502 + return kvm_mips_set_reg(vcpu, &reg); 503 + else 504 + return kvm_mips_get_reg(vcpu, &reg); 505 + } 506 + case KVM_GET_REG_LIST: { 507 + struct kvm_reg_list __user *user_list = argp; 508 + u64 __user *reg_dest; 509 + struct kvm_reg_list reg_list; 510 + unsigned n; 511 + 512 + if (copy_from_user(&reg_list, user_list, sizeof(reg_list))) 513 + return -EFAULT; 514 + n = reg_list.n; 515 + reg_list.n = ARRAY_SIZE(kvm_mips_get_one_regs); 516 + if (copy_to_user(user_list, &reg_list, sizeof(reg_list))) 517 + return -EFAULT; 518 + if (n < reg_list.n) 519 + return -E2BIG; 520 + reg_dest = user_list->reg; 521 + if (copy_to_user(reg_dest, kvm_mips_get_one_regs, 522 + sizeof(kvm_mips_get_one_regs))) 523 + return -EFAULT; 524 + return 0; 525 + } 706 526 case KVM_NMI: 707 527 /* Treat the NMI as a CPU reset */ 708 528 r = kvm_mips_reset_vcpu(vcpu); ··· 743 505 if (copy_from_user(&irq, argp, sizeof(irq))) 744 506 goto out; 745 507 746 - intr = (int)irq.irq; 747 - 748 508 kvm_debug("[%d] %s: irq: %d\n", vcpu->vcpu_id, __func__, 749 509 irq.irq); 750 510 ··· 750 514 break; 751 515 } 752 516 default: 753 - r = -EINVAL; 517 + r = -ENOIOCTLCMD; 754 518 } 755 519 756 520 out: ··· 801 565 802 566 switch (ioctl) { 803 567 default: 804 - r = -EINVAL; 568 + r = -ENOIOCTLCMD; 805 569 } 806 570 807 571 return r; ··· 829 593 int 830 594 kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) 831 595 { 832 - return -ENOTSUPP; 596 + return -ENOIOCTLCMD; 833 597 } 834 598 835 599 int 836 600 kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) 837 601 { 838 - return -ENOTSUPP; 602 + return -ENOIOCTLCMD; 839 603 } 840 604 841 605 int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) ··· 845 609 846 610 int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) 847 611 { 848 - return -ENOTSUPP; 612 + return -ENOIOCTLCMD; 849 613 } 850 614 851 615 int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) 852 616 { 853 - return -ENOTSUPP; 617 + return -ENOIOCTLCMD; 854 618 } 855 619 856 620 int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) ··· 863 627 int r; 864 628 865 629 switch (ext) { 630 + case KVM_CAP_ONE_REG: 631 + r = 1; 632 + break; 866 633 case KVM_CAP_COALESCED_MMIO: 867 634 r = KVM_COALESCED_MMIO_PAGE_OFFSET; 868 635 break; ··· 874 635 break; 875 636 } 876 637 return r; 877 - 878 638 } 879 639 880 640 int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) ··· 915 677 { 916 678 int i; 917 679 918 - for (i = 0; i < 32; i++) 919 - vcpu->arch.gprs[i] = regs->gprs[i]; 920 - 680 + for (i = 1; i < ARRAY_SIZE(vcpu->arch.gprs); i++) 681 + vcpu->arch.gprs[i] = regs->gpr[i]; 682 + vcpu->arch.gprs[0] = 0; /* zero is special, and cannot be set. */ 921 683 vcpu->arch.hi = regs->hi; 922 684 vcpu->arch.lo = regs->lo; 923 685 vcpu->arch.pc = regs->pc; 924 686 925 - return kvm_mips_callbacks->vcpu_ioctl_set_regs(vcpu, regs); 687 + return 0; 926 688 } 927 689 928 690 int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 929 691 { 930 692 int i; 931 693 932 - for (i = 0; i < 32; i++) 933 - regs->gprs[i] = vcpu->arch.gprs[i]; 694 + for (i = 0; i < ARRAY_SIZE(vcpu->arch.gprs); i++) 695 + regs->gpr[i] = vcpu->arch.gprs[i]; 934 696 935 697 regs->hi = vcpu->arch.hi; 936 698 regs->lo = vcpu->arch.lo; 937 699 regs->pc = vcpu->arch.pc; 938 700 939 - return kvm_mips_callbacks->vcpu_ioctl_get_regs(vcpu, regs); 701 + return 0; 940 702 } 941 703 942 704 void kvm_mips_comparecount_func(unsigned long data)
-50
arch/mips/kvm/kvm_trap_emul.c
··· 345 345 return ret; 346 346 } 347 347 348 - static int 349 - kvm_trap_emul_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 350 - { 351 - struct mips_coproc *cop0 = vcpu->arch.cop0; 352 - 353 - kvm_write_c0_guest_index(cop0, regs->cp0reg[MIPS_CP0_TLB_INDEX][0]); 354 - kvm_write_c0_guest_context(cop0, regs->cp0reg[MIPS_CP0_TLB_CONTEXT][0]); 355 - kvm_write_c0_guest_badvaddr(cop0, regs->cp0reg[MIPS_CP0_BAD_VADDR][0]); 356 - kvm_write_c0_guest_entryhi(cop0, regs->cp0reg[MIPS_CP0_TLB_HI][0]); 357 - kvm_write_c0_guest_epc(cop0, regs->cp0reg[MIPS_CP0_EXC_PC][0]); 358 - 359 - kvm_write_c0_guest_status(cop0, regs->cp0reg[MIPS_CP0_STATUS][0]); 360 - kvm_write_c0_guest_cause(cop0, regs->cp0reg[MIPS_CP0_CAUSE][0]); 361 - kvm_write_c0_guest_pagemask(cop0, 362 - regs->cp0reg[MIPS_CP0_TLB_PG_MASK][0]); 363 - kvm_write_c0_guest_wired(cop0, regs->cp0reg[MIPS_CP0_TLB_WIRED][0]); 364 - kvm_write_c0_guest_errorepc(cop0, regs->cp0reg[MIPS_CP0_ERROR_PC][0]); 365 - 366 - return 0; 367 - } 368 - 369 - static int 370 - kvm_trap_emul_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 371 - { 372 - struct mips_coproc *cop0 = vcpu->arch.cop0; 373 - 374 - regs->cp0reg[MIPS_CP0_TLB_INDEX][0] = kvm_read_c0_guest_index(cop0); 375 - regs->cp0reg[MIPS_CP0_TLB_CONTEXT][0] = kvm_read_c0_guest_context(cop0); 376 - regs->cp0reg[MIPS_CP0_BAD_VADDR][0] = kvm_read_c0_guest_badvaddr(cop0); 377 - regs->cp0reg[MIPS_CP0_TLB_HI][0] = kvm_read_c0_guest_entryhi(cop0); 378 - regs->cp0reg[MIPS_CP0_EXC_PC][0] = kvm_read_c0_guest_epc(cop0); 379 - 380 - regs->cp0reg[MIPS_CP0_STATUS][0] = kvm_read_c0_guest_status(cop0); 381 - regs->cp0reg[MIPS_CP0_CAUSE][0] = kvm_read_c0_guest_cause(cop0); 382 - regs->cp0reg[MIPS_CP0_TLB_PG_MASK][0] = 383 - kvm_read_c0_guest_pagemask(cop0); 384 - regs->cp0reg[MIPS_CP0_TLB_WIRED][0] = kvm_read_c0_guest_wired(cop0); 385 - regs->cp0reg[MIPS_CP0_ERROR_PC][0] = kvm_read_c0_guest_errorepc(cop0); 386 - 387 - regs->cp0reg[MIPS_CP0_CONFIG][0] = kvm_read_c0_guest_config(cop0); 388 - regs->cp0reg[MIPS_CP0_CONFIG][1] = kvm_read_c0_guest_config1(cop0); 389 - regs->cp0reg[MIPS_CP0_CONFIG][2] = kvm_read_c0_guest_config2(cop0); 390 - regs->cp0reg[MIPS_CP0_CONFIG][3] = kvm_read_c0_guest_config3(cop0); 391 - regs->cp0reg[MIPS_CP0_CONFIG][7] = kvm_read_c0_guest_config7(cop0); 392 - 393 - return 0; 394 - } 395 - 396 348 static int kvm_trap_emul_vm_init(struct kvm *kvm) 397 349 { 398 350 return 0; ··· 423 471 .dequeue_io_int = kvm_mips_dequeue_io_int_cb, 424 472 .irq_deliver = kvm_mips_irq_deliver_cb, 425 473 .irq_clear = kvm_mips_irq_clear_cb, 426 - .vcpu_ioctl_get_regs = kvm_trap_emul_ioctl_get_regs, 427 - .vcpu_ioctl_set_regs = kvm_trap_emul_ioctl_set_regs, 428 474 }; 429 475 430 476 int kvm_mips_emulation_init(struct kvm_mips_callbacks **install_callbacks)
-4
arch/mips/mm/tlbex.c
··· 301 301 static struct uasm_label labels[128] __cpuinitdata; 302 302 static struct uasm_reloc relocs[128] __cpuinitdata; 303 303 304 - #ifdef CONFIG_64BIT 305 - static int check_for_high_segbits __cpuinitdata; 306 - #endif 307 - 308 304 static int check_for_high_segbits __cpuinitdata; 309 305 310 306 static unsigned int kscratch_used_mask __cpuinitdata;
+1 -1
arch/mips/ralink/of.c
··· 88 88 __dt_setup_arch(&__dtb_start); 89 89 90 90 if (soc_info.mem_size) 91 - add_memory_region(soc_info.mem_base, soc_info.mem_size, 91 + add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M, 92 92 BOOT_MEM_RAM); 93 93 else 94 94 detect_memory_region(soc_info.mem_base,
+5 -2
arch/s390/appldata/appldata_base.c
··· 212 212 return 0; 213 213 } 214 214 if (!write) { 215 - len = sprintf(buf, appldata_timer_active ? "1\n" : "0\n"); 215 + strncpy(buf, appldata_timer_active ? "1\n" : "0\n", 216 + ARRAY_SIZE(buf)); 217 + len = strnlen(buf, ARRAY_SIZE(buf)); 216 218 if (len > *lenp) 217 219 len = *lenp; 218 220 if (copy_to_user(buffer, buf, len)) ··· 319 317 return 0; 320 318 } 321 319 if (!write) { 322 - len = sprintf(buf, ops->active ? "1\n" : "0\n"); 320 + strncpy(buf, ops->active ? "1\n" : "0\n", ARRAY_SIZE(buf)); 321 + len = strnlen(buf, ARRAY_SIZE(buf)); 323 322 if (len > *lenp) 324 323 len = *lenp; 325 324 if (copy_to_user(buffer, buf, len)) {
+1 -1
arch/s390/include/asm/dma-mapping.h
··· 71 71 { 72 72 struct dma_map_ops *dma_ops = get_dma_ops(dev); 73 73 74 - dma_ops->free(dev, size, cpu_addr, dma_handle, NULL); 75 74 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); 75 + dma_ops->free(dev, size, cpu_addr, dma_handle, NULL); 76 76 } 77 77 78 78 #endif /* _ASM_S390_DMA_MAPPING_H */
+1
arch/s390/include/asm/io.h
··· 36 36 } 37 37 38 38 void *xlate_dev_mem_ptr(unsigned long phys); 39 + #define xlate_dev_mem_ptr xlate_dev_mem_ptr 39 40 void unxlate_dev_mem_ptr(unsigned long phys, void *addr); 40 41 41 42 /*
+11 -4
arch/s390/include/asm/pgtable.h
··· 646 646 unsigned long address, bits; 647 647 unsigned char skey; 648 648 649 - if (!pte_present(*ptep)) 649 + if (pte_val(*ptep) & _PAGE_INVALID) 650 650 return pgste; 651 651 address = pte_val(*ptep) & PAGE_MASK; 652 652 skey = page_get_storage_key(address); ··· 680 680 #ifdef CONFIG_PGSTE 681 681 int young; 682 682 683 - if (!pte_present(*ptep)) 683 + if (pte_val(*ptep) & _PAGE_INVALID) 684 684 return pgste; 685 685 /* Get referenced bit from storage key */ 686 686 young = page_reset_referenced(pte_val(*ptep) & PAGE_MASK); ··· 706 706 unsigned long address; 707 707 unsigned long okey, nkey; 708 708 709 - if (!pte_present(entry)) 709 + if (pte_val(entry) & _PAGE_INVALID) 710 710 return; 711 711 address = pte_val(entry) & PAGE_MASK; 712 712 okey = nkey = page_get_storage_key(address); ··· 1098 1098 pte = *ptep; 1099 1099 if (!mm_exclusive(mm)) 1100 1100 __ptep_ipte(address, ptep); 1101 + 1102 + if (mm_has_pgste(mm)) 1103 + pgste = pgste_update_all(&pte, pgste); 1101 1104 return pte; 1102 1105 } 1103 1106 ··· 1108 1105 unsigned long address, 1109 1106 pte_t *ptep, pte_t pte) 1110 1107 { 1108 + pgste_t pgste; 1109 + 1111 1110 if (mm_has_pgste(mm)) { 1111 + pgste = *(pgste_t *)(ptep + PTRS_PER_PTE); 1112 + pgste_set_key(ptep, pgste, pte); 1112 1113 pgste_set_pte(ptep, pte); 1113 - pgste_set_unlock(ptep, *(pgste_t *)(ptep + PTRS_PER_PTE)); 1114 + pgste_set_unlock(ptep, pgste); 1114 1115 } else 1115 1116 *ptep = pte; 1116 1117 }
+20 -25
arch/s390/kernel/smp.c
··· 428 428 * This is the main routine where commands issued by other 429 429 * cpus are handled. 430 430 */ 431 + static void smp_handle_ext_call(void) 432 + { 433 + unsigned long bits; 434 + 435 + /* handle bit signal external calls */ 436 + bits = xchg(&pcpu_devices[smp_processor_id()].ec_mask, 0); 437 + if (test_bit(ec_stop_cpu, &bits)) 438 + smp_stop_cpu(); 439 + if (test_bit(ec_schedule, &bits)) 440 + scheduler_ipi(); 441 + if (test_bit(ec_call_function, &bits)) 442 + generic_smp_call_function_interrupt(); 443 + if (test_bit(ec_call_function_single, &bits)) 444 + generic_smp_call_function_single_interrupt(); 445 + } 446 + 431 447 static void do_ext_call_interrupt(struct ext_code ext_code, 432 448 unsigned int param32, unsigned long param64) 433 449 { 434 - unsigned long bits; 435 - int cpu; 436 - 437 - cpu = smp_processor_id(); 438 - if (ext_code.code == 0x1202) 439 - inc_irq_stat(IRQEXT_EXC); 440 - else 441 - inc_irq_stat(IRQEXT_EMS); 442 - /* 443 - * handle bit signal external calls 444 - */ 445 - bits = xchg(&pcpu_devices[cpu].ec_mask, 0); 446 - 447 - if (test_bit(ec_stop_cpu, &bits)) 448 - smp_stop_cpu(); 449 - 450 - if (test_bit(ec_schedule, &bits)) 451 - scheduler_ipi(); 452 - 453 - if (test_bit(ec_call_function, &bits)) 454 - generic_smp_call_function_interrupt(); 455 - 456 - if (test_bit(ec_call_function_single, &bits)) 457 - generic_smp_call_function_single_interrupt(); 458 - 450 + inc_irq_stat(ext_code.code == 0x1202 ? IRQEXT_EXC : IRQEXT_EMS); 451 + smp_handle_ext_call(); 459 452 } 460 453 461 454 void arch_send_call_function_ipi_mask(const struct cpumask *mask) ··· 753 760 { 754 761 unsigned long cregs[16]; 755 762 763 + /* Handle possible pending IPIs */ 764 + smp_handle_ext_call(); 756 765 set_cpu_online(smp_processor_id(), false); 757 766 /* Disable pseudo page faults on this cpu. */ 758 767 pfault_fini();
+1 -1
arch/s390/mm/pgtable.c
··· 492 492 mp = (struct gmap_pgtable *) page->index; 493 493 rmap->gmap = gmap; 494 494 rmap->entry = segment_ptr; 495 - rmap->vmaddr = address; 495 + rmap->vmaddr = address & PMD_MASK; 496 496 spin_lock(&mm->page_table_lock); 497 497 if (*segment_ptr == segment) { 498 498 list_add(&rmap->list, &mp->mapper);
+7 -2
arch/x86/kvm/emulate.c
··· 1240 1240 ctxt->modrm_seg = VCPU_SREG_DS; 1241 1241 1242 1242 if (ctxt->modrm_mod == 3) { 1243 + int highbyte_regs = ctxt->rex_prefix == 0; 1244 + 1243 1245 op->type = OP_REG; 1244 1246 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; 1245 - op->addr.reg = decode_register(ctxt, ctxt->modrm_rm, ctxt->d & ByteOp); 1247 + op->addr.reg = decode_register(ctxt, ctxt->modrm_rm, 1248 + highbyte_regs && (ctxt->d & ByteOp)); 1246 1249 if (ctxt->d & Sse) { 1247 1250 op->type = OP_XMM; 1248 1251 op->bytes = 16; ··· 4000 3997 DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, 4001 3998 N, D(ImplicitOps | ModRM), N, N, 4002 3999 /* 0x10 - 0x1F */ 4003 - N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N, 4000 + N, N, N, N, N, N, N, N, 4001 + D(ImplicitOps | ModRM), N, N, N, N, N, N, D(ImplicitOps | ModRM), 4004 4002 /* 0x20 - 0x2F */ 4005 4003 DIP(ModRM | DstMem | Priv | Op3264, cr_read, check_cr_read), 4006 4004 DIP(ModRM | DstMem | Priv | Op3264, dr_read, check_dr_read), ··· 4840 4836 case 0x08: /* invd */ 4841 4837 case 0x0d: /* GrpP (prefetch) */ 4842 4838 case 0x18: /* Grp16 (prefetch/nop) */ 4839 + case 0x1f: /* nop */ 4843 4840 break; 4844 4841 case 0x20: /* mov cr, reg */ 4845 4842 ctxt->dst.val = ops->get_cr(ctxt, ctxt->modrm_reg);
+6 -3
arch/x86/kvm/lapic.c
··· 1861 1861 { 1862 1862 struct kvm_lapic *apic = vcpu->arch.apic; 1863 1863 unsigned int sipi_vector; 1864 + unsigned long pe; 1864 1865 1865 - if (!kvm_vcpu_has_lapic(vcpu)) 1866 + if (!kvm_vcpu_has_lapic(vcpu) || !apic->pending_events) 1866 1867 return; 1867 1868 1868 - if (test_and_clear_bit(KVM_APIC_INIT, &apic->pending_events)) { 1869 + pe = xchg(&apic->pending_events, 0); 1870 + 1871 + if (test_bit(KVM_APIC_INIT, &pe)) { 1869 1872 kvm_lapic_reset(vcpu); 1870 1873 kvm_vcpu_reset(vcpu); 1871 1874 if (kvm_vcpu_is_bsp(apic->vcpu)) ··· 1876 1873 else 1877 1874 vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; 1878 1875 } 1879 - if (test_and_clear_bit(KVM_APIC_SIPI, &apic->pending_events) && 1876 + if (test_bit(KVM_APIC_SIPI, &pe) && 1880 1877 vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED) { 1881 1878 /* evaluate pending_events before reading the vector */ 1882 1879 smp_rmb();
+4 -1
arch/x86/pci/common.c
··· 628 628 629 629 pa_data = boot_params.hdr.setup_data; 630 630 while (pa_data) { 631 - data = phys_to_virt(pa_data); 631 + data = ioremap(pa_data, sizeof(*rom)); 632 + if (!data) 633 + return -ENOMEM; 632 634 633 635 if (data->type == SETUP_PCI) { 634 636 rom = (struct pci_setup_rom *)data; ··· 647 645 } 648 646 } 649 647 pa_data = data->next; 648 + iounmap(data); 650 649 } 651 650 return 0; 652 651 }
+4 -3
drivers/acpi/apei/ghes.c
··· 919 919 break; 920 920 case ACPI_HEST_NOTIFY_EXTERNAL: 921 921 /* External interrupt vector is GSI */ 922 - if (acpi_gsi_to_irq(generic->notify.vector, &ghes->irq)) { 922 + rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq); 923 + if (rc) { 923 924 pr_err(GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n", 924 925 generic->header.source_id); 925 926 goto err_edac_unreg; 926 927 } 927 - if (request_irq(ghes->irq, ghes_irq_func, 928 - 0, "GHES IRQ", ghes)) { 928 + rc = request_irq(ghes->irq, ghes_irq_func, 0, "GHES IRQ", ghes); 929 + if (rc) { 929 930 pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n", 930 931 generic->header.source_id); 931 932 goto err_edac_unreg;
+6 -4
drivers/acpi/device_pm.c
··· 278 278 if (result) 279 279 return result; 280 280 } else if (state == ACPI_STATE_UNKNOWN) { 281 - /* No power resources and missing _PSC? Try to force D0. */ 281 + /* 282 + * No power resources and missing _PSC? Cross fingers and make 283 + * it D0 in hope that this is what the BIOS put the device into. 284 + * [We tried to force D0 here by executing _PS0, but that broke 285 + * Toshiba P870-303 in a nasty way.] 286 + */ 282 287 state = ACPI_STATE_D0; 283 - result = acpi_dev_pm_explicit_set(device, state); 284 - if (result) 285 - return result; 286 288 } 287 289 device->power.state = state; 288 290 return 0;
+16
drivers/acpi/video.c
··· 458 458 }, 459 459 { 460 460 .callback = video_ignore_initial_backlight, 461 + .ident = "HP Pavilion g6 Notebook PC", 462 + .matches = { 463 + DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 464 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion g6 Notebook PC"), 465 + }, 466 + }, 467 + { 468 + .callback = video_ignore_initial_backlight, 461 469 .ident = "HP 1000 Notebook PC", 462 470 .matches = { 463 471 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 464 472 DMI_MATCH(DMI_PRODUCT_NAME, "HP 1000 Notebook PC"), 473 + }, 474 + }, 475 + { 476 + .callback = video_ignore_initial_backlight, 477 + .ident = "HP Pavilion m4", 478 + .matches = { 479 + DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 480 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion m4 Notebook PC"), 465 481 }, 466 482 }, 467 483 {}
+1 -1
drivers/ata/acard-ahci.c
··· 2 2 /* 3 3 * acard-ahci.c - ACard AHCI SATA support 4 4 * 5 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 5 + * Maintained by: Tejun Heo <tj@kernel.org> 6 6 * Please ALWAYS copy linux-ide@vger.kernel.org 7 7 * on emails. 8 8 *
+3 -1
drivers/ata/ahci.c
··· 1 1 /* 2 2 * ahci.c - AHCI SATA support 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 * ··· 422 422 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9125), 423 423 .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ 424 424 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a), 425 + .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ 426 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172), 425 427 .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ 426 428 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192), 427 429 .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */
+1 -1
drivers/ata/ahci.h
··· 1 1 /* 2 2 * ahci.h - Common AHCI SATA definitions and declarations 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+16 -1
drivers/ata/ata_piix.c
··· 1 1 /* 2 2 * ata_piix.c - Intel PATA/SATA controllers 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 * ··· 151 151 piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ 152 152 ich8_sata_snb, 153 153 ich8_2port_sata_snb, 154 + ich8_2port_sata_byt, 154 155 }; 155 156 156 157 struct piix_map_db { ··· 335 334 { 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, 336 335 /* SATA Controller IDE (Wellsburg) */ 337 336 { 0x8086, 0x8d68, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, 337 + /* SATA Controller IDE (BayTrail) */ 338 + { 0x8086, 0x0F20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt }, 339 + { 0x8086, 0x0F21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt }, 338 340 339 341 { } /* terminate list */ 340 342 }; ··· 445 441 [tolapai_sata] = &tolapai_map_db, 446 442 [ich8_sata_snb] = &ich8_map_db, 447 443 [ich8_2port_sata_snb] = &ich8_2port_map_db, 444 + [ich8_2port_sata_byt] = &ich8_2port_map_db, 448 445 }; 449 446 450 447 static struct pci_bits piix_enable_bits[] = { ··· 1259 1254 .udma_mask = ATA_UDMA6, 1260 1255 .port_ops = &piix_sata_ops, 1261 1256 }, 1257 + 1258 + [ich8_2port_sata_byt] = 1259 + { 1260 + .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16, 1261 + .pio_mask = ATA_PIO4, 1262 + .mwdma_mask = ATA_MWDMA2, 1263 + .udma_mask = ATA_UDMA6, 1264 + .port_ops = &piix_sata_ops, 1265 + }, 1266 + 1262 1267 }; 1263 1268 1264 1269 #define AHCI_PCI_BAR 5
+1 -1
drivers/ata/libahci.c
··· 1 1 /* 2 2 * libahci.c - Common AHCI SATA low-level routines 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+7 -1
drivers/ata/libata-core.c
··· 1 1 /* 2 2 * libata-core.c - helper library for ATA 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 * ··· 1602 1602 qc->tf = *tf; 1603 1603 if (cdb) 1604 1604 memcpy(qc->cdb, cdb, ATAPI_CDB_LEN); 1605 + 1606 + /* some SATA bridges need us to indicate data xfer direction */ 1607 + if (tf->protocol == ATAPI_PROT_DMA && (dev->flags & ATA_DFLAG_DMADIR) && 1608 + dma_dir == DMA_FROM_DEVICE) 1609 + qc->tf.feature |= ATAPI_DMADIR; 1610 + 1605 1611 qc->flags |= ATA_QCFLAG_RESULT_TF; 1606 1612 qc->dma_dir = dma_dir; 1607 1613 if (dma_dir != DMA_NONE) {
+1 -1
drivers/ata/libata-eh.c
··· 1 1 /* 2 2 * libata-eh.c - libata error handling 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+1 -1
drivers/ata/libata-scsi.c
··· 1 1 /* 2 2 * libata-scsi.c - helper library for ATA 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+1 -1
drivers/ata/libata-sff.c
··· 1 1 /* 2 2 * libata-sff.c - helper library for PCI IDE BMDMA 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+1 -1
drivers/ata/pdc_adma.c
··· 1 1 /* 2 2 * pdc_adma.c - Pacific Digital Corporation ADMA 3 3 * 4 - * Maintained by: Mark Lord <mlord@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * 6 6 * Copyright 2005 Mark Lord 7 7 *
+1 -1
drivers/ata/sata_promise.c
··· 1 1 /* 2 2 * sata_promise.c - Promise SATA 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Mikael Pettersson <mikpe@it.uu.se> 6 6 * Please ALWAYS copy linux-ide@vger.kernel.org 7 7 * on emails.
+12 -12
drivers/ata/sata_rcar.c
··· 549 549 550 550 /* start host DMA transaction */ 551 551 dmactl = ioread32(priv->base + ATAPI_CONTROL1_REG); 552 + dmactl &= ~ATAPI_CONTROL1_STOP; 552 553 dmactl |= ATAPI_CONTROL1_START; 553 554 iowrite32(dmactl, priv->base + ATAPI_CONTROL1_REG); 554 555 } ··· 619 618 .bmdma_status = sata_rcar_bmdma_status, 620 619 }; 621 620 622 - static int sata_rcar_serr_interrupt(struct ata_port *ap) 621 + static void sata_rcar_serr_interrupt(struct ata_port *ap) 623 622 { 624 623 struct sata_rcar_priv *priv = ap->host->private_data; 625 624 struct ata_eh_info *ehi = &ap->link.eh_info; 626 625 int freeze = 0; 627 - int handled = 0; 628 626 u32 serror; 629 627 630 628 serror = ioread32(priv->base + SCRSERR_REG); 631 629 if (!serror) 632 - return 0; 630 + return; 633 631 634 632 DPRINTK("SError @host_intr: 0x%x\n", serror); 635 633 ··· 641 641 ata_ehi_push_desc(ehi, "%s", "hotplug"); 642 642 643 643 freeze = serror & SERR_COMM_WAKE ? 0 : 1; 644 - handled = 1; 645 644 } 646 645 647 646 /* freeze or abort */ ··· 648 649 ata_port_freeze(ap); 649 650 else 650 651 ata_port_abort(ap); 651 - 652 - return handled; 653 652 } 654 653 655 - static int sata_rcar_ata_interrupt(struct ata_port *ap) 654 + static void sata_rcar_ata_interrupt(struct ata_port *ap) 656 655 { 657 656 struct ata_queued_cmd *qc; 658 657 int handled = 0; ··· 659 662 if (qc) 660 663 handled |= ata_bmdma_port_intr(ap, qc); 661 664 662 - return handled; 665 + /* be sure to clear ATA interrupt */ 666 + if (!handled) 667 + sata_rcar_check_status(ap); 663 668 } 664 669 665 670 static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance) ··· 676 677 spin_lock_irqsave(&host->lock, flags); 677 678 678 679 sataintstat = ioread32(priv->base + SATAINTSTAT_REG); 680 + sataintstat &= SATA_RCAR_INT_MASK; 679 681 if (!sataintstat) 680 682 goto done; 681 683 /* ack */ 682 - iowrite32(sataintstat & ~SATA_RCAR_INT_MASK, 683 - priv->base + SATAINTSTAT_REG); 684 + iowrite32(~sataintstat & 0x7ff, priv->base + SATAINTSTAT_REG); 684 685 685 686 ap = host->ports[0]; 686 687 687 688 if (sataintstat & SATAINTSTAT_ATA) 688 - handled |= sata_rcar_ata_interrupt(ap); 689 + sata_rcar_ata_interrupt(ap); 689 690 690 691 if (sataintstat & SATAINTSTAT_SERR) 691 - handled |= sata_rcar_serr_interrupt(ap); 692 + sata_rcar_serr_interrupt(ap); 692 693 694 + handled = 1; 693 695 done: 694 696 spin_unlock_irqrestore(&host->lock, flags); 695 697
+1 -1
drivers/ata/sata_sil.c
··· 1 1 /* 2 2 * sata_sil.c - Silicon Image SATA 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+1 -1
drivers/ata/sata_sx4.c
··· 1 1 /* 2 2 * sata_sx4.c - Promise SATA 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+1 -1
drivers/ata/sata_via.c
··· 1 1 /* 2 2 * sata_via.c - VIA Serial ATA controllers 3 3 * 4 - * Maintained by: Jeff Garzik <jgarzik@pobox.com> 4 + * Maintained by: Tejun Heo <tj@kernel.org> 5 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 6 * on emails. 7 7 *
+2 -2
drivers/cpufreq/acpi-cpufreq.c
··· 347 347 switch (per_cpu(acfreq_data, cpumask_first(mask))->cpu_feature) { 348 348 case SYSTEM_INTEL_MSR_CAPABLE: 349 349 cmd.type = SYSTEM_INTEL_MSR_CAPABLE; 350 - cmd.addr.msr.reg = MSR_IA32_PERF_STATUS; 350 + cmd.addr.msr.reg = MSR_IA32_PERF_CTL; 351 351 break; 352 352 case SYSTEM_AMD_MSR_CAPABLE: 353 353 cmd.type = SYSTEM_AMD_MSR_CAPABLE; 354 - cmd.addr.msr.reg = MSR_AMD_PERF_STATUS; 354 + cmd.addr.msr.reg = MSR_AMD_PERF_CTL; 355 355 break; 356 356 case SYSTEM_IO_CAPABLE: 357 357 cmd.type = SYSTEM_IO_CAPABLE;
+3 -2
drivers/cpufreq/cpufreq-cpu0.c
··· 45 45 struct cpufreq_freqs freqs; 46 46 struct opp *opp; 47 47 unsigned long volt = 0, volt_old = 0, tol = 0; 48 - long freq_Hz; 48 + long freq_Hz, freq_exact; 49 49 unsigned int index; 50 50 int ret; 51 51 ··· 60 60 freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000); 61 61 if (freq_Hz < 0) 62 62 freq_Hz = freq_table[index].frequency * 1000; 63 + freq_exact = freq_Hz; 63 64 freqs.new = freq_Hz / 1000; 64 65 freqs.old = clk_get_rate(cpu_clk) / 1000; 65 66 ··· 99 98 } 100 99 } 101 100 102 - ret = clk_set_rate(cpu_clk, freqs.new * 1000); 101 + ret = clk_set_rate(cpu_clk, freq_exact); 103 102 if (ret) { 104 103 pr_err("failed to set clock rate: %d\n", ret); 105 104 if (cpu_reg)
+3
drivers/cpufreq/cpufreq_governor.c
··· 26 26 #include <linux/tick.h> 27 27 #include <linux/types.h> 28 28 #include <linux/workqueue.h> 29 + #include <linux/cpu.h> 29 30 30 31 #include "cpufreq_governor.h" 31 32 ··· 181 180 if (!all_cpus) { 182 181 __gov_queue_work(smp_processor_id(), dbs_data, delay); 183 182 } else { 183 + get_online_cpus(); 184 184 for_each_cpu(i, policy->cpus) 185 185 __gov_queue_work(i, dbs_data, delay); 186 + put_online_cpus(); 186 187 } 187 188 } 188 189 EXPORT_SYMBOL_GPL(gov_queue_work);
+23 -22
drivers/dma/dmatest.c
··· 716 716 } 717 717 dma_async_issue_pending(chan); 718 718 719 - wait_event_freezable_timeout(done_wait, 720 - done.done || kthread_should_stop(), 719 + wait_event_freezable_timeout(done_wait, done.done, 721 720 msecs_to_jiffies(params->timeout)); 722 721 723 722 status = dma_async_is_tx_complete(chan, cookie, NULL, NULL); ··· 996 997 static int __restart_threaded_test(struct dmatest_info *info, bool run) 997 998 { 998 999 struct dmatest_params *params = &info->params; 999 - int ret; 1000 1000 1001 1001 /* Stop any running test first */ 1002 1002 __stop_threaded_test(info); ··· 1010 1012 memcpy(params, &info->dbgfs_params, sizeof(*params)); 1011 1013 1012 1014 /* Run test with new parameters */ 1013 - ret = __run_threaded_test(info); 1014 - if (ret) { 1015 - __stop_threaded_test(info); 1016 - pr_err("dmatest: Can't run test\n"); 1015 + return __run_threaded_test(info); 1016 + } 1017 + 1018 + static bool __is_threaded_test_run(struct dmatest_info *info) 1019 + { 1020 + struct dmatest_chan *dtc; 1021 + 1022 + list_for_each_entry(dtc, &info->channels, node) { 1023 + struct dmatest_thread *thread; 1024 + 1025 + list_for_each_entry(thread, &dtc->threads, node) { 1026 + if (!thread->done) 1027 + return true; 1028 + } 1017 1029 } 1018 1030 1019 - return ret; 1031 + return false; 1020 1032 } 1021 1033 1022 1034 static ssize_t dtf_write_string(void *to, size_t available, loff_t *ppos, ··· 1099 1091 { 1100 1092 struct dmatest_info *info = file->private_data; 1101 1093 char buf[3]; 1102 - struct dmatest_chan *dtc; 1103 - bool alive = false; 1104 1094 1105 1095 mutex_lock(&info->lock); 1106 - list_for_each_entry(dtc, &info->channels, node) { 1107 - struct dmatest_thread *thread; 1108 1096 1109 - list_for_each_entry(thread, &dtc->threads, node) { 1110 - if (!thread->done) { 1111 - alive = true; 1112 - break; 1113 - } 1114 - } 1115 - } 1116 - 1117 - if (alive) { 1097 + if (__is_threaded_test_run(info)) { 1118 1098 buf[0] = 'Y'; 1119 1099 } else { 1120 1100 __stop_threaded_test(info); ··· 1128 1132 1129 1133 if (strtobool(buf, &bv) == 0) { 1130 1134 mutex_lock(&info->lock); 1131 - ret = __restart_threaded_test(info, bv); 1135 + 1136 + if (__is_threaded_test_run(info)) 1137 + ret = -EBUSY; 1138 + else 1139 + ret = __restart_threaded_test(info, bv); 1140 + 1132 1141 mutex_unlock(&info->lock); 1133 1142 } 1134 1143
+5 -3
drivers/dma/ste_dma40.c
··· 1566 1566 return; 1567 1567 } 1568 1568 1569 - if (d40_queue_start(d40c) == NULL) 1569 + if (d40_queue_start(d40c) == NULL) { 1570 1570 d40c->busy = false; 1571 - pm_runtime_mark_last_busy(d40c->base->dev); 1572 - pm_runtime_put_autosuspend(d40c->base->dev); 1571 + 1572 + pm_runtime_mark_last_busy(d40c->base->dev); 1573 + pm_runtime_put_autosuspend(d40c->base->dev); 1574 + } 1573 1575 1574 1576 d40_desc_remove(d40d); 1575 1577 d40_desc_done(d40c, d40d);
+5 -1
drivers/gpu/drm/drm_irq.c
··· 1054 1054 */ 1055 1055 void drm_vblank_pre_modeset(struct drm_device *dev, int crtc) 1056 1056 { 1057 - /* vblank is not initialized (IRQ not installed ?) */ 1057 + /* vblank is not initialized (IRQ not installed ?), or has been freed */ 1058 1058 if (!dev->num_crtcs) 1059 1059 return; 1060 1060 /* ··· 1075 1075 void drm_vblank_post_modeset(struct drm_device *dev, int crtc) 1076 1076 { 1077 1077 unsigned long irqflags; 1078 + 1079 + /* vblank is not initialized (IRQ not installed ?), or has been freed */ 1080 + if (!dev->num_crtcs) 1081 + return; 1078 1082 1079 1083 if (dev->vblank_inmodeset[crtc]) { 1080 1084 spin_lock_irqsave(&dev->vbl_lock, irqflags);
+2 -5
drivers/gpu/drm/i915/i915_gem.c
··· 91 91 { 92 92 int ret; 93 93 94 - #define EXIT_COND (!i915_reset_in_progress(error)) 94 + #define EXIT_COND (!i915_reset_in_progress(error) || \ 95 + i915_terminally_wedged(error)) 95 96 if (EXIT_COND) 96 97 return 0; 97 - 98 - /* GPU is already declared terminally dead, give up. */ 99 - if (i915_terminally_wedged(error)) 100 - return -EIO; 101 98 102 99 /* 103 100 * Only wait 10 seconds for the gpu reset to complete to avoid hanging
+5
drivers/gpu/drm/i915/intel_display.c
··· 7937 7937 memset(&pipe_config, 0, sizeof(pipe_config)); 7938 7938 active = dev_priv->display.get_pipe_config(crtc, 7939 7939 &pipe_config); 7940 + 7941 + /* hw state is inconsistent with the pipe A quirk */ 7942 + if (crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) 7943 + active = crtc->active; 7944 + 7940 7945 WARN(crtc->active != active, 7941 7946 "crtc active state doesn't match with hw state " 7942 7947 "(expected %i, found %i)\n", crtc->active, active);
+2 -2
drivers/gpu/drm/i915/intel_lvds.c
··· 815 815 }, 816 816 { 817 817 .callback = intel_no_lvds_dmi_callback, 818 - .ident = "Hewlett-Packard HP t5740e Thin Client", 818 + .ident = "Hewlett-Packard HP t5740", 819 819 .matches = { 820 820 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 821 - DMI_MATCH(DMI_PRODUCT_NAME, "HP t5740e Thin Client"), 821 + DMI_MATCH(DMI_PRODUCT_NAME, " t5740"), 822 822 }, 823 823 }, 824 824 {
+1 -1
drivers/gpu/drm/i915/intel_sdvo.c
··· 1776 1776 * Assume that the preferred modes are 1777 1777 * arranged in priority order. 1778 1778 */ 1779 - intel_ddc_get_modes(connector, intel_sdvo->i2c); 1779 + intel_ddc_get_modes(connector, &intel_sdvo->ddc); 1780 1780 if (list_empty(&connector->probed_modes) == false) 1781 1781 goto end; 1782 1782
+5 -4
drivers/gpu/drm/mgag200/mgag200_mode.c
··· 1034 1034 else 1035 1035 hi_pri_lvl = 5; 1036 1036 1037 - WREG8(0x1fde, 0x06); 1038 - WREG8(0x1fdf, hi_pri_lvl); 1037 + WREG8(MGAREG_CRTCEXT_INDEX, 0x06); 1038 + WREG8(MGAREG_CRTCEXT_DATA, hi_pri_lvl); 1039 1039 } else { 1040 + WREG8(MGAREG_CRTCEXT_INDEX, 0x06); 1040 1041 if (mdev->reg_1e24 >= 0x01) 1041 - WREG8(0x1fdf, 0x03); 1042 + WREG8(MGAREG_CRTCEXT_DATA, 0x03); 1042 1043 else 1043 - WREG8(0x1fdf, 0x04); 1044 + WREG8(MGAREG_CRTCEXT_DATA, 0x04); 1044 1045 } 1045 1046 } 1046 1047 return 0;
+6 -1
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c
··· 50 50 { 51 51 const u32 doff = (or * 0x800); 52 52 int load = -EINVAL; 53 + nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80150000); 54 + nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000); 53 55 nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); 54 - udelay(9500); 56 + mdelay(9); 57 + udelay(500); 55 58 nv_wr32(priv, 0x61a00c + doff, 0x80000000); 56 59 load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27; 57 60 nv_wr32(priv, 0x61a00c + doff, 0x00000000); 61 + nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80550000); 62 + nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000); 58 63 return load; 59 64 } 60 65
+4
drivers/gpu/drm/nouveau/core/engine/disp/hdminv84.c
··· 55 55 nv_wr32(priv, 0x616510 + hoff, 0x00000000); 56 56 nv_mask(priv, 0x616500 + hoff, 0x00000001, 0x00000001); 57 57 58 + nv_mask(priv, 0x6165d0 + hoff, 0x00070001, 0x00010001); /* SPARE, HW_CTS */ 59 + nv_mask(priv, 0x616568 + hoff, 0x00010101, 0x00000000); /* ACR_CTRL, ?? */ 60 + nv_mask(priv, 0x616578 + hoff, 0x80000000, 0x80000000); /* ACR_0441_ENABLE */ 61 + 58 62 /* ??? */ 59 63 nv_mask(priv, 0x61733c, 0x00100000, 0x00100000); /* RESETF */ 60 64 nv_mask(priv, 0x61733c, 0x10000000, 0x10000000); /* LOOKUP_EN */
+10 -4
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
··· 40 40 * FIFO channel objects 41 41 ******************************************************************************/ 42 42 43 - void 44 - nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) 43 + static void 44 + nv50_fifo_playlist_update_locked(struct nv50_fifo_priv *priv) 45 45 { 46 46 struct nouveau_bar *bar = nouveau_bar(priv); 47 47 struct nouveau_gpuobj *cur; 48 48 int i, p; 49 49 50 - mutex_lock(&nv_subdev(priv)->mutex); 51 50 cur = priv->playlist[priv->cur_playlist]; 52 51 priv->cur_playlist = !priv->cur_playlist; 53 52 ··· 60 61 nv_wr32(priv, 0x0032f4, cur->addr >> 12); 61 62 nv_wr32(priv, 0x0032ec, p); 62 63 nv_wr32(priv, 0x002500, 0x00000101); 64 + } 65 + 66 + void 67 + nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) 68 + { 69 + mutex_lock(&nv_subdev(priv)->mutex); 70 + nv50_fifo_playlist_update_locked(priv); 63 71 mutex_unlock(&nv_subdev(priv)->mutex); 64 72 } 65 73 ··· 495 489 496 490 for (i = 0; i < 128; i++) 497 491 nv_wr32(priv, 0x002600 + (i * 4), 0x00000000); 498 - nv50_fifo_playlist_update(priv); 492 + nv50_fifo_playlist_update_locked(priv); 499 493 500 494 nv_wr32(priv, 0x003200, 0x00000001); 501 495 nv_wr32(priv, 0x003250, 0x00000001);
+1 -1
drivers/gpu/drm/nouveau/core/include/core/class.h
··· 218 218 #define NV50_DISP_DAC_PWR_STATE 0x00000040 219 219 #define NV50_DISP_DAC_PWR_STATE_ON 0x00000000 220 220 #define NV50_DISP_DAC_PWR_STATE_OFF 0x00000040 221 - #define NV50_DISP_DAC_LOAD 0x0002000c 221 + #define NV50_DISP_DAC_LOAD 0x00020100 222 222 #define NV50_DISP_DAC_LOAD_VALUE 0x00000007 223 223 224 224 #define NV50_DISP_PIOR_MTHD 0x00030000
+3 -1
drivers/gpu/drm/nouveau/nv50_display.c
··· 1554 1554 { 1555 1555 struct nv50_disp *disp = nv50_disp(encoder->dev); 1556 1556 int ret, or = nouveau_encoder(encoder)->or; 1557 - u32 load = 0; 1557 + u32 load = nouveau_drm(encoder->dev)->vbios.dactestval; 1558 + if (load == 0) 1559 + load = 340; 1558 1560 1559 1561 ret = nv_exec(disp->core, NV50_DISP_DAC_LOAD + or, &load, sizeof(load)); 1560 1562 if (ret || load != 7)
+8 -3
drivers/gpu/drm/radeon/atombios_encoders.c
··· 667 667 int 668 668 atombios_get_encoder_mode(struct drm_encoder *encoder) 669 669 { 670 + struct drm_device *dev = encoder->dev; 671 + struct radeon_device *rdev = dev->dev_private; 670 672 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 671 673 struct drm_connector *connector; 672 674 struct radeon_connector *radeon_connector; ··· 695 693 case DRM_MODE_CONNECTOR_DVII: 696 694 case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ 697 695 if (drm_detect_hdmi_monitor(radeon_connector->edid) && 698 - radeon_audio) 696 + radeon_audio && 697 + !ASIC_IS_DCE6(rdev)) /* remove once we support DCE6 */ 699 698 return ATOM_ENCODER_MODE_HDMI; 700 699 else if (radeon_connector->use_digital) 701 700 return ATOM_ENCODER_MODE_DVI; ··· 707 704 case DRM_MODE_CONNECTOR_HDMIA: 708 705 default: 709 706 if (drm_detect_hdmi_monitor(radeon_connector->edid) && 710 - radeon_audio) 707 + radeon_audio && 708 + !ASIC_IS_DCE6(rdev)) /* remove once we support DCE6 */ 711 709 return ATOM_ENCODER_MODE_HDMI; 712 710 else 713 711 return ATOM_ENCODER_MODE_DVI; ··· 722 718 (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) 723 719 return ATOM_ENCODER_MODE_DP; 724 720 else if (drm_detect_hdmi_monitor(radeon_connector->edid) && 725 - radeon_audio) 721 + radeon_audio && 722 + !ASIC_IS_DCE6(rdev)) /* remove once we support DCE6 */ 726 723 return ATOM_ENCODER_MODE_HDMI; 727 724 else 728 725 return ATOM_ENCODER_MODE_DVI;
+6 -4
drivers/gpu/drm/radeon/evergreen.c
··· 4754 4754 rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; 4755 4755 4756 4756 /* Enable IRQ */ 4757 + if (!rdev->irq.installed) { 4758 + r = radeon_irq_kms_init(rdev); 4759 + if (r) 4760 + return r; 4761 + } 4762 + 4757 4763 r = r600_irq_init(rdev); 4758 4764 if (r) { 4759 4765 DRM_ERROR("radeon: IH init failed (%d).\n", r); ··· 4926 4920 return r; 4927 4921 /* Memory manager */ 4928 4922 r = radeon_bo_init(rdev); 4929 - if (r) 4930 - return r; 4931 - 4932 - r = radeon_irq_kms_init(rdev); 4933 4923 if (r) 4934 4924 return r; 4935 4925
+6 -4
drivers/gpu/drm/radeon/ni.c
··· 2025 2025 } 2026 2026 2027 2027 /* Enable IRQ */ 2028 + if (!rdev->irq.installed) { 2029 + r = radeon_irq_kms_init(rdev); 2030 + if (r) 2031 + return r; 2032 + } 2033 + 2028 2034 r = r600_irq_init(rdev); 2029 2035 if (r) { 2030 2036 DRM_ERROR("radeon: IH init failed (%d).\n", r); ··· 2193 2187 return r; 2194 2188 /* Memory manager */ 2195 2189 r = radeon_bo_init(rdev); 2196 - if (r) 2197 - return r; 2198 - 2199 - r = radeon_irq_kms_init(rdev); 2200 2190 if (r) 2201 2191 return r; 2202 2192
+6 -3
drivers/gpu/drm/radeon/r100.c
··· 3869 3869 } 3870 3870 3871 3871 /* Enable IRQ */ 3872 + if (!rdev->irq.installed) { 3873 + r = radeon_irq_kms_init(rdev); 3874 + if (r) 3875 + return r; 3876 + } 3877 + 3872 3878 r100_irq_set(rdev); 3873 3879 rdev->config.r100.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 3874 3880 /* 1M ring buffer */ ··· 4028 4022 r100_mc_init(rdev); 4029 4023 /* Fence driver */ 4030 4024 r = radeon_fence_driver_init(rdev); 4031 - if (r) 4032 - return r; 4033 - r = radeon_irq_kms_init(rdev); 4034 4025 if (r) 4035 4026 return r; 4036 4027 /* Memory manager */
+6 -3
drivers/gpu/drm/radeon/r300.c
··· 1382 1382 } 1383 1383 1384 1384 /* Enable IRQ */ 1385 + if (!rdev->irq.installed) { 1386 + r = radeon_irq_kms_init(rdev); 1387 + if (r) 1388 + return r; 1389 + } 1390 + 1385 1391 r100_irq_set(rdev); 1386 1392 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 1387 1393 /* 1M ring buffer */ ··· 1520 1514 r300_mc_init(rdev); 1521 1515 /* Fence driver */ 1522 1516 r = radeon_fence_driver_init(rdev); 1523 - if (r) 1524 - return r; 1525 - r = radeon_irq_kms_init(rdev); 1526 1517 if (r) 1527 1518 return r; 1528 1519 /* Memory manager */
+6 -4
drivers/gpu/drm/radeon/r420.c
··· 265 265 } 266 266 267 267 /* Enable IRQ */ 268 + if (!rdev->irq.installed) { 269 + r = radeon_irq_kms_init(rdev); 270 + if (r) 271 + return r; 272 + } 273 + 268 274 r100_irq_set(rdev); 269 275 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 270 276 /* 1M ring buffer */ ··· 414 408 r420_debugfs(rdev); 415 409 /* Fence driver */ 416 410 r = radeon_fence_driver_init(rdev); 417 - if (r) { 418 - return r; 419 - } 420 - r = radeon_irq_kms_init(rdev); 421 411 if (r) { 422 412 return r; 423 413 }
+6 -3
drivers/gpu/drm/radeon/r520.c
··· 194 194 } 195 195 196 196 /* Enable IRQ */ 197 + if (!rdev->irq.installed) { 198 + r = radeon_irq_kms_init(rdev); 199 + if (r) 200 + return r; 201 + } 202 + 197 203 rs600_irq_set(rdev); 198 204 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 199 205 /* 1M ring buffer */ ··· 301 295 rv515_debugfs(rdev); 302 296 /* Fence driver */ 303 297 r = radeon_fence_driver_init(rdev); 304 - if (r) 305 - return r; 306 - r = radeon_irq_kms_init(rdev); 307 298 if (r) 308 299 return r; 309 300 /* Memory manager */
+49 -4
drivers/gpu/drm/radeon/r600.c
··· 1046 1046 return -1; 1047 1047 } 1048 1048 1049 + uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg) 1050 + { 1051 + uint32_t r; 1052 + 1053 + WREG32(R_0028F8_MC_INDEX, S_0028F8_MC_IND_ADDR(reg)); 1054 + r = RREG32(R_0028FC_MC_DATA); 1055 + WREG32(R_0028F8_MC_INDEX, ~C_0028F8_MC_IND_ADDR); 1056 + return r; 1057 + } 1058 + 1059 + void rs780_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) 1060 + { 1061 + WREG32(R_0028F8_MC_INDEX, S_0028F8_MC_IND_ADDR(reg) | 1062 + S_0028F8_MC_IND_WR_EN(1)); 1063 + WREG32(R_0028FC_MC_DATA, v); 1064 + WREG32(R_0028F8_MC_INDEX, 0x7F); 1065 + } 1066 + 1049 1067 static void r600_mc_program(struct radeon_device *rdev) 1050 1068 { 1051 1069 struct rv515_mc_save save; ··· 1199 1181 { 1200 1182 u32 tmp; 1201 1183 int chansize, numchan; 1184 + uint32_t h_addr, l_addr; 1185 + unsigned long long k8_addr; 1202 1186 1203 1187 /* Get VRAM informations */ 1204 1188 rdev->mc.vram_is_ddr = true; ··· 1241 1221 if (rdev->flags & RADEON_IS_IGP) { 1242 1222 rs690_pm_info(rdev); 1243 1223 rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); 1224 + 1225 + if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) { 1226 + /* Use K8 direct mapping for fast fb access. */ 1227 + rdev->fastfb_working = false; 1228 + h_addr = G_000012_K8_ADDR_EXT(RREG32_MC(R_000012_MC_MISC_UMA_CNTL)); 1229 + l_addr = RREG32_MC(R_000011_K8_FB_LOCATION); 1230 + k8_addr = ((unsigned long long)h_addr) << 32 | l_addr; 1231 + #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE) 1232 + if (k8_addr + rdev->mc.visible_vram_size < 0x100000000ULL) 1233 + #endif 1234 + { 1235 + /* FastFB shall be used with UMA memory. Here it is simply disabled when sideport 1236 + * memory is present. 1237 + */ 1238 + if (rdev->mc.igp_sideport_enabled == false && radeon_fastfb == 1) { 1239 + DRM_INFO("Direct mapping: aper base at 0x%llx, replaced by direct mapping base 0x%llx.\n", 1240 + (unsigned long long)rdev->mc.aper_base, k8_addr); 1241 + rdev->mc.aper_base = (resource_size_t)k8_addr; 1242 + rdev->fastfb_working = true; 1243 + } 1244 + } 1245 + } 1244 1246 } 1247 + 1245 1248 radeon_update_bandwidth_info(rdev); 1246 1249 return 0; 1247 1250 } ··· 3245 3202 } 3246 3203 3247 3204 /* Enable IRQ */ 3205 + if (!rdev->irq.installed) { 3206 + r = radeon_irq_kms_init(rdev); 3207 + if (r) 3208 + return r; 3209 + } 3210 + 3248 3211 r = r600_irq_init(rdev); 3249 3212 if (r) { 3250 3213 DRM_ERROR("radeon: IH init failed (%d).\n", r); ··· 3402 3353 return r; 3403 3354 /* Memory manager */ 3404 3355 r = radeon_bo_init(rdev); 3405 - if (r) 3406 - return r; 3407 - 3408 - r = radeon_irq_kms_init(rdev); 3409 3356 if (r) 3410 3357 return r; 3411 3358
+8
drivers/gpu/drm/radeon/r600d.h
··· 1342 1342 #define PACKET3_STRMOUT_BASE_UPDATE 0x72 /* r7xx */ 1343 1343 #define PACKET3_SURFACE_BASE_UPDATE 0x73 1344 1344 1345 + #define R_000011_K8_FB_LOCATION 0x11 1346 + #define R_000012_MC_MISC_UMA_CNTL 0x12 1347 + #define G_000012_K8_ADDR_EXT(x) (((x) >> 0) & 0xFF) 1348 + #define R_0028F8_MC_INDEX 0x28F8 1349 + #define S_0028F8_MC_IND_ADDR(x) (((x) & 0x1FF) << 0) 1350 + #define C_0028F8_MC_IND_ADDR 0xFFFFFE00 1351 + #define S_0028F8_MC_IND_WR_EN(x) (((x) & 0x1) << 9) 1352 + #define R_0028FC_MC_DATA 0x28FC 1345 1353 1346 1354 #define R_008020_GRBM_SOFT_RESET 0x8020 1347 1355 #define S_008020_SOFT_RESET_CP(x) (((x) & 1) << 0)
+4
drivers/gpu/drm/radeon/radeon_asic.c
··· 122 122 rdev->mc_rreg = &rs600_mc_rreg; 123 123 rdev->mc_wreg = &rs600_mc_wreg; 124 124 } 125 + if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) { 126 + rdev->mc_rreg = &rs780_mc_rreg; 127 + rdev->mc_wreg = &rs780_mc_wreg; 128 + } 125 129 if (rdev->family >= CHIP_R600) { 126 130 rdev->pciep_rreg = &r600_pciep_rreg; 127 131 rdev->pciep_wreg = &r600_pciep_wreg;
+2
drivers/gpu/drm/radeon/radeon_asic.h
··· 347 347 extern void r600_pm_misc(struct radeon_device *rdev); 348 348 extern void r600_pm_init_profile(struct radeon_device *rdev); 349 349 extern void rs780_pm_init_profile(struct radeon_device *rdev); 350 + extern uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg); 351 + extern void rs780_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 350 352 extern void r600_pm_get_dynpm_state(struct radeon_device *rdev); 351 353 extern void r600_set_pcie_lanes(struct radeon_device *rdev, int lanes); 352 354 extern int r600_get_pcie_lanes(struct radeon_device *rdev);
+6 -3
drivers/gpu/drm/radeon/rs400.c
··· 417 417 } 418 418 419 419 /* Enable IRQ */ 420 + if (!rdev->irq.installed) { 421 + r = radeon_irq_kms_init(rdev); 422 + if (r) 423 + return r; 424 + } 425 + 420 426 r100_irq_set(rdev); 421 427 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 422 428 /* 1M ring buffer */ ··· 539 533 rs400_mc_init(rdev); 540 534 /* Fence driver */ 541 535 r = radeon_fence_driver_init(rdev); 542 - if (r) 543 - return r; 544 - r = radeon_irq_kms_init(rdev); 545 536 if (r) 546 537 return r; 547 538 /* Memory manager */
+6 -3
drivers/gpu/drm/radeon/rs600.c
··· 923 923 } 924 924 925 925 /* Enable IRQ */ 926 + if (!rdev->irq.installed) { 927 + r = radeon_irq_kms_init(rdev); 928 + if (r) 929 + return r; 930 + } 931 + 926 932 rs600_irq_set(rdev); 927 933 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 928 934 /* 1M ring buffer */ ··· 1051 1045 rs600_debugfs(rdev); 1052 1046 /* Fence driver */ 1053 1047 r = radeon_fence_driver_init(rdev); 1054 - if (r) 1055 - return r; 1056 - r = radeon_irq_kms_init(rdev); 1057 1048 if (r) 1058 1049 return r; 1059 1050 /* Memory manager */
+6 -3
drivers/gpu/drm/radeon/rs690.c
··· 651 651 } 652 652 653 653 /* Enable IRQ */ 654 + if (!rdev->irq.installed) { 655 + r = radeon_irq_kms_init(rdev); 656 + if (r) 657 + return r; 658 + } 659 + 654 660 rs600_irq_set(rdev); 655 661 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 656 662 /* 1M ring buffer */ ··· 780 774 rv515_debugfs(rdev); 781 775 /* Fence driver */ 782 776 r = radeon_fence_driver_init(rdev); 783 - if (r) 784 - return r; 785 - r = radeon_irq_kms_init(rdev); 786 777 if (r) 787 778 return r; 788 779 /* Memory manager */
+6 -3
drivers/gpu/drm/radeon/rv515.c
··· 532 532 } 533 533 534 534 /* Enable IRQ */ 535 + if (!rdev->irq.installed) { 536 + r = radeon_irq_kms_init(rdev); 537 + if (r) 538 + return r; 539 + } 540 + 535 541 rs600_irq_set(rdev); 536 542 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 537 543 /* 1M ring buffer */ ··· 666 660 rv515_debugfs(rdev); 667 661 /* Fence driver */ 668 662 r = radeon_fence_driver_init(rdev); 669 - if (r) 670 - return r; 671 - r = radeon_irq_kms_init(rdev); 672 663 if (r) 673 664 return r; 674 665 /* Memory manager */
+6 -4
drivers/gpu/drm/radeon/rv770.c
··· 1887 1887 rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; 1888 1888 1889 1889 /* Enable IRQ */ 1890 + if (!rdev->irq.installed) { 1891 + r = radeon_irq_kms_init(rdev); 1892 + if (r) 1893 + return r; 1894 + } 1895 + 1890 1896 r = r600_irq_init(rdev); 1891 1897 if (r) { 1892 1898 DRM_ERROR("radeon: IH init failed (%d).\n", r); ··· 2048 2042 return r; 2049 2043 /* Memory manager */ 2050 2044 r = radeon_bo_init(rdev); 2051 - if (r) 2052 - return r; 2053 - 2054 - r = radeon_irq_kms_init(rdev); 2055 2045 if (r) 2056 2046 return r; 2057 2047
+6 -4
drivers/gpu/drm/radeon/si.c
··· 5350 5350 } 5351 5351 5352 5352 /* Enable IRQ */ 5353 + if (!rdev->irq.installed) { 5354 + r = radeon_irq_kms_init(rdev); 5355 + if (r) 5356 + return r; 5357 + } 5358 + 5353 5359 r = si_irq_init(rdev); 5354 5360 if (r) { 5355 5361 DRM_ERROR("radeon: IH init failed (%d).\n", r); ··· 5536 5530 return r; 5537 5531 /* Memory manager */ 5538 5532 r = radeon_bo_init(rdev); 5539 - if (r) 5540 - return r; 5541 - 5542 - r = radeon_irq_kms_init(rdev); 5543 5533 if (r) 5544 5534 return r; 5545 5535
+1
drivers/gpu/drm/tilcdc/Kconfig
··· 6 6 select DRM_GEM_CMA_HELPER 7 7 select VIDEOMODE_HELPERS 8 8 select BACKLIGHT_CLASS_DEVICE 9 + select BACKLIGHT_LCD_SUPPORT 9 10 help 10 11 Choose this option if you have an TI SoC with LCDC display 11 12 controller, for example AM33xx in beagle-bone, DA8xx, or
+4 -1
drivers/iio/buffer_cb.c
··· 64 64 while (chan->indio_dev) { 65 65 if (chan->indio_dev != indio_dev) { 66 66 ret = -EINVAL; 67 - goto error_release_channels; 67 + goto error_free_scan_mask; 68 68 } 69 69 set_bit(chan->channel->scan_index, 70 70 cb_buff->buffer.scan_mask); ··· 73 73 74 74 return cb_buff; 75 75 76 + error_free_scan_mask: 77 + kfree(cb_buff->buffer.scan_mask); 76 78 error_release_channels: 77 79 iio_channel_release_all(cb_buff->channels); 78 80 error_free_cb_buff: ··· 102 100 103 101 void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) 104 102 { 103 + kfree(cb_buff->buffer.scan_mask); 105 104 iio_channel_release_all(cb_buff->channels); 106 105 kfree(cb_buff); 107 106 }
+1 -1
drivers/iio/frequency/adf4350.c
··· 212 212 (pdata->r2_user_settings & (ADF4350_REG2_PD_POLARITY_POS | 213 213 ADF4350_REG2_LDP_6ns | ADF4350_REG2_LDF_INT_N | 214 214 ADF4350_REG2_CHARGE_PUMP_CURR_uA(5000) | 215 - ADF4350_REG2_MUXOUT(0x7) | ADF4350_REG2_NOISE_MODE(0x9))); 215 + ADF4350_REG2_MUXOUT(0x7) | ADF4350_REG2_NOISE_MODE(0x3))); 216 216 217 217 st->regs[ADF4350_REG3] = pdata->r3_user_settings & 218 218 (ADF4350_REG3_12BIT_CLKDIV(0xFFF) |
+2 -2
drivers/iio/inkern.c
··· 124 124 channel->indio_dev = indio_dev; 125 125 index = iiospec.args_count ? iiospec.args[0] : 0; 126 126 if (index >= indio_dev->num_channels) { 127 - return -EINVAL; 127 + err = -EINVAL; 128 128 goto err_put; 129 129 } 130 130 channel->channel = &indio_dev->channels[index]; ··· 450 450 s64 raw64 = raw; 451 451 int ret; 452 452 453 - ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_SCALE); 453 + ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_OFFSET); 454 454 if (ret == 0) 455 455 raw64 += offset; 456 456
+1 -1
drivers/infiniband/hw/qib/qib_keys.c
··· 61 61 if (dma_region) { 62 62 struct qib_mregion *tmr; 63 63 64 - tmr = rcu_dereference(dev->dma_mr); 64 + tmr = rcu_access_pointer(dev->dma_mr); 65 65 if (!tmr) { 66 66 qib_get_mr(mr); 67 67 rcu_assign_pointer(dev->dma_mr, mr);
+1
drivers/infiniband/ulp/iser/iscsi_iser.c
··· 5 5 * Copyright (C) 2004 Alex Aizman 6 6 * Copyright (C) 2005 Mike Christie 7 7 * Copyright (c) 2005, 2006 Voltaire, Inc. All rights reserved. 8 + * Copyright (c) 2013 Mellanox Technologies. All rights reserved. 8 9 * maintained by openib-general@openib.org 9 10 * 10 11 * This software is available to you under a choice of one of two
+1
drivers/infiniband/ulp/iser/iscsi_iser.h
··· 8 8 * 9 9 * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. 10 10 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 11 + * Copyright (c) 2013 Mellanox Technologies. All rights reserved. 11 12 * 12 13 * This software is available to you under a choice of one of two 13 14 * licenses. You may choose to be licensed under the terms of the GNU
+1
drivers/infiniband/ulp/iser/iser_initiator.c
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. 3 + * Copyright (c) 2013 Mellanox Technologies. All rights reserved. 3 4 * 4 5 * This software is available to you under a choice of one of two 5 6 * licenses. You may choose to be licensed under the terms of the GNU
+1
drivers/infiniband/ulp/iser/iser_memory.c
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. 3 + * Copyright (c) 2013 Mellanox Technologies. All rights reserved. 3 4 * 4 5 * This software is available to you under a choice of one of two 5 6 * licenses. You may choose to be licensed under the terms of the GNU
+9 -7
drivers/infiniband/ulp/iser/iser_verbs.c
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. 3 3 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 4 + * Copyright (c) 2013 Mellanox Technologies. All rights reserved. 4 5 * 5 6 * This software is available to you under a choice of one of two 6 7 * licenses. You may choose to be licensed under the terms of the GNU ··· 293 292 } 294 293 295 294 /** 296 - * releases the FMR pool, QP and CMA ID objects, returns 0 on success, 295 + * releases the FMR pool and QP objects, returns 0 on success, 297 296 * -1 on failure 298 297 */ 299 - static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id) 298 + static int iser_free_ib_conn_res(struct iser_conn *ib_conn) 300 299 { 301 300 int cq_index; 302 301 BUG_ON(ib_conn == NULL); ··· 315 314 316 315 rdma_destroy_qp(ib_conn->cma_id); 317 316 } 318 - /* if cma handler context, the caller acts s.t the cma destroy the id */ 319 - if (ib_conn->cma_id != NULL && can_destroy_id) 320 - rdma_destroy_id(ib_conn->cma_id); 321 317 322 318 ib_conn->fmr_pool = NULL; 323 319 ib_conn->qp = NULL; 324 - ib_conn->cma_id = NULL; 325 320 kfree(ib_conn->page_vec); 326 321 327 322 if (ib_conn->login_buf) { ··· 412 415 list_del(&ib_conn->conn_list); 413 416 mutex_unlock(&ig.connlist_mutex); 414 417 iser_free_rx_descriptors(ib_conn); 415 - iser_free_ib_conn_res(ib_conn, can_destroy_id); 418 + iser_free_ib_conn_res(ib_conn); 416 419 ib_conn->device = NULL; 417 420 /* on EVENT_ADDR_ERROR there's no device yet for this conn */ 418 421 if (device != NULL) 419 422 iser_device_try_release(device); 423 + /* if cma handler context, the caller actually destroy the id */ 424 + if (ib_conn->cma_id != NULL && can_destroy_id) { 425 + rdma_destroy_id(ib_conn->cma_id); 426 + ib_conn->cma_id = NULL; 427 + } 420 428 iscsi_destroy_endpoint(ib_conn->ep); 421 429 } 422 430
+2
drivers/input/mouse/synaptics.c
··· 1379 1379 { 1380 1380 struct synaptics_data *priv = psmouse->private; 1381 1381 struct synaptics_data old_priv = *priv; 1382 + unsigned char param[2]; 1382 1383 int retry = 0; 1383 1384 int error; 1384 1385 ··· 1395 1394 */ 1396 1395 ssleep(1); 1397 1396 } 1397 + ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETID); 1398 1398 error = synaptics_detect(psmouse, 0); 1399 1399 } while (error && ++retry < 3); 1400 1400
+5 -3
drivers/input/tablet/wacom_wac.c
··· 1966 1966 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1967 1967 static const struct wacom_features wacom_features_0xF8 = 1968 1968 { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */ 1969 - 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; 1969 + 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 1970 + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; 1970 1971 static const struct wacom_features wacom_features_0xF6 = 1971 1972 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ 1972 1973 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; ··· 2010 2009 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 2011 2010 static const struct wacom_features wacom_features_0x5B = 2012 2011 { "Wacom Cintiq 22HDT", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, 2013 - 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e }; 2012 + 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2013 + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e }; 2014 2014 static const struct wacom_features wacom_features_0x5E = 2015 2015 { "Wacom Cintiq 22HDT", .type = WACOM_24HDT, 2016 2016 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10 }; ··· 2044 2042 static const struct wacom_features wacom_features_0xE6 = 2045 2043 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, 2046 2044 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2047 - .touch_max = 2 }; 2045 + .touch_max = 2 }; 2048 2046 static const struct wacom_features wacom_features_0xEC = 2049 2047 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, 2050 2048 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+4 -10
drivers/irqchip/irq-mxs.c
··· 76 76 { 77 77 u32 irqnr; 78 78 79 - do { 80 - irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET); 81 - if (irqnr != 0x7f) { 82 - __raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR); 83 - irqnr = irq_find_mapping(icoll_domain, irqnr); 84 - handle_IRQ(irqnr, regs); 85 - continue; 86 - } 87 - break; 88 - } while (1); 79 + irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET); 80 + __raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR); 81 + irqnr = irq_find_mapping(icoll_domain, irqnr); 82 + handle_IRQ(irqnr, regs); 89 83 } 90 84 91 85 static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq,
+1 -1
drivers/irqchip/irq-versatile-fpga.c
··· 119 119 120 120 /* Skip invalid IRQs, only register handlers for the real ones */ 121 121 if (!(f->valid & BIT(hwirq))) 122 - return -ENOTSUPP; 122 + return -EPERM; 123 123 irq_set_chip_data(irq, f); 124 124 irq_set_chip_and_handler(irq, &f->chip, 125 125 handle_level_irq);
+1 -1
drivers/irqchip/irq-vic.c
··· 197 197 198 198 /* Skip invalid IRQs, only register handlers for the real ones */ 199 199 if (!(v->valid_sources & (1 << hwirq))) 200 - return -ENOTSUPP; 200 + return -EPERM; 201 201 irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); 202 202 irq_set_chip_data(irq, v->base); 203 203 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+12 -13
drivers/mmc/host/atmel-mci.c
··· 2230 2230 mmc_free_host(slot->mmc); 2231 2231 } 2232 2232 2233 - static bool atmci_filter(struct dma_chan *chan, void *slave) 2233 + static bool atmci_filter(struct dma_chan *chan, void *pdata) 2234 2234 { 2235 - struct mci_dma_data *sl = slave; 2235 + struct mci_platform_data *sl_pdata = pdata; 2236 + struct mci_dma_data *sl; 2236 2237 2238 + if (!sl_pdata) 2239 + return false; 2240 + 2241 + sl = sl_pdata->dma_slave; 2237 2242 if (sl && find_slave_dev(sl) == chan->device->dev) { 2238 2243 chan->private = slave_data_ptr(sl); 2239 2244 return true; ··· 2250 2245 static bool atmci_configure_dma(struct atmel_mci *host) 2251 2246 { 2252 2247 struct mci_platform_data *pdata; 2248 + dma_cap_mask_t mask; 2253 2249 2254 2250 if (host == NULL) 2255 2251 return false; 2256 2252 2257 2253 pdata = host->pdev->dev.platform_data; 2258 2254 2259 - if (!pdata) 2260 - return false; 2255 + dma_cap_zero(mask); 2256 + dma_cap_set(DMA_SLAVE, mask); 2261 2257 2262 - if (pdata->dma_slave && find_slave_dev(pdata->dma_slave)) { 2263 - dma_cap_mask_t mask; 2264 - 2265 - /* Try to grab a DMA channel */ 2266 - dma_cap_zero(mask); 2267 - dma_cap_set(DMA_SLAVE, mask); 2268 - host->dma.chan = 2269 - dma_request_channel(mask, atmci_filter, pdata->dma_slave); 2270 - } 2258 + host->dma.chan = dma_request_slave_channel_compat(mask, atmci_filter, pdata, 2259 + &host->pdev->dev, "rxtx"); 2271 2260 if (!host->dma.chan) { 2272 2261 dev_warn(&host->pdev->dev, "no DMA channel available\n"); 2273 2262 return false;
+32 -19
drivers/mmc/host/omap_hsmmc.c
··· 161 161 */ 162 162 struct regulator *vcc; 163 163 struct regulator *vcc_aux; 164 + int pbias_disable; 164 165 void __iomem *base; 165 166 resource_size_t mapbase; 166 167 spinlock_t irq_lock; /* Prevent races with irq handler */ ··· 256 255 if (!host->vcc) 257 256 return 0; 258 257 /* 259 - * With DT, never turn OFF the regulator. This is because 258 + * With DT, never turn OFF the regulator for MMC1. This is because 260 259 * the pbias cell programming support is still missing when 261 260 * booting with Device tree 262 261 */ 263 - if (dev->of_node && !vdd) 262 + if (host->pbias_disable && !vdd) 264 263 return 0; 265 264 266 265 if (mmc_slot(host).before_set_reg) ··· 1521 1520 (ios->vdd == DUAL_VOLT_OCR_BIT) && 1522 1521 /* 1523 1522 * With pbias cell programming missing, this 1524 - * can't be allowed when booting with device 1523 + * can't be allowed on MMC1 when booting with device 1525 1524 * tree. 1526 1525 */ 1527 - !host->dev->of_node) { 1526 + !host->pbias_disable) { 1528 1527 /* 1529 1528 * The mmc_select_voltage fn of the core does 1530 1529 * not seem to set the power_mode to ··· 1872 1871 1873 1872 omap_hsmmc_context_save(host); 1874 1873 1874 + /* This can be removed once we support PBIAS with DT */ 1875 + if (host->dev->of_node && host->mapbase == 0x4809c000) 1876 + host->pbias_disable = 1; 1877 + 1875 1878 host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck"); 1876 1879 /* 1877 1880 * MMC can still work without debounce clock. ··· 1911 1906 1912 1907 omap_hsmmc_conf_bus_power(host); 1913 1908 1914 - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); 1915 - if (!res) { 1916 - dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); 1917 - ret = -ENXIO; 1918 - goto err_irq; 1919 - } 1920 - tx_req = res->start; 1909 + if (!pdev->dev.of_node) { 1910 + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); 1911 + if (!res) { 1912 + dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); 1913 + ret = -ENXIO; 1914 + goto err_irq; 1915 + } 1916 + tx_req = res->start; 1921 1917 1922 - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); 1923 - if (!res) { 1924 - dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); 1925 - ret = -ENXIO; 1926 - goto err_irq; 1918 + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); 1919 + if (!res) { 1920 + dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); 1921 + ret = -ENXIO; 1922 + goto err_irq; 1923 + } 1924 + rx_req = res->start; 1927 1925 } 1928 - rx_req = res->start; 1929 1926 1930 1927 dma_cap_zero(mask); 1931 1928 dma_cap_set(DMA_SLAVE, mask); 1932 1929 1933 - host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req); 1930 + host->rx_chan = 1931 + dma_request_slave_channel_compat(mask, omap_dma_filter_fn, 1932 + &rx_req, &pdev->dev, "rx"); 1933 + 1934 1934 if (!host->rx_chan) { 1935 1935 dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); 1936 1936 ret = -ENXIO; 1937 1937 goto err_irq; 1938 1938 } 1939 1939 1940 - host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req); 1940 + host->tx_chan = 1941 + dma_request_slave_channel_compat(mask, omap_dma_filter_fn, 1942 + &tx_req, &pdev->dev, "tx"); 1943 + 1941 1944 if (!host->tx_chan) { 1942 1945 dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); 1943 1946 ret = -ENXIO;
+59 -8
drivers/mmc/host/sdhci-acpi.c
··· 87 87 .enable_dma = sdhci_acpi_enable_dma, 88 88 }; 89 89 90 + static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = { 91 + .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 92 + .caps2 = MMC_CAP2_HC_ERASE_SZ, 93 + .flags = SDHCI_ACPI_RUNTIME_PM, 94 + }; 95 + 90 96 static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = { 91 97 .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON, 92 98 .caps = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD, ··· 100 94 .pm_caps = MMC_PM_KEEP_POWER, 101 95 }; 102 96 97 + static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sd = { 98 + }; 99 + 100 + struct sdhci_acpi_uid_slot { 101 + const char *hid; 102 + const char *uid; 103 + const struct sdhci_acpi_slot *slot; 104 + }; 105 + 106 + static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = { 107 + { "80860F14" , "1" , &sdhci_acpi_slot_int_emmc }, 108 + { "80860F14" , "3" , &sdhci_acpi_slot_int_sd }, 109 + { "INT33BB" , "2" , &sdhci_acpi_slot_int_sdio }, 110 + { "INT33C6" , NULL, &sdhci_acpi_slot_int_sdio }, 111 + { "PNP0D40" }, 112 + { }, 113 + }; 114 + 103 115 static const struct acpi_device_id sdhci_acpi_ids[] = { 104 - { "INT33C6", (kernel_ulong_t)&sdhci_acpi_slot_int_sdio }, 105 - { "PNP0D40" }, 116 + { "80860F14" }, 117 + { "INT33BB" }, 118 + { "INT33C6" }, 119 + { "PNP0D40" }, 106 120 { }, 107 121 }; 108 122 MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids); 109 123 110 - static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid) 124 + static const struct sdhci_acpi_slot *sdhci_acpi_get_slot_by_ids(const char *hid, 125 + const char *uid) 111 126 { 112 - const struct acpi_device_id *id; 127 + const struct sdhci_acpi_uid_slot *u; 113 128 114 - for (id = sdhci_acpi_ids; id->id[0]; id++) 115 - if (!strcmp(id->id, hid)) 116 - return (const struct sdhci_acpi_slot *)id->driver_data; 129 + for (u = sdhci_acpi_uids; u->hid; u++) { 130 + if (strcmp(u->hid, hid)) 131 + continue; 132 + if (!u->uid) 133 + return u->slot; 134 + if (uid && !strcmp(u->uid, uid)) 135 + return u->slot; 136 + } 117 137 return NULL; 138 + } 139 + 140 + static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(acpi_handle handle, 141 + const char *hid) 142 + { 143 + const struct sdhci_acpi_slot *slot; 144 + struct acpi_device_info *info; 145 + const char *uid = NULL; 146 + acpi_status status; 147 + 148 + status = acpi_get_object_info(handle, &info); 149 + if (!ACPI_FAILURE(status) && (info->valid & ACPI_VALID_UID)) 150 + uid = info->unique_id.string; 151 + 152 + slot = sdhci_acpi_get_slot_by_ids(hid, uid); 153 + 154 + kfree(info); 155 + return slot; 118 156 } 119 157 120 158 static int sdhci_acpi_probe(struct platform_device *pdev) ··· 198 148 199 149 c = sdhci_priv(host); 200 150 c->host = host; 201 - c->slot = sdhci_acpi_get_slot(hid); 151 + c->slot = sdhci_acpi_get_slot(handle, hid); 202 152 c->pdev = pdev; 203 153 c->use_runtime_pm = sdhci_acpi_flag(c, SDHCI_ACPI_RUNTIME_PM); 204 154 ··· 252 202 goto err_free; 253 203 254 204 if (c->use_runtime_pm) { 205 + pm_runtime_set_active(dev); 255 206 pm_suspend_ignore_children(dev, 1); 256 207 pm_runtime_set_autosuspend_delay(dev, 50); 257 208 pm_runtime_use_autosuspend(dev);
+37 -4
drivers/mmc/host/sdhci-esdhc-imx.c
··· 85 85 struct clk *clk_ipg; 86 86 struct clk *clk_ahb; 87 87 struct clk *clk_per; 88 + enum { 89 + NO_CMD_PENDING, /* no multiblock command pending*/ 90 + MULTIBLK_IN_PROCESS, /* exact multiblock cmd in process */ 91 + WAIT_FOR_INT, /* sent CMD12, waiting for response INT */ 92 + } multiblock_status; 93 + 88 94 }; 89 95 90 96 static struct platform_device_id imx_esdhc_devtype[] = { ··· 160 154 161 155 static u32 esdhc_readl_le(struct sdhci_host *host, int reg) 162 156 { 157 + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 158 + struct pltfm_imx_data *imx_data = pltfm_host->priv; 163 159 u32 val = readl(host->ioaddr + reg); 164 160 165 161 if (unlikely(reg == SDHCI_CAPABILITIES)) { ··· 182 174 if (val & ESDHC_INT_VENDOR_SPEC_DMA_ERR) { 183 175 val &= ~ESDHC_INT_VENDOR_SPEC_DMA_ERR; 184 176 val |= SDHCI_INT_ADMA_ERROR; 177 + } 178 + 179 + /* 180 + * mask off the interrupt we get in response to the manually 181 + * sent CMD12 182 + */ 183 + if ((imx_data->multiblock_status == WAIT_FOR_INT) && 184 + ((val & SDHCI_INT_RESPONSE) == SDHCI_INT_RESPONSE)) { 185 + val &= ~SDHCI_INT_RESPONSE; 186 + writel(SDHCI_INT_RESPONSE, host->ioaddr + 187 + SDHCI_INT_STATUS); 188 + imx_data->multiblock_status = NO_CMD_PENDING; 185 189 } 186 190 } 187 191 ··· 231 211 v = readl(host->ioaddr + ESDHC_VENDOR_SPEC); 232 212 v &= ~ESDHC_VENDOR_SPEC_SDIO_QUIRK; 233 213 writel(v, host->ioaddr + ESDHC_VENDOR_SPEC); 214 + 215 + if (imx_data->multiblock_status == MULTIBLK_IN_PROCESS) 216 + { 217 + /* send a manual CMD12 with RESPTYP=none */ 218 + data = MMC_STOP_TRANSMISSION << 24 | 219 + SDHCI_CMD_ABORTCMD << 16; 220 + writel(data, host->ioaddr + SDHCI_TRANSFER_MODE); 221 + imx_data->multiblock_status = WAIT_FOR_INT; 222 + } 234 223 } 235 224 236 225 if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) { ··· 306 277 } 307 278 return; 308 279 case SDHCI_COMMAND: 309 - if ((host->cmd->opcode == MMC_STOP_TRANSMISSION || 310 - host->cmd->opcode == MMC_SET_BLOCK_COUNT) && 311 - (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) 280 + if (host->cmd->opcode == MMC_STOP_TRANSMISSION) 312 281 val |= SDHCI_CMD_ABORTCMD; 282 + 283 + if ((host->cmd->opcode == MMC_SET_BLOCK_COUNT) && 284 + (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) 285 + imx_data->multiblock_status = MULTIBLK_IN_PROCESS; 313 286 314 287 if (is_imx6q_usdhc(imx_data)) 315 288 writel(val << 16, ··· 355 324 /* 356 325 * Do not touch buswidth bits here. This is done in 357 326 * esdhc_pltfm_bus_width. 327 + * Do not touch the D3CD bit either which is used for the 328 + * SDIO interrupt errata workaround. 358 329 */ 359 - mask = 0xffff & ~ESDHC_CTRL_BUSWIDTH_MASK; 330 + mask = 0xffff & ~(ESDHC_CTRL_BUSWIDTH_MASK | ESDHC_CTRL_D3CD); 360 331 361 332 esdhc_clrset_le(host, mask, new_val, reg); 362 333 return;
+54
drivers/mmc/host/sdhci-pci.c
··· 33 33 */ 34 34 #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809 35 35 #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a 36 + #define PCI_DEVICE_ID_INTEL_BYT_EMMC 0x0f14 37 + #define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15 38 + #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16 36 39 37 40 /* 38 41 * PCI registers ··· 305 302 static const struct sdhci_pci_fixes sdhci_intel_pch_sdio = { 306 303 .quirks = SDHCI_QUIRK_BROKEN_ADMA, 307 304 .probe_slot = pch_hc_probe_slot, 305 + }; 306 + 307 + static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) 308 + { 309 + slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; 310 + slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ; 311 + return 0; 312 + } 313 + 314 + static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) 315 + { 316 + slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; 317 + return 0; 318 + } 319 + 320 + static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = { 321 + .allow_runtime_pm = true, 322 + .probe_slot = byt_emmc_probe_slot, 323 + }; 324 + 325 + static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = { 326 + .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON, 327 + .allow_runtime_pm = true, 328 + .probe_slot = byt_sdio_probe_slot, 329 + }; 330 + 331 + static const struct sdhci_pci_fixes sdhci_intel_byt_sd = { 308 332 }; 309 333 310 334 /* O2Micro extra registers */ ··· 883 853 .subvendor = PCI_ANY_ID, 884 854 .subdevice = PCI_ANY_ID, 885 855 .driver_data = (kernel_ulong_t)&sdhci_intel_pch_sdio, 856 + }, 857 + 858 + { 859 + .vendor = PCI_VENDOR_ID_INTEL, 860 + .device = PCI_DEVICE_ID_INTEL_BYT_EMMC, 861 + .subvendor = PCI_ANY_ID, 862 + .subdevice = PCI_ANY_ID, 863 + .driver_data = (kernel_ulong_t)&sdhci_intel_byt_emmc, 864 + }, 865 + 866 + { 867 + .vendor = PCI_VENDOR_ID_INTEL, 868 + .device = PCI_DEVICE_ID_INTEL_BYT_SDIO, 869 + .subvendor = PCI_ANY_ID, 870 + .subdevice = PCI_ANY_ID, 871 + .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sdio, 872 + }, 873 + 874 + { 875 + .vendor = PCI_VENDOR_ID_INTEL, 876 + .device = PCI_DEVICE_ID_INTEL_BYT_SD, 877 + .subvendor = PCI_ANY_ID, 878 + .subdevice = PCI_ANY_ID, 879 + .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sd, 886 880 }, 887 881 888 882 {
+77 -52
drivers/net/can/usb/esd_usb2.c
··· 612 612 { 613 613 struct esd_usb2 *dev = priv->usb2; 614 614 struct net_device *netdev = priv->netdev; 615 - struct esd_usb2_msg msg; 615 + struct esd_usb2_msg *msg; 616 616 int err, i; 617 + 618 + msg = kmalloc(sizeof(*msg), GFP_KERNEL); 619 + if (!msg) { 620 + err = -ENOMEM; 621 + goto out; 622 + } 617 623 618 624 /* 619 625 * Enable all IDs ··· 634 628 * the number of the starting bitmask (0..64) to the filter.option 635 629 * field followed by only some bitmasks. 636 630 */ 637 - msg.msg.hdr.cmd = CMD_IDADD; 638 - msg.msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; 639 - msg.msg.filter.net = priv->index; 640 - msg.msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ 631 + msg->msg.hdr.cmd = CMD_IDADD; 632 + msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; 633 + msg->msg.filter.net = priv->index; 634 + msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ 641 635 for (i = 0; i < ESD_MAX_ID_SEGMENT; i++) 642 - msg.msg.filter.mask[i] = cpu_to_le32(0xffffffff); 636 + msg->msg.filter.mask[i] = cpu_to_le32(0xffffffff); 643 637 /* enable 29bit extended IDs */ 644 - msg.msg.filter.mask[ESD_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); 638 + msg->msg.filter.mask[ESD_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); 645 639 646 - err = esd_usb2_send_msg(dev, &msg); 640 + err = esd_usb2_send_msg(dev, msg); 647 641 if (err) 648 - goto failed; 642 + goto out; 649 643 650 644 err = esd_usb2_setup_rx_urbs(dev); 651 645 if (err) 652 - goto failed; 646 + goto out; 653 647 654 648 priv->can.state = CAN_STATE_ERROR_ACTIVE; 655 649 656 - return 0; 657 - 658 - failed: 650 + out: 659 651 if (err == -ENODEV) 660 652 netif_device_detach(netdev); 653 + if (err) 654 + netdev_err(netdev, "couldn't start device: %d\n", err); 661 655 662 - netdev_err(netdev, "couldn't start device: %d\n", err); 663 - 656 + kfree(msg); 664 657 return err; 665 658 } 666 659 ··· 838 833 static int esd_usb2_close(struct net_device *netdev) 839 834 { 840 835 struct esd_usb2_net_priv *priv = netdev_priv(netdev); 841 - struct esd_usb2_msg msg; 836 + struct esd_usb2_msg *msg; 842 837 int i; 843 838 839 + msg = kmalloc(sizeof(*msg), GFP_KERNEL); 840 + if (!msg) 841 + return -ENOMEM; 842 + 844 843 /* Disable all IDs (see esd_usb2_start()) */ 845 - msg.msg.hdr.cmd = CMD_IDADD; 846 - msg.msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; 847 - msg.msg.filter.net = priv->index; 848 - msg.msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ 844 + msg->msg.hdr.cmd = CMD_IDADD; 845 + msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; 846 + msg->msg.filter.net = priv->index; 847 + msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ 849 848 for (i = 0; i <= ESD_MAX_ID_SEGMENT; i++) 850 - msg.msg.filter.mask[i] = 0; 851 - if (esd_usb2_send_msg(priv->usb2, &msg) < 0) 849 + msg->msg.filter.mask[i] = 0; 850 + if (esd_usb2_send_msg(priv->usb2, msg) < 0) 852 851 netdev_err(netdev, "sending idadd message failed\n"); 853 852 854 853 /* set CAN controller to reset mode */ 855 - msg.msg.hdr.len = 2; 856 - msg.msg.hdr.cmd = CMD_SETBAUD; 857 - msg.msg.setbaud.net = priv->index; 858 - msg.msg.setbaud.rsvd = 0; 859 - msg.msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE); 860 - if (esd_usb2_send_msg(priv->usb2, &msg) < 0) 854 + msg->msg.hdr.len = 2; 855 + msg->msg.hdr.cmd = CMD_SETBAUD; 856 + msg->msg.setbaud.net = priv->index; 857 + msg->msg.setbaud.rsvd = 0; 858 + msg->msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE); 859 + if (esd_usb2_send_msg(priv->usb2, msg) < 0) 861 860 netdev_err(netdev, "sending setbaud message failed\n"); 862 861 863 862 priv->can.state = CAN_STATE_STOPPED; ··· 869 860 netif_stop_queue(netdev); 870 861 871 862 close_candev(netdev); 863 + 864 + kfree(msg); 872 865 873 866 return 0; 874 867 } ··· 897 886 { 898 887 struct esd_usb2_net_priv *priv = netdev_priv(netdev); 899 888 struct can_bittiming *bt = &priv->can.bittiming; 900 - struct esd_usb2_msg msg; 889 + struct esd_usb2_msg *msg; 890 + int err; 901 891 u32 canbtr; 902 892 int sjw_shift; 903 893 ··· 924 912 if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) 925 913 canbtr |= ESD_USB2_3_SAMPLES; 926 914 927 - msg.msg.hdr.len = 2; 928 - msg.msg.hdr.cmd = CMD_SETBAUD; 929 - msg.msg.setbaud.net = priv->index; 930 - msg.msg.setbaud.rsvd = 0; 931 - msg.msg.setbaud.baud = cpu_to_le32(canbtr); 915 + msg = kmalloc(sizeof(*msg), GFP_KERNEL); 916 + if (!msg) 917 + return -ENOMEM; 918 + 919 + msg->msg.hdr.len = 2; 920 + msg->msg.hdr.cmd = CMD_SETBAUD; 921 + msg->msg.setbaud.net = priv->index; 922 + msg->msg.setbaud.rsvd = 0; 923 + msg->msg.setbaud.baud = cpu_to_le32(canbtr); 932 924 933 925 netdev_info(netdev, "setting BTR=%#x\n", canbtr); 934 926 935 - return esd_usb2_send_msg(priv->usb2, &msg); 927 + err = esd_usb2_send_msg(priv->usb2, msg); 928 + 929 + kfree(msg); 930 + return err; 936 931 } 937 932 938 933 static int esd_usb2_get_berr_counter(const struct net_device *netdev, ··· 1041 1022 const struct usb_device_id *id) 1042 1023 { 1043 1024 struct esd_usb2 *dev; 1044 - struct esd_usb2_msg msg; 1025 + struct esd_usb2_msg *msg; 1045 1026 int i, err; 1046 1027 1047 1028 dev = kzalloc(sizeof(*dev), GFP_KERNEL); ··· 1056 1037 1057 1038 usb_set_intfdata(intf, dev); 1058 1039 1059 - /* query number of CAN interfaces (nets) */ 1060 - msg.msg.hdr.cmd = CMD_VERSION; 1061 - msg.msg.hdr.len = 2; 1062 - msg.msg.version.rsvd = 0; 1063 - msg.msg.version.flags = 0; 1064 - msg.msg.version.drv_version = 0; 1040 + msg = kmalloc(sizeof(*msg), GFP_KERNEL); 1041 + if (!msg) { 1042 + err = -ENOMEM; 1043 + goto free_msg; 1044 + } 1065 1045 1066 - err = esd_usb2_send_msg(dev, &msg); 1046 + /* query number of CAN interfaces (nets) */ 1047 + msg->msg.hdr.cmd = CMD_VERSION; 1048 + msg->msg.hdr.len = 2; 1049 + msg->msg.version.rsvd = 0; 1050 + msg->msg.version.flags = 0; 1051 + msg->msg.version.drv_version = 0; 1052 + 1053 + err = esd_usb2_send_msg(dev, msg); 1067 1054 if (err < 0) { 1068 1055 dev_err(&intf->dev, "sending version message failed\n"); 1069 - goto free_dev; 1056 + goto free_msg; 1070 1057 } 1071 1058 1072 - err = esd_usb2_wait_msg(dev, &msg); 1059 + err = esd_usb2_wait_msg(dev, msg); 1073 1060 if (err < 0) { 1074 1061 dev_err(&intf->dev, "no version message answer\n"); 1075 - goto free_dev; 1062 + goto free_msg; 1076 1063 } 1077 1064 1078 - dev->net_count = (int)msg.msg.version_reply.nets; 1079 - dev->version = le32_to_cpu(msg.msg.version_reply.version); 1065 + dev->net_count = (int)msg->msg.version_reply.nets; 1066 + dev->version = le32_to_cpu(msg->msg.version_reply.version); 1080 1067 1081 1068 if (device_create_file(&intf->dev, &dev_attr_firmware)) 1082 1069 dev_err(&intf->dev, ··· 1100 1075 for (i = 0; i < dev->net_count; i++) 1101 1076 esd_usb2_probe_one_net(intf, i); 1102 1077 1103 - return 0; 1104 - 1105 - free_dev: 1106 - kfree(dev); 1078 + free_msg: 1079 + kfree(msg); 1080 + if (err) 1081 + kfree(dev); 1107 1082 done: 1108 1083 return err; 1109 1084 }
+43 -21
drivers/net/can/usb/kvaser_usb.c
··· 136 136 #define KVASER_CTRL_MODE_SELFRECEPTION 3 137 137 #define KVASER_CTRL_MODE_OFF 4 138 138 139 + /* log message */ 140 + #define KVASER_EXTENDED_FRAME BIT(31) 141 + 139 142 struct kvaser_msg_simple { 140 143 u8 tid; 141 144 u8 channel; ··· 820 817 priv = dev->nets[channel]; 821 818 stats = &priv->netdev->stats; 822 819 823 - if (msg->u.rx_can.flag & (MSG_FLAG_ERROR_FRAME | MSG_FLAG_NERR | 824 - MSG_FLAG_OVERRUN)) { 820 + if ((msg->u.rx_can.flag & MSG_FLAG_ERROR_FRAME) && 821 + (msg->id == CMD_LOG_MESSAGE)) { 822 + kvaser_usb_rx_error(dev, msg); 823 + return; 824 + } else if (msg->u.rx_can.flag & (MSG_FLAG_ERROR_FRAME | 825 + MSG_FLAG_NERR | 826 + MSG_FLAG_OVERRUN)) { 825 827 kvaser_usb_rx_can_err(priv, msg); 826 828 return; 827 829 } else if (msg->u.rx_can.flag & ~MSG_FLAG_REMOTE_FRAME) { ··· 842 834 return; 843 835 } 844 836 845 - cf->can_id = ((msg->u.rx_can.msg[0] & 0x1f) << 6) | 846 - (msg->u.rx_can.msg[1] & 0x3f); 847 - cf->can_dlc = get_can_dlc(msg->u.rx_can.msg[5]); 837 + if (msg->id == CMD_LOG_MESSAGE) { 838 + cf->can_id = le32_to_cpu(msg->u.log_message.id); 839 + if (cf->can_id & KVASER_EXTENDED_FRAME) 840 + cf->can_id &= CAN_EFF_MASK | CAN_EFF_FLAG; 841 + else 842 + cf->can_id &= CAN_SFF_MASK; 848 843 849 - if (msg->id == CMD_RX_EXT_MESSAGE) { 850 - cf->can_id <<= 18; 851 - cf->can_id |= ((msg->u.rx_can.msg[2] & 0x0f) << 14) | 852 - ((msg->u.rx_can.msg[3] & 0xff) << 6) | 853 - (msg->u.rx_can.msg[4] & 0x3f); 854 - cf->can_id |= CAN_EFF_FLAG; 844 + cf->can_dlc = get_can_dlc(msg->u.log_message.dlc); 845 + 846 + if (msg->u.log_message.flags & MSG_FLAG_REMOTE_FRAME) 847 + cf->can_id |= CAN_RTR_FLAG; 848 + else 849 + memcpy(cf->data, &msg->u.log_message.data, 850 + cf->can_dlc); 851 + } else { 852 + cf->can_id = ((msg->u.rx_can.msg[0] & 0x1f) << 6) | 853 + (msg->u.rx_can.msg[1] & 0x3f); 854 + 855 + if (msg->id == CMD_RX_EXT_MESSAGE) { 856 + cf->can_id <<= 18; 857 + cf->can_id |= ((msg->u.rx_can.msg[2] & 0x0f) << 14) | 858 + ((msg->u.rx_can.msg[3] & 0xff) << 6) | 859 + (msg->u.rx_can.msg[4] & 0x3f); 860 + cf->can_id |= CAN_EFF_FLAG; 861 + } 862 + 863 + cf->can_dlc = get_can_dlc(msg->u.rx_can.msg[5]); 864 + 865 + if (msg->u.rx_can.flag & MSG_FLAG_REMOTE_FRAME) 866 + cf->can_id |= CAN_RTR_FLAG; 867 + else 868 + memcpy(cf->data, &msg->u.rx_can.msg[6], 869 + cf->can_dlc); 855 870 } 856 - 857 - if (msg->u.rx_can.flag & MSG_FLAG_REMOTE_FRAME) 858 - cf->can_id |= CAN_RTR_FLAG; 859 - else 860 - memcpy(cf->data, &msg->u.rx_can.msg[6], cf->can_dlc); 861 871 862 872 netif_rx(skb); 863 873 ··· 937 911 938 912 case CMD_RX_STD_MESSAGE: 939 913 case CMD_RX_EXT_MESSAGE: 914 + case CMD_LOG_MESSAGE: 940 915 kvaser_usb_rx_can_msg(dev, msg); 941 916 break; 942 917 943 918 case CMD_CHIP_STATE_EVENT: 944 919 case CMD_CAN_ERROR_EVENT: 945 920 kvaser_usb_rx_error(dev, msg); 946 - break; 947 - 948 - case CMD_LOG_MESSAGE: 949 - if (msg->u.log_message.flags & MSG_FLAG_ERROR_FRAME) 950 - kvaser_usb_rx_error(dev, msg); 951 921 break; 952 922 953 923 case CMD_TX_ACKNOWLEDGE:
+40 -21
drivers/net/can/usb/peak_usb/pcan_usb_pro.c
··· 504 504 return usb_submit_urb(urb, GFP_ATOMIC); 505 505 } 506 506 507 - static void pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded) 507 + static int pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded) 508 508 { 509 - u8 buffer[16]; 509 + u8 *buffer; 510 + int err; 511 + 512 + buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL); 513 + if (!buffer) 514 + return -ENOMEM; 510 515 511 516 buffer[0] = 0; 512 517 buffer[1] = !!loaded; 513 518 514 - pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_FCT, 515 - PCAN_USBPRO_FCT_DRVLD, buffer, sizeof(buffer)); 519 + err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_FCT, 520 + PCAN_USBPRO_FCT_DRVLD, buffer, 521 + PCAN_USBPRO_FCT_DRVLD_REQ_LEN); 522 + kfree(buffer); 523 + 524 + return err; 516 525 } 517 526 518 527 static inline ··· 860 851 */ 861 852 static int pcan_usb_pro_init(struct peak_usb_device *dev) 862 853 { 863 - struct pcan_usb_pro_interface *usb_if; 864 854 struct pcan_usb_pro_device *pdev = 865 855 container_of(dev, struct pcan_usb_pro_device, dev); 856 + struct pcan_usb_pro_interface *usb_if = NULL; 857 + struct pcan_usb_pro_fwinfo *fi = NULL; 858 + struct pcan_usb_pro_blinfo *bi = NULL; 859 + int err; 866 860 867 861 /* do this for 1st channel only */ 868 862 if (!dev->prev_siblings) { 869 - struct pcan_usb_pro_fwinfo fi; 870 - struct pcan_usb_pro_blinfo bi; 871 - int err; 872 - 873 863 /* allocate netdevices common structure attached to first one */ 874 864 usb_if = kzalloc(sizeof(struct pcan_usb_pro_interface), 875 865 GFP_KERNEL); 876 - if (!usb_if) 877 - return -ENOMEM; 866 + fi = kmalloc(sizeof(struct pcan_usb_pro_fwinfo), GFP_KERNEL); 867 + bi = kmalloc(sizeof(struct pcan_usb_pro_blinfo), GFP_KERNEL); 868 + if (!usb_if || !fi || !bi) { 869 + err = -ENOMEM; 870 + goto err_out; 871 + } 878 872 879 873 /* number of ts msgs to ignore before taking one into account */ 880 874 usb_if->cm_ignore_count = 5; ··· 889 877 */ 890 878 err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_INFO, 891 879 PCAN_USBPRO_INFO_FW, 892 - &fi, sizeof(fi)); 880 + fi, sizeof(*fi)); 893 881 if (err) { 894 - kfree(usb_if); 895 882 dev_err(dev->netdev->dev.parent, 896 883 "unable to read %s firmware info (err %d)\n", 897 884 pcan_usb_pro.name, err); 898 - return err; 885 + goto err_out; 899 886 } 900 887 901 888 err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_INFO, 902 889 PCAN_USBPRO_INFO_BL, 903 - &bi, sizeof(bi)); 890 + bi, sizeof(*bi)); 904 891 if (err) { 905 - kfree(usb_if); 906 892 dev_err(dev->netdev->dev.parent, 907 893 "unable to read %s bootloader info (err %d)\n", 908 894 pcan_usb_pro.name, err); 909 - return err; 895 + goto err_out; 910 896 } 897 + 898 + /* tell the device the can driver is running */ 899 + err = pcan_usb_pro_drv_loaded(dev, 1); 900 + if (err) 901 + goto err_out; 911 902 912 903 dev_info(dev->netdev->dev.parent, 913 904 "PEAK-System %s hwrev %u serial %08X.%08X (%u channels)\n", 914 905 pcan_usb_pro.name, 915 - bi.hw_rev, bi.serial_num_hi, bi.serial_num_lo, 906 + bi->hw_rev, bi->serial_num_hi, bi->serial_num_lo, 916 907 pcan_usb_pro.ctrl_count); 917 - 918 - /* tell the device the can driver is running */ 919 - pcan_usb_pro_drv_loaded(dev, 1); 920 908 } else { 921 909 usb_if = pcan_usb_pro_dev_if(dev->prev_siblings); 922 910 } ··· 928 916 pcan_usb_pro_set_led(dev, 0, 1); 929 917 930 918 return 0; 919 + 920 + err_out: 921 + kfree(bi); 922 + kfree(fi); 923 + kfree(usb_if); 924 + 925 + return err; 931 926 } 932 927 933 928 static void pcan_usb_pro_exit(struct peak_usb_device *dev)
+1
drivers/net/can/usb/peak_usb/pcan_usb_pro.h
··· 29 29 30 30 /* Vendor Request value for XXX_FCT */ 31 31 #define PCAN_USBPRO_FCT_DRVLD 5 /* tell device driver is loaded */ 32 + #define PCAN_USBPRO_FCT_DRVLD_REQ_LEN 16 32 33 33 34 /* PCAN_USBPRO_INFO_BL vendor request record type */ 34 35 struct __packed pcan_usb_pro_blinfo {
+7 -9
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 3192 3192 rc |= XMIT_CSUM_TCP; 3193 3193 3194 3194 if (skb_is_gso_v6(skb)) { 3195 - rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP | XMIT_CSUM_V6); 3195 + rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP); 3196 3196 if (rc & XMIT_CSUM_ENC) 3197 3197 rc |= XMIT_GSO_ENC_V6; 3198 3198 } else if (skb_is_gso(skb)) { 3199 - rc |= (XMIT_GSO_V4 | XMIT_CSUM_V4 | XMIT_CSUM_TCP); 3199 + rc |= (XMIT_GSO_V4 | XMIT_CSUM_TCP); 3200 3200 if (rc & XMIT_CSUM_ENC) 3201 3201 rc |= XMIT_GSO_ENC_V4; 3202 3202 } ··· 3483 3483 { 3484 3484 u16 hlen_w = 0; 3485 3485 u8 outerip_off, outerip_len = 0; 3486 + 3486 3487 /* from outer IP to transport */ 3487 3488 hlen_w = (skb_inner_transport_header(skb) - 3488 3489 skb_network_header(skb)) >> 1; 3489 3490 3490 3491 /* transport len */ 3491 - if (xmit_type & XMIT_CSUM_TCP) 3492 - hlen_w += inner_tcp_hdrlen(skb) >> 1; 3493 - else 3494 - hlen_w += sizeof(struct udphdr) >> 1; 3492 + hlen_w += inner_tcp_hdrlen(skb) >> 1; 3495 3493 3496 3494 pbd2->fw_ip_hdr_to_payload_w = hlen_w; 3497 3495 3498 - if (xmit_type & XMIT_CSUM_ENC_V4) { 3496 + /* outer IP header info */ 3497 + if (xmit_type & XMIT_CSUM_V4) { 3499 3498 struct iphdr *iph = ip_hdr(skb); 3500 3499 pbd2->fw_ip_csum_wo_len_flags_frag = 3501 3500 bswab16(csum_fold((~iph->check) - ··· 3817 3818 bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, 3818 3819 xmit_type); 3819 3820 else 3820 - bnx2x_set_pbd_gso(skb, pbd_e1x, tx_start_bd, 3821 - xmit_type); 3821 + bnx2x_set_pbd_gso(skb, pbd_e1x, first_bd, xmit_type); 3822 3822 } 3823 3823 3824 3824 /* Set the PBD's parsing_data field if not zero
+15 -6
drivers/net/ethernet/broadcom/tg3.c
··· 9468 9468 } 9469 9469 } 9470 9470 9471 + static inline u32 tg3_lso_rd_dma_workaround_bit(struct tg3 *tp) 9472 + { 9473 + if (tg3_asic_rev(tp) == ASIC_REV_5719) 9474 + return TG3_LSO_RD_DMA_TX_LENGTH_WA_5719; 9475 + else 9476 + return TG3_LSO_RD_DMA_TX_LENGTH_WA_5720; 9477 + } 9478 + 9471 9479 /* tp->lock is held. */ 9472 9480 static int tg3_reset_hw(struct tg3 *tp, bool reset_phy) 9473 9481 { ··· 10161 10153 tw32_f(RDMAC_MODE, rdmac_mode); 10162 10154 udelay(40); 10163 10155 10164 - if (tg3_asic_rev(tp) == ASIC_REV_5719) { 10156 + if (tg3_asic_rev(tp) == ASIC_REV_5719 || 10157 + tg3_asic_rev(tp) == ASIC_REV_5720) { 10165 10158 for (i = 0; i < TG3_NUM_RDMA_CHANNELS; i++) { 10166 10159 if (tr32(TG3_RDMA_LENGTH + (i << 2)) > TG3_MAX_MTU(tp)) 10167 10160 break; 10168 10161 } 10169 10162 if (i < TG3_NUM_RDMA_CHANNELS) { 10170 10163 val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); 10171 - val |= TG3_LSO_RD_DMA_TX_LENGTH_WA; 10164 + val |= tg3_lso_rd_dma_workaround_bit(tp); 10172 10165 tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val); 10173 - tg3_flag_set(tp, 5719_RDMA_BUG); 10166 + tg3_flag_set(tp, 5719_5720_RDMA_BUG); 10174 10167 } 10175 10168 } 10176 10169 ··· 10535 10526 TG3_STAT_ADD32(&sp->tx_ucast_packets, MAC_TX_STATS_UCAST); 10536 10527 TG3_STAT_ADD32(&sp->tx_mcast_packets, MAC_TX_STATS_MCAST); 10537 10528 TG3_STAT_ADD32(&sp->tx_bcast_packets, MAC_TX_STATS_BCAST); 10538 - if (unlikely(tg3_flag(tp, 5719_RDMA_BUG) && 10529 + if (unlikely(tg3_flag(tp, 5719_5720_RDMA_BUG) && 10539 10530 (sp->tx_ucast_packets.low + sp->tx_mcast_packets.low + 10540 10531 sp->tx_bcast_packets.low) > TG3_NUM_RDMA_CHANNELS)) { 10541 10532 u32 val; 10542 10533 10543 10534 val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); 10544 - val &= ~TG3_LSO_RD_DMA_TX_LENGTH_WA; 10535 + val &= ~tg3_lso_rd_dma_workaround_bit(tp); 10545 10536 tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val); 10546 - tg3_flag_clear(tp, 5719_RDMA_BUG); 10537 + tg3_flag_clear(tp, 5719_5720_RDMA_BUG); 10547 10538 } 10548 10539 10549 10540 TG3_STAT_ADD32(&sp->rx_octets, MAC_RX_STATS_OCTETS);
+3 -2
drivers/net/ethernet/broadcom/tg3.h
··· 1422 1422 #define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910 1423 1423 #define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 1424 1424 #define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K 0x000c0000 1425 - #define TG3_LSO_RD_DMA_TX_LENGTH_WA 0x02000000 1425 + #define TG3_LSO_RD_DMA_TX_LENGTH_WA_5719 0x02000000 1426 + #define TG3_LSO_RD_DMA_TX_LENGTH_WA_5720 0x00200000 1426 1427 /* 0x4914 --> 0x4be0 unused */ 1427 1428 1428 1429 #define TG3_NUM_RDMA_CHANNELS 4 ··· 3060 3059 TG3_FLAG_APE_HAS_NCSI, 3061 3060 TG3_FLAG_TX_TSTAMP_EN, 3062 3061 TG3_FLAG_4K_FIFO_LIMIT, 3063 - TG3_FLAG_5719_RDMA_BUG, 3062 + TG3_FLAG_5719_5720_RDMA_BUG, 3064 3063 TG3_FLAG_RESET_TASK_PENDING, 3065 3064 TG3_FLAG_PTP_CAPABLE, 3066 3065 TG3_FLAG_5705_PLUS,
+1
drivers/net/ethernet/emulex/benet/be.h
··· 262 262 u8 ipv6; 263 263 u8 vtm; 264 264 u8 pkt_type; 265 + u8 ip_frag; 265 266 }; 266 267 267 268 struct be_rx_obj {
+3 -3
drivers/net/ethernet/emulex/benet/be_cmds.c
··· 562 562 563 563 resource_error = lancer_provisioning_error(adapter); 564 564 if (resource_error) 565 - return -1; 565 + return -EAGAIN; 566 566 567 567 status = lancer_wait_ready(adapter); 568 568 if (!status) { ··· 590 590 * when PF provisions resources. 591 591 */ 592 592 resource_error = lancer_provisioning_error(adapter); 593 - if (status == -1 && !resource_error) 594 - adapter->eeh_error = true; 593 + if (resource_error) 594 + status = -EAGAIN; 595 595 596 596 return status; 597 597 }
+1 -1
drivers/net/ethernet/emulex/benet/be_hw.h
··· 356 356 u8 ip_version; /* dword 1 */ 357 357 u8 macdst[6]; /* dword 1 */ 358 358 u8 vtp; /* dword 1 */ 359 - u8 rsvd0; /* dword 1 */ 359 + u8 ip_frag; /* dword 1 */ 360 360 u8 fragndx[10]; /* dword 1 */ 361 361 u8 ct[2]; /* dword 1 */ 362 362 u8 sw; /* dword 1 */
+29 -26
drivers/net/ethernet/emulex/benet/be_main.c
··· 1599 1599 compl); 1600 1600 } 1601 1601 rxcp->port = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, port, compl); 1602 + rxcp->ip_frag = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, 1603 + ip_frag, compl); 1602 1604 } 1603 1605 1604 1606 static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) ··· 1621 1619 be_parse_rx_compl_v1(compl, rxcp); 1622 1620 else 1623 1621 be_parse_rx_compl_v0(compl, rxcp); 1622 + 1623 + if (rxcp->ip_frag) 1624 + rxcp->l4_csum = 0; 1624 1625 1625 1626 if (rxcp->vlanf) { 1626 1627 /* vlanf could be wrongly set in some cards. ··· 2173 2168 2174 2169 static inline bool do_gro(struct be_rx_compl_info *rxcp) 2175 2170 { 2176 - return (rxcp->tcpf && !rxcp->err) ? true : false; 2171 + return (rxcp->tcpf && !rxcp->err && rxcp->l4_csum) ? true : false; 2177 2172 } 2178 2173 2179 2174 static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi, ··· 4098 4093 4099 4094 static int lancer_recover_func(struct be_adapter *adapter) 4100 4095 { 4096 + struct device *dev = &adapter->pdev->dev; 4101 4097 int status; 4102 4098 4103 4099 status = lancer_test_and_set_rdy_state(adapter); ··· 4110 4104 4111 4105 be_clear(adapter); 4112 4106 4113 - adapter->hw_error = false; 4114 - adapter->fw_timeout = false; 4107 + be_clear_all_error(adapter); 4115 4108 4116 4109 status = be_setup(adapter); 4117 4110 if (status) ··· 4122 4117 goto err; 4123 4118 } 4124 4119 4125 - dev_err(&adapter->pdev->dev, 4126 - "Adapter SLIPORT recovery succeeded\n"); 4120 + dev_err(dev, "Error recovery successful\n"); 4127 4121 return 0; 4128 4122 err: 4129 - if (adapter->eeh_error) 4130 - dev_err(&adapter->pdev->dev, 4131 - "Adapter SLIPORT recovery failed\n"); 4123 + if (status == -EAGAIN) 4124 + dev_err(dev, "Waiting for resource provisioning\n"); 4125 + else 4126 + dev_err(dev, "Error recovery failed\n"); 4132 4127 4133 4128 return status; 4134 4129 } ··· 4137 4132 { 4138 4133 struct be_adapter *adapter = 4139 4134 container_of(work, struct be_adapter, func_recovery_work.work); 4140 - int status; 4135 + int status = 0; 4141 4136 4142 4137 be_detect_error(adapter); 4143 4138 4144 4139 if (adapter->hw_error && lancer_chip(adapter)) { 4145 - 4146 - if (adapter->eeh_error) 4147 - goto out; 4148 4140 4149 4141 rtnl_lock(); 4150 4142 netif_device_detach(adapter->netdev); 4151 4143 rtnl_unlock(); 4152 4144 4153 4145 status = lancer_recover_func(adapter); 4154 - 4155 4146 if (!status) 4156 4147 netif_device_attach(adapter->netdev); 4157 4148 } 4158 4149 4159 - out: 4160 - schedule_delayed_work(&adapter->func_recovery_work, 4161 - msecs_to_jiffies(1000)); 4150 + /* In Lancer, for all errors other than provisioning error (-EAGAIN), 4151 + * no need to attempt further recovery. 4152 + */ 4153 + if (!status || status == -EAGAIN) 4154 + schedule_delayed_work(&adapter->func_recovery_work, 4155 + msecs_to_jiffies(1000)); 4162 4156 } 4163 4157 4164 4158 static void be_worker(struct work_struct *work) ··· 4440 4436 4441 4437 dev_err(&adapter->pdev->dev, "EEH error detected\n"); 4442 4438 4443 - adapter->eeh_error = true; 4439 + if (!adapter->eeh_error) { 4440 + adapter->eeh_error = true; 4444 4441 4445 - cancel_delayed_work_sync(&adapter->func_recovery_work); 4442 + cancel_delayed_work_sync(&adapter->func_recovery_work); 4446 4443 4447 - rtnl_lock(); 4448 - netif_device_detach(netdev); 4449 - rtnl_unlock(); 4450 - 4451 - if (netif_running(netdev)) { 4452 4444 rtnl_lock(); 4453 - be_close(netdev); 4445 + netif_device_detach(netdev); 4446 + if (netif_running(netdev)) 4447 + be_close(netdev); 4454 4448 rtnl_unlock(); 4449 + 4450 + be_clear(adapter); 4455 4451 } 4456 - be_clear(adapter); 4457 4452 4458 4453 if (state == pci_channel_io_perm_failure) 4459 4454 return PCI_ERS_RESULT_DISCONNECT; ··· 4477 4474 int status; 4478 4475 4479 4476 dev_info(&adapter->pdev->dev, "EEH reset\n"); 4480 - be_clear_all_error(adapter); 4481 4477 4482 4478 status = pci_enable_device(pdev); 4483 4479 if (status) ··· 4494 4492 return PCI_ERS_RESULT_DISCONNECT; 4495 4493 4496 4494 pci_cleanup_aer_uncorrect_error_status(pdev); 4495 + be_clear_all_error(adapter); 4497 4496 return PCI_ERS_RESULT_RECOVERED; 4498 4497 } 4499 4498
+12
drivers/net/ethernet/freescale/fec_main.c
··· 1038 1038 iap = &tmpaddr[0]; 1039 1039 } 1040 1040 1041 + /* 1042 + * 5) random mac address 1043 + */ 1044 + if (!is_valid_ether_addr(iap)) { 1045 + /* Report it and use a random ethernet address instead */ 1046 + netdev_err(ndev, "Invalid MAC address: %pM\n", iap); 1047 + eth_hw_addr_random(ndev); 1048 + netdev_info(ndev, "Using random MAC address: %pM\n", 1049 + ndev->dev_addr); 1050 + return; 1051 + } 1052 + 1041 1053 memcpy(ndev->dev_addr, iap, ETH_ALEN); 1042 1054 1043 1055 /* Adjust MAC if using macaddr */
-2
drivers/net/ethernet/mellanox/mlx4/cmd.c
··· 222 222 * FLR process. The only non-zero result in the RESET command 223 223 * is MLX4_DELAY_RESET_SLAVE*/ 224 224 if ((MLX4_COMM_CMD_RESET == cmd)) { 225 - mlx4_warn(dev, "Got slave FLRed from Communication" 226 - " channel (ret:0x%x)\n", ret_from_pending); 227 225 err = MLX4_DELAY_RESET_SLAVE; 228 226 } else { 229 227 mlx4_warn(dev, "Communication channel timed out\n");
+13 -4
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 1323 1323 priv->last_moder_time[ring] = moder_time; 1324 1324 cq = &priv->rx_cq[ring]; 1325 1325 cq->moder_time = moder_time; 1326 + cq->moder_cnt = priv->rx_frames; 1326 1327 err = mlx4_en_set_cq_moder(priv, cq); 1327 1328 if (err) 1328 1329 en_err(priv, "Failed modifying moderation for cq:%d\n", ··· 2119 2118 struct mlx4_en_priv *priv; 2120 2119 int i; 2121 2120 int err; 2121 + u64 mac_u64; 2122 2122 2123 2123 dev = alloc_etherdev_mqs(sizeof(struct mlx4_en_priv), 2124 2124 MAX_TX_RINGS, MAX_RX_RINGS); ··· 2193 2191 dev->addr_len = ETH_ALEN; 2194 2192 mlx4_en_u64_to_mac(dev->dev_addr, mdev->dev->caps.def_mac[priv->port]); 2195 2193 if (!is_valid_ether_addr(dev->dev_addr)) { 2196 - en_err(priv, "Port: %d, invalid mac burned: %pM, quiting\n", 2197 - priv->port, dev->dev_addr); 2198 - err = -EINVAL; 2199 - goto out; 2194 + if (mlx4_is_slave(priv->mdev->dev)) { 2195 + eth_hw_addr_random(dev); 2196 + en_warn(priv, "Assigned random MAC address %pM\n", dev->dev_addr); 2197 + mac_u64 = mlx4_en_mac_to_u64(dev->dev_addr); 2198 + mdev->dev->caps.def_mac[priv->port] = mac_u64; 2199 + } else { 2200 + en_err(priv, "Port: %d, invalid mac burned: %pM, quiting\n", 2201 + priv->port, dev->dev_addr); 2202 + err = -EINVAL; 2203 + goto out; 2204 + } 2200 2205 } 2201 2206 2202 2207 memcpy(priv->prev_mac, dev->dev_addr, sizeof(priv->prev_mac));
+7 -3
drivers/net/ethernet/mellanox/mlx4/fw.c
··· 840 840 MLX4_CMD_NATIVE); 841 841 842 842 if (!err && dev->caps.function != slave) { 843 - /* set slave default_mac address */ 844 - MLX4_GET(def_mac, outbox->buf, QUERY_PORT_MAC_OFFSET); 845 - def_mac += slave << 8; 846 843 /* if config MAC in DB use it */ 847 844 if (priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac) 848 845 def_mac = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac; 846 + else { 847 + /* set slave default_mac address */ 848 + MLX4_GET(def_mac, outbox->buf, QUERY_PORT_MAC_OFFSET); 849 + def_mac += slave << 8; 850 + priv->mfunc.master.vf_admin[slave].vport[vhcr->in_modifier].mac = def_mac; 851 + } 852 + 849 853 MLX4_PUT(outbox->buf, def_mac, QUERY_PORT_MAC_OFFSET); 850 854 851 855 /* get port type - currently only eth is enabled */
+6 -14
drivers/net/ethernet/mellanox/mlx4/main.c
··· 1290 1290 { 1291 1291 struct mlx4_priv *priv = mlx4_priv(dev); 1292 1292 u64 dma = (u64) priv->mfunc.vhcr_dma; 1293 - int num_of_reset_retries = NUM_OF_RESET_RETRIES; 1294 1293 int ret_from_reset = 0; 1295 1294 u32 slave_read; 1296 1295 u32 cmd_channel_ver; ··· 1303 1304 * NUM_OF_RESET_RETRIES times before leaving.*/ 1304 1305 if (ret_from_reset) { 1305 1306 if (MLX4_DELAY_RESET_SLAVE == ret_from_reset) { 1306 - msleep(SLEEP_TIME_IN_RESET); 1307 - while (ret_from_reset && num_of_reset_retries) { 1308 - mlx4_warn(dev, "slave is currently in the" 1309 - "middle of FLR. retrying..." 1310 - "(try num:%d)\n", 1311 - (NUM_OF_RESET_RETRIES - 1312 - num_of_reset_retries + 1)); 1313 - ret_from_reset = 1314 - mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, 1315 - 0, MLX4_COMM_TIME); 1316 - num_of_reset_retries = num_of_reset_retries - 1; 1317 - } 1307 + mlx4_warn(dev, "slave is currently in the " 1308 + "middle of FLR. Deferring probe.\n"); 1309 + mutex_unlock(&priv->cmd.slave_cmd_mutex); 1310 + return -EPROBE_DEFER; 1318 1311 } else 1319 1312 goto err; 1320 1313 } ··· 1517 1526 } else { 1518 1527 err = mlx4_init_slave(dev); 1519 1528 if (err) { 1520 - mlx4_err(dev, "Failed to initialize slave\n"); 1529 + if (err != -EPROBE_DEFER) 1530 + mlx4_err(dev, "Failed to initialize slave\n"); 1521 1531 return err; 1522 1532 } 1523 1533
+1
drivers/net/ethernet/qlogic/qlge/qlge_main.c
··· 4717 4717 dev_err(&pdev->dev, "net device registration failed.\n"); 4718 4718 ql_release_all(pdev); 4719 4719 pci_disable_device(pdev); 4720 + free_netdev(ndev); 4720 4721 return err; 4721 4722 } 4722 4723 /* Start up the timer to trigger EEH if
+2 -1
drivers/net/ethernet/xilinx/xilinx_emaclite.c
··· 946 946 phy_write(lp->phy_dev, MII_CTRL1000, 0); 947 947 948 948 /* Advertise only 10 and 100mbps full/half duplex speeds */ 949 - phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL); 949 + phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL | 950 + ADVERTISE_CSMA); 950 951 951 952 /* Restart auto negotiation */ 952 953 bmcr = phy_read(lp->phy_dev, MII_BMCR);
+2 -1
drivers/net/hyperv/netvsc_drv.c
··· 31 31 #include <linux/inetdevice.h> 32 32 #include <linux/etherdevice.h> 33 33 #include <linux/skbuff.h> 34 + #include <linux/if_vlan.h> 34 35 #include <linux/in.h> 35 36 #include <linux/slab.h> 36 37 #include <net/arp.h> ··· 285 284 286 285 skb->protocol = eth_type_trans(skb, net); 287 286 skb->ip_summed = CHECKSUM_NONE; 288 - skb->vlan_tci = packet->vlan_tci; 287 + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet->vlan_tci); 289 288 290 289 net->stats.rx_packets++; 291 290 net->stats.rx_bytes += packet->total_data_buflen;
+1 -1
drivers/net/phy/phy.c
··· 1044 1044 adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv); 1045 1045 lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp); 1046 1046 idx = phy_find_setting(phydev->speed, phydev->duplex); 1047 - if ((lp & adv & settings[idx].setting)) 1047 + if (!(lp & adv & settings[idx].setting)) 1048 1048 goto eee_exit; 1049 1049 1050 1050 if (clk_stop_enable) {
+4 -3
drivers/net/team/team.c
··· 2374 2374 bool incomplete; 2375 2375 int i; 2376 2376 2377 - port = list_first_entry(&team->port_list, struct team_port, list); 2377 + port = list_first_entry_or_null(&team->port_list, 2378 + struct team_port, list); 2378 2379 2379 2380 start_again: 2380 2381 err = __send_and_alloc_skb(&skb, team, portid, send_func); ··· 2403 2402 err = team_nl_fill_one_port_get(skb, one_port); 2404 2403 if (err) 2405 2404 goto errout; 2406 - } else { 2407 - list_for_each_entry(port, &team->port_list, list) { 2405 + } else if (port) { 2406 + list_for_each_entry_from(port, &team->port_list, list) { 2408 2407 err = team_nl_fill_one_port_get(skb, port); 2409 2408 if (err) { 2410 2409 if (err == -EMSGSIZE) {
+4
drivers/net/tun.c
··· 1585 1585 else 1586 1586 return -EINVAL; 1587 1587 1588 + if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) != 1589 + !!(tun->flags & TUN_TAP_MQ)) 1590 + return -EINVAL; 1591 + 1588 1592 if (tun_not_capable(tun)) 1589 1593 return -EPERM; 1590 1594 err = security_tun_dev_open(tun->security);
+6 -3
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
··· 68 68 #define AR9300_BASE_ADDR 0x3ff 69 69 #define AR9300_BASE_ADDR_512 0x1ff 70 70 71 - #define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000) 72 - #define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18) 71 + #define AR9300_OTP_BASE \ 72 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) 73 + #define AR9300_OTP_STATUS \ 74 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18) 73 75 #define AR9300_OTP_STATUS_TYPE 0x7 74 76 #define AR9300_OTP_STATUS_VALID 0x4 75 77 #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 76 78 #define AR9300_OTP_STATUS_SM_BUSY 0x1 77 - #define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c) 79 + #define AR9300_OTP_READ_DATA \ 80 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c) 78 81 79 82 enum targetPowerHTRates { 80 83 HT_TARGET_RATE_0_8_16,
+2 -1
drivers/net/wireless/ath/ath9k/ar9003_phy.c
··· 334 334 REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, 335 335 AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 1); 336 336 337 - if (REG_READ_FIELD(ah, AR_PHY_MODE, 337 + if (!AR_SREV_9340(ah) && 338 + REG_READ_FIELD(ah, AR_PHY_MODE, 338 339 AR_PHY_MODE_DYNAMIC) == 0x1) 339 340 REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, 340 341 AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 1);
+4 -10
drivers/net/wireless/ath/ath9k/ath9k.h
··· 251 251 int tidno; 252 252 int baw_head; /* first un-acked tx buffer */ 253 253 int baw_tail; /* next unused tx buffer slot */ 254 - int sched; 255 - int paused; 256 - u8 state; 257 - bool stop_cb; 254 + bool sched; 255 + bool paused; 256 + bool active; 258 257 }; 259 258 260 259 struct ath_node { ··· 273 274 struct dentry *node_stat; 274 275 #endif 275 276 }; 276 - 277 - #define AGGR_CLEANUP BIT(1) 278 - #define AGGR_ADDBA_COMPLETE BIT(2) 279 - #define AGGR_ADDBA_PROGRESS BIT(3) 280 277 281 278 struct ath_tx_control { 282 279 struct ath_txq *txq; ··· 347 352 void ath_tx_edma_tasklet(struct ath_softc *sc); 348 353 int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, 349 354 u16 tid, u16 *ssn); 350 - bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid, 351 - bool flush); 355 + void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 352 356 void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 353 357 354 358 void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
+17 -8
drivers/net/wireless/ath/ath9k/hw.c
··· 1172 1172 static inline void ath9k_hw_set_dma(struct ath_hw *ah) 1173 1173 { 1174 1174 struct ath_common *common = ath9k_hw_common(ah); 1175 + int txbuf_size; 1175 1176 1176 1177 ENABLE_REGWRITE_BUFFER(ah); 1177 1178 ··· 1226 1225 * So set the usable tx buf size also to half to 1227 1226 * avoid data/delimiter underruns 1228 1227 */ 1229 - REG_WRITE(ah, AR_PCU_TXBUF_CTRL, 1230 - AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE); 1231 - } else if (!AR_SREV_9271(ah)) { 1232 - REG_WRITE(ah, AR_PCU_TXBUF_CTRL, 1233 - AR_PCU_TXBUF_CTRL_USABLE_SIZE); 1228 + txbuf_size = AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE; 1229 + } else if (AR_SREV_9340_13_OR_LATER(ah)) { 1230 + /* Uses fewer entries for AR934x v1.3+ to prevent rx overruns */ 1231 + txbuf_size = AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE; 1232 + } else { 1233 + txbuf_size = AR_PCU_TXBUF_CTRL_USABLE_SIZE; 1234 1234 } 1235 + 1236 + if (!AR_SREV_9271(ah)) 1237 + REG_WRITE(ah, AR_PCU_TXBUF_CTRL, txbuf_size); 1235 1238 1236 1239 REGWRITE_BUFFER_FLUSH(ah); 1237 1240 ··· 1311 1306 AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET; 1312 1307 } else { 1313 1308 tmpReg = REG_READ(ah, AR_INTR_SYNC_CAUSE); 1314 - if (tmpReg & 1315 - (AR_INTR_SYNC_LOCAL_TIMEOUT | 1316 - AR_INTR_SYNC_RADM_CPL_TIMEOUT)) { 1309 + if (AR_SREV_9340(ah)) 1310 + tmpReg &= AR9340_INTR_SYNC_LOCAL_TIMEOUT; 1311 + else 1312 + tmpReg &= AR_INTR_SYNC_LOCAL_TIMEOUT | 1313 + AR_INTR_SYNC_RADM_CPL_TIMEOUT; 1314 + 1315 + if (tmpReg) { 1317 1316 u32 val; 1318 1317 REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0); 1319 1318
+1 -1
drivers/net/wireless/ath/ath9k/mac.c
··· 410 410 411 411 REG_WRITE(ah, AR_QMISC(q), AR_Q_MISC_DCU_EARLY_TERM_REQ); 412 412 413 - if (AR_SREV_9340(ah)) 413 + if (AR_SREV_9340(ah) && !AR_SREV_9340_13_OR_LATER(ah)) 414 414 REG_WRITE(ah, AR_DMISC(q), 415 415 AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1); 416 416 else
+2 -1
drivers/net/wireless/ath/ath9k/main.c
··· 1709 1709 flush = true; 1710 1710 case IEEE80211_AMPDU_TX_STOP_CONT: 1711 1711 ath9k_ps_wakeup(sc); 1712 - if (ath_tx_aggr_stop(sc, sta, tid, flush)) 1712 + ath_tx_aggr_stop(sc, sta, tid); 1713 + if (!flush) 1713 1714 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1714 1715 ath9k_ps_restore(sc); 1715 1716 break;
+1 -4
drivers/net/wireless/ath/ath9k/rc.c
··· 1227 1227 return false; 1228 1228 1229 1229 txtid = ATH_AN_2_TID(an, tidno); 1230 - 1231 - if (!(txtid->state & (AGGR_ADDBA_COMPLETE | AGGR_ADDBA_PROGRESS))) 1232 - return true; 1233 - return false; 1230 + return !txtid->active; 1234 1231 } 1235 1232 1236 1233
+11
drivers/net/wireless/ath/ath9k/reg.h
··· 798 798 #define AR_SREV_REVISION_9485_10 0 799 799 #define AR_SREV_REVISION_9485_11 1 800 800 #define AR_SREV_VERSION_9340 0x300 801 + #define AR_SREV_REVISION_9340_10 0 802 + #define AR_SREV_REVISION_9340_11 1 803 + #define AR_SREV_REVISION_9340_12 2 804 + #define AR_SREV_REVISION_9340_13 3 801 805 #define AR_SREV_VERSION_9580 0x1C0 802 806 #define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ 803 807 #define AR_SREV_VERSION_9462 0x280 ··· 900 896 901 897 #define AR_SREV_9340(_ah) \ 902 898 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340)) 899 + 900 + #define AR_SREV_9340_13_OR_LATER(_ah) \ 901 + (AR_SREV_9340((_ah)) && \ 902 + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13)) 903 903 904 904 #define AR_SREV_9285E_20(_ah) \ 905 905 (AR_SREV_9285_12_OR_LATER(_ah) && \ ··· 1014 1006 AR_INTR_SYNC_RADM_CPL_TIMEOUT | 1015 1007 AR_INTR_SYNC_LOCAL_TIMEOUT | 1016 1008 AR_INTR_SYNC_MAC_SLEEP_ACCESS), 1009 + 1010 + AR9340_INTR_SYNC_LOCAL_TIMEOUT = 0x00000010, 1017 1011 1018 1012 AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF, 1019 1013 ··· 1891 1881 #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF 1892 1882 #define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 1893 1883 #define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 1884 + #define AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE 0x500 1894 1885 1895 1886 #define AR_PCU_MISC_MODE2 0x8344 1896 1887 #define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002
+39 -99
drivers/net/wireless/ath/ath9k/xmit.c
··· 125 125 list_add_tail(&ac->list, &txq->axq_acq); 126 126 } 127 127 128 - static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 129 - { 130 - struct ath_txq *txq = tid->ac->txq; 131 - 132 - WARN_ON(!tid->paused); 133 - 134 - ath_txq_lock(sc, txq); 135 - tid->paused = false; 136 - 137 - if (skb_queue_empty(&tid->buf_q)) 138 - goto unlock; 139 - 140 - ath_tx_queue_tid(txq, tid); 141 - ath_txq_schedule(sc, txq); 142 - unlock: 143 - ath_txq_unlock_complete(sc, txq); 144 - } 145 - 146 128 static struct ath_frame_info *get_frame_info(struct sk_buff *skb) 147 129 { 148 130 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); ··· 146 164 ARRAY_SIZE(bf->rates)); 147 165 } 148 166 149 - static void ath_tx_clear_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 150 - { 151 - tid->state &= ~AGGR_ADDBA_COMPLETE; 152 - tid->state &= ~AGGR_CLEANUP; 153 - if (!tid->stop_cb) 154 - return; 155 - 156 - ieee80211_start_tx_ba_cb_irqsafe(tid->an->vif, tid->an->sta->addr, 157 - tid->tidno); 158 - tid->stop_cb = false; 159 - } 160 - 161 - static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid, 162 - bool flush_packets) 167 + static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 163 168 { 164 169 struct ath_txq *txq = tid->ac->txq; 165 170 struct sk_buff *skb; ··· 163 194 while ((skb = __skb_dequeue(&tid->buf_q))) { 164 195 fi = get_frame_info(skb); 165 196 bf = fi->bf; 166 - if (!bf && !flush_packets) 167 - bf = ath_tx_setup_buffer(sc, txq, tid, skb); 168 197 169 198 if (!bf) { 170 - ieee80211_free_txskb(sc->hw, skb); 171 - continue; 199 + bf = ath_tx_setup_buffer(sc, txq, tid, skb); 200 + if (!bf) { 201 + ieee80211_free_txskb(sc->hw, skb); 202 + continue; 203 + } 172 204 } 173 205 174 - if (fi->retries || flush_packets) { 206 + if (fi->retries) { 175 207 list_add_tail(&bf->list, &bf_head); 176 208 ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 177 209 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); ··· 183 213 } 184 214 } 185 215 186 - if (tid->baw_head == tid->baw_tail) 187 - ath_tx_clear_tid(sc, tid); 188 - 189 - if (sendbar && !flush_packets) { 216 + if (sendbar) { 190 217 ath_txq_unlock(sc, txq); 191 218 ath_send_bar(tid, tid->seq_start); 192 219 ath_txq_lock(sc, txq); ··· 466 499 tx_info = IEEE80211_SKB_CB(skb); 467 500 fi = get_frame_info(skb); 468 501 469 - if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) { 502 + if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) { 503 + /* 504 + * Outside of the current BlockAck window, 505 + * maybe part of a previous session 506 + */ 507 + txfail = 1; 508 + } else if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) { 470 509 /* transmit completion, subframe is 471 510 * acked by block ack */ 472 511 acked_cnt++; 473 512 } else if (!isaggr && txok) { 474 513 /* transmit completion */ 475 514 acked_cnt++; 476 - } else if (tid->state & AGGR_CLEANUP) { 477 - /* 478 - * cleanup in progress, just fail 479 - * the un-acked sub-frames 480 - */ 481 - txfail = 1; 482 515 } else if (flush) { 483 516 txpending = 1; 484 517 } else if (fi->retries < ATH_MAX_SW_RETRIES) { ··· 502 535 if (bf_next != NULL || !bf_last->bf_stale) 503 536 list_move_tail(&bf->list, &bf_head); 504 537 505 - if (!txpending || (tid->state & AGGR_CLEANUP)) { 538 + if (!txpending) { 506 539 /* 507 540 * complete the acked-ones/xretried ones; update 508 541 * block-ack window ··· 575 608 ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1)); 576 609 ath_txq_lock(sc, txq); 577 610 } 578 - 579 - if (tid->state & AGGR_CLEANUP) 580 - ath_tx_flush_tid(sc, tid, false); 581 611 582 612 rcu_read_unlock(); 583 613 ··· 1208 1244 an = (struct ath_node *)sta->drv_priv; 1209 1245 txtid = ATH_AN_2_TID(an, tid); 1210 1246 1211 - if (txtid->state & (AGGR_CLEANUP | AGGR_ADDBA_COMPLETE)) 1212 - return -EAGAIN; 1213 - 1214 1247 /* update ampdu factor/density, they may have changed. This may happen 1215 1248 * in HT IBSS when a beacon with HT-info is received after the station 1216 1249 * has already been added. ··· 1219 1258 an->mpdudensity = density; 1220 1259 } 1221 1260 1222 - txtid->state |= AGGR_ADDBA_PROGRESS; 1261 + txtid->active = true; 1223 1262 txtid->paused = true; 1224 1263 *ssn = txtid->seq_start = txtid->seq_next; 1225 1264 txtid->bar_index = -1; ··· 1230 1269 return 0; 1231 1270 } 1232 1271 1233 - bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid, 1234 - bool flush) 1272 + void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) 1235 1273 { 1236 1274 struct ath_node *an = (struct ath_node *)sta->drv_priv; 1237 1275 struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); 1238 1276 struct ath_txq *txq = txtid->ac->txq; 1239 - bool ret = !flush; 1240 - 1241 - if (flush) 1242 - txtid->stop_cb = false; 1243 - 1244 - if (txtid->state & AGGR_CLEANUP) 1245 - return false; 1246 - 1247 - if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { 1248 - txtid->state &= ~AGGR_ADDBA_PROGRESS; 1249 - return ret; 1250 - } 1251 1277 1252 1278 ath_txq_lock(sc, txq); 1279 + txtid->active = false; 1253 1280 txtid->paused = true; 1254 - 1255 - /* 1256 - * If frames are still being transmitted for this TID, they will be 1257 - * cleaned up during tx completion. To prevent race conditions, this 1258 - * TID can only be reused after all in-progress subframes have been 1259 - * completed. 1260 - */ 1261 - if (txtid->baw_head != txtid->baw_tail) { 1262 - txtid->state |= AGGR_CLEANUP; 1263 - ret = false; 1264 - txtid->stop_cb = !flush; 1265 - } else { 1266 - txtid->state &= ~AGGR_ADDBA_COMPLETE; 1267 - } 1268 - 1269 - ath_tx_flush_tid(sc, txtid, flush); 1281 + ath_tx_flush_tid(sc, txtid); 1270 1282 ath_txq_unlock_complete(sc, txq); 1271 - return ret; 1272 1283 } 1273 1284 1274 1285 void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, ··· 1304 1371 } 1305 1372 } 1306 1373 1307 - void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) 1374 + void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, 1375 + u16 tidno) 1308 1376 { 1309 - struct ath_atx_tid *txtid; 1377 + struct ath_atx_tid *tid; 1310 1378 struct ath_node *an; 1379 + struct ath_txq *txq; 1311 1380 1312 1381 an = (struct ath_node *)sta->drv_priv; 1382 + tid = ATH_AN_2_TID(an, tidno); 1383 + txq = tid->ac->txq; 1313 1384 1314 - txtid = ATH_AN_2_TID(an, tid); 1315 - txtid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; 1316 - txtid->state |= AGGR_ADDBA_COMPLETE; 1317 - txtid->state &= ~AGGR_ADDBA_PROGRESS; 1318 - ath_tx_resume_tid(sc, txtid); 1385 + ath_txq_lock(sc, txq); 1386 + 1387 + tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; 1388 + tid->paused = false; 1389 + 1390 + if (!skb_queue_empty(&tid->buf_q)) { 1391 + ath_tx_queue_tid(txq, tid); 1392 + ath_txq_schedule(sc, txq); 1393 + } 1394 + 1395 + ath_txq_unlock_complete(sc, txq); 1319 1396 } 1320 1397 1321 1398 /********************/ ··· 2374 2431 tid->baw_head = tid->baw_tail = 0; 2375 2432 tid->sched = false; 2376 2433 tid->paused = false; 2377 - tid->state &= ~AGGR_CLEANUP; 2434 + tid->active = false; 2378 2435 __skb_queue_head_init(&tid->buf_q); 2379 2436 acno = TID_TO_WME_AC(tidno); 2380 2437 tid->ac = &an->ac[acno]; 2381 - tid->state &= ~AGGR_ADDBA_COMPLETE; 2382 - tid->state &= ~AGGR_ADDBA_PROGRESS; 2383 - tid->stop_cb = false; 2384 2438 } 2385 2439 2386 2440 for (acno = 0, ac = &an->ac[acno]; ··· 2414 2474 } 2415 2475 2416 2476 ath_tid_drain(sc, txq, tid); 2417 - ath_tx_clear_tid(sc, tid); 2477 + tid->active = false; 2418 2478 2419 2479 ath_txq_unlock(sc, txq); 2420 2480 }
+1 -1
drivers/net/wireless/atmel.c
··· 1624 1624 1625 1625 netif_carrier_off(dev); 1626 1626 1627 - if (!proc_create_data("driver/atmel", 0, NULL, &atmel_proc_fops, priv)); 1627 + if (!proc_create_data("driver/atmel", 0, NULL, &atmel_proc_fops, priv)) 1628 1628 printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); 1629 1629 1630 1630 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %pM\n",
-18
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
··· 27 27 #include "tracepoint.h" 28 28 29 29 #define PKTFILTER_BUF_SIZE 128 30 - #define BRCMF_ARPOL_MODE 0xb /* agent|snoop|peer_autoreply */ 31 30 #define BRCMF_DEFAULT_BCN_TIMEOUT 3 32 31 #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 33 32 #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40 ··· 335 336 brcmf_err("BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n", 336 337 err); 337 338 goto done; 338 - } 339 - 340 - /* Try to set and enable ARP offload feature, this may fail */ 341 - err = brcmf_fil_iovar_int_set(ifp, "arp_ol", BRCMF_ARPOL_MODE); 342 - if (err) { 343 - brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", 344 - BRCMF_ARPOL_MODE, err); 345 - err = 0; 346 - } else { 347 - err = brcmf_fil_iovar_int_set(ifp, "arpoe", 1); 348 - if (err) { 349 - brcmf_dbg(TRACE, "failed to enable ARP offload err = %d\n", 350 - err); 351 - err = 0; 352 - } else 353 - brcmf_dbg(TRACE, "successfully enabled ARP offload to 0x%x\n", 354 - BRCMF_ARPOL_MODE); 355 339 } 356 340 357 341 /* Setup packet filter */
+10 -6
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
··· 653 653 654 654 brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name); 655 655 656 + ndev->destructor = free_netdev; 656 657 return 0; 657 658 658 659 fail: 660 + drvr->iflist[ifp->bssidx] = NULL; 659 661 ndev->netdev_ops = NULL; 662 + free_netdev(ndev); 660 663 return -EBADE; 661 664 } 662 665 ··· 723 720 return 0; 724 721 725 722 fail: 723 + ifp->drvr->iflist[ifp->bssidx] = NULL; 724 + ndev->netdev_ops = NULL; 725 + free_netdev(ndev); 726 726 return -EBADE; 727 727 } 728 728 ··· 794 788 struct brcmf_if *ifp; 795 789 796 790 ifp = drvr->iflist[bssidx]; 791 + drvr->iflist[bssidx] = NULL; 797 792 if (!ifp) { 798 793 brcmf_err("Null interface, idx=%d\n", bssidx); 799 794 return; ··· 815 808 cancel_work_sync(&ifp->setmacaddr_work); 816 809 cancel_work_sync(&ifp->multicast_work); 817 810 } 818 - 811 + /* unregister will take care of freeing it */ 819 812 unregister_netdev(ifp->ndev); 820 813 if (bssidx == 0) 821 814 brcmf_cfg80211_detach(drvr->config); 822 - free_netdev(ifp->ndev); 823 815 } else { 824 816 kfree(ifp); 825 817 } 826 - drvr->iflist[bssidx] = NULL; 827 818 } 828 819 829 820 int brcmf_attach(uint bus_hdrlen, struct device *dev) ··· 930 925 brcmf_fws_del_interface(ifp); 931 926 brcmf_fws_deinit(drvr); 932 927 } 933 - free_netdev(ifp->ndev); 934 - drvr->iflist[0] = NULL; 935 928 if (p2p_ifp) { 936 929 free_netdev(p2p_ifp->ndev); 937 930 drvr->iflist[1] = NULL; ··· 937 934 return ret; 938 935 } 939 936 if ((brcmf_p2p_enable) && (p2p_ifp)) 940 - brcmf_net_p2p_attach(p2p_ifp); 937 + if (brcmf_net_p2p_attach(p2p_ifp) < 0) 938 + brcmf_p2p_enable = 0; 941 939 942 940 return 0; 943 941 }
+2 -1
drivers/net/wireless/brcm80211/brcmfmac/fweh.c
··· 202 202 return; 203 203 brcmf_fws_add_interface(ifp); 204 204 if (!drvr->fweh.evt_handler[BRCMF_E_IF]) 205 - err = brcmf_net_attach(ifp, false); 205 + if (brcmf_net_attach(ifp, false) < 0) 206 + return; 206 207 } 207 208 208 209 if (ifevent->action == BRCMF_E_IF_CHANGE)
+6
drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
··· 23 23 24 24 #define BRCMF_FIL_ACTION_FRAME_SIZE 1800 25 25 26 + /* ARP Offload feature flags for arp_ol iovar */ 27 + #define BRCMF_ARP_OL_AGENT 0x00000001 28 + #define BRCMF_ARP_OL_SNOOP 0x00000002 29 + #define BRCMF_ARP_OL_HOST_AUTO_REPLY 0x00000004 30 + #define BRCMF_ARP_OL_PEER_AUTO_REPLY 0x00000008 31 + 26 32 27 33 enum brcmf_fil_p2p_if_types { 28 34 BRCMF_FIL_P2P_IF_CLIENT,
+54 -20
drivers/net/wireless/brcm80211/brcmfmac/p2p.c
··· 47 47 #define IS_P2P_SOCIAL_CHANNEL(channel) ((channel == SOCIAL_CHAN_1) || \ 48 48 (channel == SOCIAL_CHAN_2) || \ 49 49 (channel == SOCIAL_CHAN_3)) 50 + #define BRCMF_P2P_TEMP_CHAN SOCIAL_CHAN_3 50 51 #define SOCIAL_CHAN_CNT 3 51 52 #define AF_PEER_SEARCH_CNT 2 52 53 ··· 1955 1954 err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); 1956 1955 if (err < 0) { 1957 1956 brcmf_err("set p2p_disc error\n"); 1958 - brcmf_free_vif(p2p_vif); 1957 + brcmf_free_vif(cfg, p2p_vif); 1959 1958 goto exit; 1960 1959 } 1961 1960 /* obtain bsscfg index for P2P discovery */ 1962 1961 err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); 1963 1962 if (err < 0) { 1964 1963 brcmf_err("retrieving discover bsscfg index failed\n"); 1965 - brcmf_free_vif(p2p_vif); 1964 + brcmf_free_vif(cfg, p2p_vif); 1966 1965 goto exit; 1967 1966 } 1968 1967 /* Verify that firmware uses same bssidx as driver !! */ 1969 1968 if (p2p_ifp->bssidx != bssidx) { 1970 1969 brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n", 1971 1970 bssidx, p2p_ifp->bssidx); 1972 - brcmf_free_vif(p2p_vif); 1971 + brcmf_free_vif(cfg, p2p_vif); 1973 1972 goto exit; 1974 1973 } 1975 1974 ··· 1997 1996 brcmf_p2p_cancel_remain_on_channel(vif->ifp); 1998 1997 brcmf_p2p_deinit_discovery(p2p); 1999 1998 /* remove discovery interface */ 2000 - brcmf_free_vif(vif); 1999 + brcmf_free_vif(p2p->cfg, vif); 2001 2000 p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2002 2001 } 2003 2002 /* just set it all to zero */ ··· 2014 2013 u16 *chanspec) 2015 2014 { 2016 2015 struct brcmf_if *ifp; 2017 - struct brcmf_fil_chan_info_le ci; 2016 + u8 mac_addr[ETH_ALEN]; 2018 2017 struct brcmu_chan ch; 2019 - s32 err; 2018 + struct brcmf_bss_info_le *bi; 2019 + u8 *buf; 2020 2020 2021 2021 ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; 2022 2022 2023 - ch.chnum = 11; 2024 - 2025 - err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_CHANNEL, &ci, sizeof(ci)); 2026 - if (!err) 2027 - ch.chnum = le32_to_cpu(ci.hw_channel); 2023 + if (brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSSID, mac_addr, 2024 + ETH_ALEN) == 0) { 2025 + buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); 2026 + if (buf != NULL) { 2027 + *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); 2028 + if (brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, 2029 + buf, WL_BSS_INFO_MAX) == 0) { 2030 + bi = (struct brcmf_bss_info_le *)(buf + 4); 2031 + *chanspec = le16_to_cpu(bi->chanspec); 2032 + kfree(buf); 2033 + return; 2034 + } 2035 + kfree(buf); 2036 + } 2037 + } 2038 + /* Use default channel for P2P */ 2039 + ch.chnum = BRCMF_P2P_TEMP_CHAN; 2028 2040 ch.bw = BRCMU_CHAN_BW_20; 2029 2041 p2p->cfg->d11inf.encchspec(&ch); 2030 2042 *chanspec = ch.chspec; ··· 2222 2208 return &p2p_vif->wdev; 2223 2209 2224 2210 fail: 2225 - brcmf_free_vif(p2p_vif); 2211 + brcmf_free_vif(p2p->cfg, p2p_vif); 2226 2212 return ERR_PTR(err); 2227 2213 } 2228 2214 ··· 2231 2217 * 2232 2218 * @vif: virtual interface object to delete. 2233 2219 */ 2234 - static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_vif *vif) 2220 + static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_info *cfg, 2221 + struct brcmf_cfg80211_vif *vif) 2235 2222 { 2236 - struct brcmf_p2p_info *p2p = &vif->ifp->drvr->config->p2p; 2237 - 2238 2223 cfg80211_unregister_wdev(&vif->wdev); 2239 - p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2240 - brcmf_free_vif(vif); 2224 + cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2225 + brcmf_free_vif(cfg, vif); 2226 + } 2227 + 2228 + /** 2229 + * brcmf_p2p_free_p2p_if() - free up net device related data. 2230 + * 2231 + * @ndev: net device that needs to be freed. 2232 + */ 2233 + static void brcmf_p2p_free_p2p_if(struct net_device *ndev) 2234 + { 2235 + struct brcmf_cfg80211_info *cfg; 2236 + struct brcmf_cfg80211_vif *vif; 2237 + struct brcmf_if *ifp; 2238 + 2239 + ifp = netdev_priv(ndev); 2240 + cfg = ifp->drvr->config; 2241 + vif = ifp->vif; 2242 + 2243 + brcmf_free_vif(cfg, vif); 2244 + free_netdev(ifp->ndev); 2241 2245 } 2242 2246 2243 2247 /** ··· 2335 2303 brcmf_err("Registering netdevice failed\n"); 2336 2304 goto fail; 2337 2305 } 2306 + /* override destructor */ 2307 + ifp->ndev->destructor = brcmf_p2p_free_p2p_if; 2308 + 2338 2309 cfg->p2p.bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = vif; 2339 2310 /* Disable firmware roaming for P2P interface */ 2340 2311 brcmf_fil_iovar_int_set(ifp, "roam_off", 1); ··· 2349 2314 return &ifp->vif->wdev; 2350 2315 2351 2316 fail: 2352 - brcmf_free_vif(vif); 2317 + brcmf_free_vif(cfg, vif); 2353 2318 return ERR_PTR(err); 2354 2319 } 2355 2320 ··· 2385 2350 break; 2386 2351 2387 2352 case NL80211_IFTYPE_P2P_DEVICE: 2388 - brcmf_p2p_delete_p2pdev(vif); 2353 + brcmf_p2p_delete_p2pdev(cfg, vif); 2389 2354 return 0; 2390 2355 default: 2391 2356 return -ENOTSUPP; ··· 2413 2378 err = 0; 2414 2379 } 2415 2380 brcmf_cfg80211_arm_vif_event(cfg, NULL); 2416 - brcmf_free_vif(vif); 2417 2381 p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; 2418 2382 2419 2383 return err;
+75 -14
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 459 459 return err; 460 460 } 461 461 462 + static s32 463 + brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable) 464 + { 465 + s32 err; 466 + u32 mode; 467 + 468 + if (enable) 469 + mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY; 470 + else 471 + mode = 0; 472 + 473 + /* Try to set and enable ARP offload feature, this may fail, then it */ 474 + /* is simply not supported and err 0 will be returned */ 475 + err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode); 476 + if (err) { 477 + brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", 478 + mode, err); 479 + err = 0; 480 + } else { 481 + err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable); 482 + if (err) { 483 + brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n", 484 + enable, err); 485 + err = 0; 486 + } else 487 + brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n", 488 + enable, mode); 489 + } 490 + 491 + return err; 492 + } 493 + 462 494 static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy, 463 495 const char *name, 464 496 enum nl80211_iftype type, ··· 2248 2216 } 2249 2217 2250 2218 pm = enabled ? PM_FAST : PM_OFF; 2219 + /* Do not enable the power save after assoc if it is a p2p interface */ 2220 + if (ifp->vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT) { 2221 + brcmf_dbg(INFO, "Do not enable power save for P2P clients\n"); 2222 + pm = PM_OFF; 2223 + } 2251 2224 brcmf_dbg(INFO, "power save %s\n", (pm ? "enabled" : "disabled")); 2252 2225 2253 2226 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); ··· 3677 3640 } 3678 3641 3679 3642 static s32 3643 + brcmf_cfg80211_set_channel(struct brcmf_cfg80211_info *cfg, 3644 + struct brcmf_if *ifp, 3645 + struct ieee80211_channel *channel) 3646 + { 3647 + u16 chanspec; 3648 + s32 err; 3649 + 3650 + brcmf_dbg(TRACE, "band=%d, center_freq=%d\n", channel->band, 3651 + channel->center_freq); 3652 + 3653 + chanspec = channel_to_chanspec(&cfg->d11inf, channel); 3654 + err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); 3655 + 3656 + return err; 3657 + } 3658 + 3659 + static s32 3680 3660 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, 3681 3661 struct cfg80211_ap_settings *settings) 3682 3662 { 3683 3663 s32 ie_offset; 3664 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 3684 3665 struct brcmf_if *ifp = netdev_priv(ndev); 3685 3666 struct brcmf_tlv *ssid_ie; 3686 3667 struct brcmf_ssid_le ssid_le; ··· 3738 3683 } 3739 3684 3740 3685 brcmf_set_mpc(ifp, 0); 3686 + brcmf_configure_arp_offload(ifp, false); 3741 3687 3742 3688 /* find the RSN_IE */ 3743 3689 rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, ··· 3768 3712 } 3769 3713 3770 3714 brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon); 3715 + 3716 + err = brcmf_cfg80211_set_channel(cfg, ifp, settings->chandef.chan); 3717 + if (err < 0) { 3718 + brcmf_err("Set Channel failed, %d\n", err); 3719 + goto exit; 3720 + } 3771 3721 3772 3722 if (settings->beacon_interval) { 3773 3723 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, ··· 3851 3789 set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); 3852 3790 3853 3791 exit: 3854 - if (err) 3792 + if (err) { 3855 3793 brcmf_set_mpc(ifp, 1); 3794 + brcmf_configure_arp_offload(ifp, true); 3795 + } 3856 3796 return err; 3857 3797 } 3858 3798 ··· 3895 3831 brcmf_err("bss_enable config failed %d\n", err); 3896 3832 } 3897 3833 brcmf_set_mpc(ifp, 1); 3834 + brcmf_configure_arp_offload(ifp, true); 3898 3835 set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); 3899 3836 clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); 3900 3837 ··· 4213 4148 static const struct ieee80211_iface_combination brcmf_iface_combos[] = { 4214 4149 { 4215 4150 .max_interfaces = BRCMF_IFACE_MAX_CNT, 4216 - .num_different_channels = 1, /* no multi-channel for now */ 4151 + .num_different_channels = 2, 4217 4152 .n_limits = ARRAY_SIZE(brcmf_iface_limits), 4218 4153 .limits = brcmf_iface_limits 4219 4154 } ··· 4321 4256 return vif; 4322 4257 } 4323 4258 4324 - void brcmf_free_vif(struct brcmf_cfg80211_vif *vif) 4259 + void brcmf_free_vif(struct brcmf_cfg80211_info *cfg, 4260 + struct brcmf_cfg80211_vif *vif) 4325 4261 { 4326 - struct brcmf_cfg80211_info *cfg; 4327 - struct wiphy *wiphy; 4328 - 4329 - wiphy = vif->wdev.wiphy; 4330 - cfg = wiphy_priv(wiphy); 4331 4262 list_del(&vif->list); 4332 4263 cfg->vif_cnt--; 4333 4264 4334 4265 kfree(vif); 4335 4266 if (!cfg->vif_cnt) { 4336 - wiphy_unregister(wiphy); 4337 - wiphy_free(wiphy); 4267 + wiphy_unregister(cfg->wiphy); 4268 + wiphy_free(cfg->wiphy); 4338 4269 } 4339 4270 } 4340 4271 ··· 4707 4646 return 0; 4708 4647 4709 4648 case BRCMF_E_IF_DEL: 4710 - ifp->vif = NULL; 4711 4649 mutex_unlock(&event->vif_event_lock); 4712 4650 /* event may not be upon user request */ 4713 4651 if (brcmf_cfg80211_vif_event_armed(cfg)) ··· 4912 4852 wl_deinit_priv(cfg); 4913 4853 4914 4854 cfg80211_attach_out: 4915 - brcmf_free_vif(vif); 4916 - wiphy_free(wiphy); 4855 + brcmf_free_vif(cfg, vif); 4917 4856 return NULL; 4918 4857 } 4919 4858 ··· 4924 4865 wl_deinit_priv(cfg); 4925 4866 brcmf_btcoex_detach(cfg); 4926 4867 list_for_each_entry_safe(vif, tmp, &cfg->vif_list, list) { 4927 - brcmf_free_vif(vif); 4868 + brcmf_free_vif(cfg, vif); 4928 4869 } 4929 4870 } 4930 4871 ··· 5287 5228 err = brcmf_dongle_probecap(cfg); 5288 5229 if (err) 5289 5230 goto default_conf_out; 5231 + 5232 + brcmf_configure_arp_offload(ifp, true); 5290 5233 5291 5234 cfg->dongle_up = true; 5292 5235 default_conf_out:
+2 -1
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
··· 487 487 struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, 488 488 enum nl80211_iftype type, 489 489 bool pm_block); 490 - void brcmf_free_vif(struct brcmf_cfg80211_vif *vif); 490 + void brcmf_free_vif(struct brcmf_cfg80211_info *cfg, 491 + struct brcmf_cfg80211_vif *vif); 491 492 492 493 s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, 493 494 const u8 *vndr_ie_buf, u32 vndr_ie_len);
+1 -1
drivers/net/wireless/iwlwifi/dvm/sta.c
··· 735 735 memcpy(&lq, priv->stations[i].lq, 736 736 sizeof(struct iwl_link_quality_cmd)); 737 737 738 - if (!memcmp(&lq, &zero_lq, sizeof(lq))) 738 + if (memcmp(&lq, &zero_lq, sizeof(lq))) 739 739 send_lq = true; 740 740 } 741 741 spin_unlock_bh(&priv->sta_lock);
+1 -1
drivers/nfc/Kconfig
··· 28 28 29 29 config NFC_MEI_PHY 30 30 tristate "MEI bus NFC device support" 31 - depends on INTEL_MEI_BUS_NFC && NFC_HCI 31 + depends on INTEL_MEI && NFC_HCI 32 32 help 33 33 This adds support to use an mei bus nfc device. Select this if you 34 34 will use an HCI NFC driver for an NFC chip connected behind an
+9
drivers/nfc/mei_phy.c
··· 64 64 return r; 65 65 } 66 66 67 + r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy); 68 + if (r) { 69 + pr_err("MEY_PHY: Event cb registration failed\n"); 70 + mei_cl_disable_device(phy->device); 71 + phy->powered = 0; 72 + 73 + return r; 74 + } 75 + 67 76 phy->powered = 1; 68 77 69 78 return 0;
+5 -15
drivers/nfc/microread/mei.c
··· 43 43 return -ENOMEM; 44 44 } 45 45 46 - r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); 47 - if (r) { 48 - pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n"); 49 - goto err_out; 50 - } 51 - 52 46 r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 53 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 54 48 &phy->hdev); 55 - if (r < 0) 56 - goto err_out; 49 + if (r < 0) { 50 + nfc_mei_phy_free(phy); 51 + 52 + return r; 53 + } 57 54 58 55 return 0; 59 - 60 - err_out: 61 - nfc_mei_phy_free(phy); 62 - 63 - return r; 64 56 } 65 57 66 58 static int microread_mei_remove(struct mei_cl_device *device) ··· 62 70 pr_info("Removing microread\n"); 63 71 64 72 microread_remove(phy->hdev); 65 - 66 - nfc_mei_phy_disable(phy); 67 73 68 74 nfc_mei_phy_free(phy); 69 75
+5 -15
drivers/nfc/pn544/mei.c
··· 43 43 return -ENOMEM; 44 44 } 45 45 46 - r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); 47 - if (r) { 48 - pr_err(PN544_DRIVER_NAME ": event cb registration failed\n"); 49 - goto err_out; 50 - } 51 - 52 46 r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 53 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 54 48 &phy->hdev); 55 - if (r < 0) 56 - goto err_out; 49 + if (r < 0) { 50 + nfc_mei_phy_free(phy); 51 + 52 + return r; 53 + } 57 54 58 55 return 0; 59 - 60 - err_out: 61 - nfc_mei_phy_free(phy); 62 - 63 - return r; 64 56 } 65 57 66 58 static int pn544_mei_remove(struct mei_cl_device *device) ··· 62 70 pr_info("Removing pn544\n"); 63 71 64 72 pn544_hci_remove(phy->hdev); 65 - 66 - nfc_mei_phy_disable(phy); 67 73 68 74 nfc_mei_phy_free(phy); 69 75
+36 -9
drivers/pinctrl/sh-pfc/pfc-r8a7779.c
··· 2357 2357 }; 2358 2358 /* - USB0 ------------------------------------------------------------------- */ 2359 2359 static const unsigned int usb0_pins[] = { 2360 - /* OVC */ 2361 - 150, 154, 2360 + /* PENC */ 2361 + 154, 2362 2362 }; 2363 2363 static const unsigned int usb0_mux[] = { 2364 - USB_OVC0_MARK, USB_PENC0_MARK, 2364 + USB_PENC0_MARK, 2365 + }; 2366 + static const unsigned int usb0_ovc_pins[] = { 2367 + /* USB_OVC */ 2368 + 150 2369 + }; 2370 + static const unsigned int usb0_ovc_mux[] = { 2371 + USB_OVC0_MARK, 2365 2372 }; 2366 2373 /* - USB1 ------------------------------------------------------------------- */ 2367 2374 static const unsigned int usb1_pins[] = { 2368 - /* OVC */ 2369 - 152, 155, 2375 + /* PENC */ 2376 + 155, 2370 2377 }; 2371 2378 static const unsigned int usb1_mux[] = { 2372 - USB_OVC1_MARK, USB_PENC1_MARK, 2379 + USB_PENC1_MARK, 2380 + }; 2381 + static const unsigned int usb1_ovc_pins[] = { 2382 + /* USB_OVC */ 2383 + 152, 2384 + }; 2385 + static const unsigned int usb1_ovc_mux[] = { 2386 + USB_OVC1_MARK, 2373 2387 }; 2374 2388 /* - USB2 ------------------------------------------------------------------- */ 2375 2389 static const unsigned int usb2_pins[] = { 2376 - /* OVC, PENC */ 2377 - 125, 156, 2390 + /* PENC */ 2391 + 156, 2378 2392 }; 2379 2393 static const unsigned int usb2_mux[] = { 2380 - USB_OVC2_MARK, USB_PENC2_MARK, 2394 + USB_PENC2_MARK, 2395 + }; 2396 + static const unsigned int usb2_ovc_pins[] = { 2397 + /* USB_OVC */ 2398 + 125, 2399 + }; 2400 + static const unsigned int usb2_ovc_mux[] = { 2401 + USB_OVC2_MARK, 2381 2402 }; 2382 2403 2383 2404 static const struct sh_pfc_pin_group pinmux_groups[] = { ··· 2522 2501 SH_PFC_PIN_GROUP(sdhi3_cd), 2523 2502 SH_PFC_PIN_GROUP(sdhi3_wp), 2524 2503 SH_PFC_PIN_GROUP(usb0), 2504 + SH_PFC_PIN_GROUP(usb0_ovc), 2525 2505 SH_PFC_PIN_GROUP(usb1), 2506 + SH_PFC_PIN_GROUP(usb1_ovc), 2526 2507 SH_PFC_PIN_GROUP(usb2), 2508 + SH_PFC_PIN_GROUP(usb2_ovc), 2527 2509 }; 2528 2510 2529 2511 static const char * const du0_groups[] = { ··· 2707 2683 2708 2684 static const char * const usb0_groups[] = { 2709 2685 "usb0", 2686 + "usb0_ovc", 2710 2687 }; 2711 2688 2712 2689 static const char * const usb1_groups[] = { 2713 2690 "usb1", 2691 + "usb1_ovc", 2714 2692 }; 2715 2693 2716 2694 static const char * const usb2_groups[] = { 2717 2695 "usb2", 2696 + "usb2_ovc", 2718 2697 }; 2719 2698 2720 2699 static const struct sh_pfc_function pinmux_functions[] = {
+1 -1
drivers/platform/x86/hp-wmi.c
··· 703 703 } 704 704 rfkill_init_sw_state(gps_rfkill, 705 705 hp_wmi_get_sw_state(HPWMI_GPS)); 706 - rfkill_set_hw_state(bluetooth_rfkill, 706 + rfkill_set_hw_state(gps_rfkill, 707 707 hp_wmi_get_hw_state(HPWMI_GPS)); 708 708 err = rfkill_register(gps_rfkill); 709 709 if (err)
+5 -3
drivers/ptp/ptp_pch.c
··· 628 628 629 629 chip->caps = ptp_pch_caps; 630 630 chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev); 631 - 632 - if (IS_ERR(chip->ptp_clock)) 633 - return PTR_ERR(chip->ptp_clock); 631 + if (IS_ERR(chip->ptp_clock)) { 632 + ret = PTR_ERR(chip->ptp_clock); 633 + goto err_ptp_clock_reg; 634 + } 634 635 635 636 spin_lock_init(&chip->register_lock); 636 637 ··· 670 669 671 670 err_req_irq: 672 671 ptp_clock_unregister(chip->ptp_clock); 672 + err_ptp_clock_reg: 673 673 iounmap(chip->regs); 674 674 chip->regs = NULL; 675 675
+5 -2
drivers/regulator/core.c
··· 1539 1539 } 1540 1540 1541 1541 /** 1542 - * Balance enable_count of each GPIO and actual GPIO pin control. 1542 + * regulator_ena_gpio_ctrl - balance enable_count of each GPIO and actual GPIO pin control 1543 + * @rdev: regulator_dev structure 1544 + * @enable: enable GPIO at initial use? 1545 + * 1543 1546 * GPIO is enabled in case of initial use. (enable_count is 0) 1544 1547 * GPIO is disabled when it is not shared any more. (enable_count <= 1) 1545 1548 */ ··· 2705 2702 /** 2706 2703 * regulator_set_current_limit - set regulator output current limit 2707 2704 * @regulator: regulator source 2708 - * @min_uA: Minimuum supported current in uA 2705 + * @min_uA: Minimum supported current in uA 2709 2706 * @max_uA: Maximum supported current in uA 2710 2707 * 2711 2708 * Sets current sink to the desired output current. This can be set during
+12 -12
drivers/regulator/dbx500-prcmu.c
··· 24 24 static int power_state_active_cnt; /* will initialize to zero */ 25 25 static DEFINE_SPINLOCK(power_state_active_lock); 26 26 27 - int power_state_active_get(void) 28 - { 29 - unsigned long flags; 30 - int cnt; 31 - 32 - spin_lock_irqsave(&power_state_active_lock, flags); 33 - cnt = power_state_active_cnt; 34 - spin_unlock_irqrestore(&power_state_active_lock, flags); 35 - 36 - return cnt; 37 - } 38 - 39 27 void power_state_active_enable(void) 40 28 { 41 29 unsigned long flags; ··· 52 64 } 53 65 54 66 #ifdef CONFIG_REGULATOR_DEBUG 67 + 68 + static int power_state_active_get(void) 69 + { 70 + unsigned long flags; 71 + int cnt; 72 + 73 + spin_lock_irqsave(&power_state_active_lock, flags); 74 + cnt = power_state_active_cnt; 75 + spin_unlock_irqrestore(&power_state_active_lock, flags); 76 + 77 + return cnt; 78 + } 55 79 56 80 static struct ux500_regulator_debug { 57 81 struct dentry *dir;
+2 -2
drivers/regulator/palmas-regulator.c
··· 840 840 break; 841 841 } 842 842 843 - if ((id == PALMAS_REG_SMPS6) && (id == PALMAS_REG_SMPS8)) 843 + if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8)) 844 844 ramp_delay_support = true; 845 845 846 846 if (ramp_delay_support) { ··· 878 878 pmic->desc[id].vsel_mask = SMPS10_VSEL; 879 879 pmic->desc[id].enable_reg = 880 880 PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, 881 - PALMAS_SMPS10_STATUS); 881 + PALMAS_SMPS10_CTRL); 882 882 pmic->desc[id].enable_mask = SMPS10_BOOST_EN; 883 883 pmic->desc[id].min_uV = 3750000; 884 884 pmic->desc[id].uV_step = 1250000;
+10 -2
drivers/s390/block/dasd.c
··· 3440 3440 device->path_data.opm &= ~eventlpm; 3441 3441 device->path_data.ppm &= ~eventlpm; 3442 3442 device->path_data.npm &= ~eventlpm; 3443 - if (oldopm && !device->path_data.opm) 3444 - dasd_generic_last_path_gone(device); 3443 + if (oldopm && !device->path_data.opm) { 3444 + dev_warn(&device->cdev->dev, 3445 + "No verified channel paths remain " 3446 + "for the device\n"); 3447 + DBF_DEV_EVENT(DBF_WARNING, device, 3448 + "%s", "last verified path gone"); 3449 + dasd_eer_write(device, NULL, DASD_EER_NOPATH); 3450 + dasd_device_set_stop_bits(device, 3451 + DASD_STOPPED_DC_WAIT); 3452 + } 3445 3453 } 3446 3454 if (path_event[chp] & PE_PATH_AVAILABLE) { 3447 3455 device->path_data.opm &= ~eventlpm;
+6 -2
drivers/staging/android/alarm-dev.c
··· 264 264 } 265 265 266 266 rv = alarm_do_ioctl(file, cmd, &ts); 267 + if (rv) 268 + return rv; 267 269 268 270 switch (ANDROID_ALARM_BASE_CMD(cmd)) { 269 271 case ANDROID_ALARM_GET_TIME(0): ··· 274 272 break; 275 273 } 276 274 277 - return rv; 275 + return 0; 278 276 } 279 277 #ifdef CONFIG_COMPAT 280 278 static long alarm_compat_ioctl(struct file *file, unsigned int cmd, ··· 297 295 } 298 296 299 297 rv = alarm_do_ioctl(file, cmd, &ts); 298 + if (rv) 299 + return rv; 300 300 301 301 switch (ANDROID_ALARM_BASE_CMD(cmd)) { 302 302 case ANDROID_ALARM_GET_TIME(0): /* NOTE: we modified cmd above */ ··· 307 303 break; 308 304 } 309 305 310 - return rv; 306 + return 0; 311 307 } 312 308 #endif 313 309
+2 -3
drivers/staging/dwc2/hcd.c
··· 2804 2804 2805 2805 /* Set device flags indicating whether the HCD supports DMA */ 2806 2806 if (hsotg->core_params->dma_enable > 0) { 2807 - if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) 2808 - dev_warn(hsotg->dev, 2809 - "can't enable workaround for >2GB RAM\n"); 2807 + if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(32)) < 0) 2808 + dev_warn(hsotg->dev, "can't set DMA mask\n"); 2810 2809 if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) 2811 2810 dev_warn(hsotg->dev, 2812 2811 "can't enable workaround for >2GB RAM\n");
-4
drivers/staging/zcache/ramster.h
··· 11 11 #ifndef _ZCACHE_RAMSTER_H_ 12 12 #define _ZCACHE_RAMSTER_H_ 13 13 14 - #ifdef CONFIG_RAMSTER_MODULE 15 - #define CONFIG_RAMSTER 16 - #endif 17 - 18 14 #ifdef CONFIG_RAMSTER 19 15 #include "ramster/ramster.h" 20 16 #else
+2
drivers/staging/zcache/ramster/debug.c
··· 1 1 #include <linux/atomic.h> 2 2 #include "debug.h" 3 3 4 + ssize_t ramster_foreign_eph_pages; 5 + ssize_t ramster_foreign_pers_pages; 4 6 #ifdef CONFIG_DEBUG_FS 5 7 #include <linux/debugfs.h> 6 8
+4 -2
drivers/staging/zcache/ramster/ramster.c
··· 66 66 67 67 /* Used by this code. */ 68 68 long ramster_flnodes; 69 - ssize_t ramster_foreign_eph_pages; 70 - ssize_t ramster_foreign_pers_pages; 71 69 /* FIXME frontswap selfshrinking knobs in debugfs? */ 72 70 73 71 static LIST_HEAD(ramster_rem_op_list); ··· 397 399 inc_ramster_foreign_eph_pages(); 398 400 } else { 399 401 dec_ramster_foreign_eph_pages(); 402 + #ifdef CONFIG_RAMSTER_DEBUG 400 403 WARN_ON_ONCE(ramster_foreign_eph_pages < 0); 404 + #endif 401 405 } 402 406 } else { 403 407 if (count > 0) { 404 408 inc_ramster_foreign_pers_pages(); 405 409 } else { 406 410 dec_ramster_foreign_pers_pages(); 411 + #ifdef CONFIG_RAMSTER_DEBUG 407 412 WARN_ON_ONCE(ramster_foreign_pers_pages < 0); 413 + #endif 408 414 } 409 415 } 410 416 }
+7 -7
drivers/tty/serial/8250/8250_core.c
··· 2755 2755 if (nr_uarts > UART_NR) 2756 2756 nr_uarts = UART_NR; 2757 2757 2758 - for (i = 0; i < UART_NR; i++) { 2758 + for (i = 0; i < nr_uarts; i++) { 2759 2759 struct uart_8250_port *up = &serial8250_ports[i]; 2760 2760 struct uart_port *port = &up->port; 2761 2761 ··· 2916 2916 * if so, search for the first available port that does have 2917 2917 * console support. 2918 2918 */ 2919 - if (co->index >= UART_NR) 2919 + if (co->index >= nr_uarts) 2920 2920 co->index = 0; 2921 2921 port = &serial8250_ports[co->index].port; 2922 2922 if (!port->iobase && !port->membase) ··· 2957 2957 int line; 2958 2958 struct uart_port *port; 2959 2959 2960 - for (line = 0; line < UART_NR; line++) { 2960 + for (line = 0; line < nr_uarts; line++) { 2961 2961 port = &serial8250_ports[line].port; 2962 2962 if (uart_match_port(p, port)) 2963 2963 return line; ··· 3110 3110 { 3111 3111 int i; 3112 3112 3113 - for (i = 0; i < UART_NR; i++) { 3113 + for (i = 0; i < nr_uarts; i++) { 3114 3114 struct uart_8250_port *up = &serial8250_ports[i]; 3115 3115 3116 3116 if (up->port.dev == &dev->dev) ··· 3178 3178 /* 3179 3179 * First, find a port entry which matches. 3180 3180 */ 3181 - for (i = 0; i < UART_NR; i++) 3181 + for (i = 0; i < nr_uarts; i++) 3182 3182 if (uart_match_port(&serial8250_ports[i].port, port)) 3183 3183 return &serial8250_ports[i]; 3184 3184 ··· 3187 3187 * free entry. We look for one which hasn't been previously 3188 3188 * used (indicated by zero iobase). 3189 3189 */ 3190 - for (i = 0; i < UART_NR; i++) 3190 + for (i = 0; i < nr_uarts; i++) 3191 3191 if (serial8250_ports[i].port.type == PORT_UNKNOWN && 3192 3192 serial8250_ports[i].port.iobase == 0) 3193 3193 return &serial8250_ports[i]; ··· 3196 3196 * That also failed. Last resort is to find any entry which 3197 3197 * doesn't have a real port associated with it. 3198 3198 */ 3199 - for (i = 0; i < UART_NR; i++) 3199 + for (i = 0; i < nr_uarts; i++) 3200 3200 if (serial8250_ports[i].port.type == PORT_UNKNOWN) 3201 3201 return &serial8250_ports[i]; 3202 3202
+2
drivers/tty/serial/imx.c
··· 761 761 762 762 temp = readl(sport->port.membase + UCR2); 763 763 temp |= (UCR2_RXEN | UCR2_TXEN); 764 + if (!sport->have_rtscts) 765 + temp |= UCR2_IRTS; 764 766 writel(temp, sport->port.membase + UCR2); 765 767 766 768 if (USE_IRDA(sport)) {
+13
drivers/tty/serial/samsung.c
··· 1166 1166 ourport->tx_irq = ret; 1167 1167 1168 1168 ourport->clk = clk_get(&platdev->dev, "uart"); 1169 + if (IS_ERR(ourport->clk)) { 1170 + pr_err("%s: Controller clock not found\n", 1171 + dev_name(&platdev->dev)); 1172 + return PTR_ERR(ourport->clk); 1173 + } 1174 + 1175 + ret = clk_prepare_enable(ourport->clk); 1176 + if (ret) { 1177 + pr_err("uart: clock failed to prepare+enable: %d\n", ret); 1178 + clk_put(ourport->clk); 1179 + return ret; 1180 + } 1169 1181 1170 1182 /* Keep all interrupts masked and cleared */ 1171 1183 if (s3c24xx_serial_has_interrupt_mask(port)) { ··· 1192 1180 1193 1181 /* reset the fifos (and setup the uart) */ 1194 1182 s3c24xx_serial_resetport(port, cfg); 1183 + clk_disable_unprepare(ourport->clk); 1195 1184 return 0; 1196 1185 } 1197 1186
+7 -3
drivers/usb/core/devio.c
··· 1287 1287 goto error; 1288 1288 } 1289 1289 for (totlen = u = 0; u < uurb->number_of_packets; u++) { 1290 - /* arbitrary limit, 1291 - * sufficient for USB 2.0 high-bandwidth iso */ 1292 - if (isopkt[u].length > 8192) { 1290 + /* 1291 + * arbitrary limit need for USB 3.0 1292 + * bMaxBurst (0~15 allowed, 1~16 packets) 1293 + * bmAttributes (bit 1:0, mult 0~2, 1~3 packets) 1294 + * sizemax: 1024 * 16 * 3 = 49152 1295 + */ 1296 + if (isopkt[u].length > 49152) { 1293 1297 ret = -EINVAL; 1294 1298 goto error; 1295 1299 }
+1 -1
drivers/usb/dwc3/dwc3-exynos.c
··· 164 164 { 165 165 struct dwc3_exynos *exynos = platform_get_drvdata(pdev); 166 166 167 + device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); 167 168 platform_device_unregister(exynos->usb2_phy); 168 169 platform_device_unregister(exynos->usb3_phy); 169 - device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); 170 170 171 171 clk_disable_unprepare(exynos->clk); 172 172
+1 -1
drivers/usb/dwc3/dwc3-pci.c
··· 196 196 { 197 197 struct dwc3_pci *glue = pci_get_drvdata(pci); 198 198 199 + platform_device_unregister(glue->dwc3); 199 200 platform_device_unregister(glue->usb2_phy); 200 201 platform_device_unregister(glue->usb3_phy); 201 - platform_device_unregister(glue->dwc3); 202 202 pci_set_drvdata(pci, NULL); 203 203 pci_disable_device(pci); 204 204 }
+12 -4
drivers/usb/dwc3/gadget.c
··· 1706 1706 dep = dwc->eps[epnum]; 1707 1707 if (!dep) 1708 1708 continue; 1709 - 1710 - dwc3_free_trb_pool(dep); 1711 - 1712 - if (epnum != 0 && epnum != 1) 1709 + /* 1710 + * Physical endpoints 0 and 1 are special; they form the 1711 + * bi-directional USB endpoint 0. 1712 + * 1713 + * For those two physical endpoints, we don't allocate a TRB 1714 + * pool nor do we add them the endpoints list. Due to that, we 1715 + * shouldn't do these two operations otherwise we would end up 1716 + * with all sorts of bugs when removing dwc3.ko. 1717 + */ 1718 + if (epnum != 0 && epnum != 1) { 1719 + dwc3_free_trb_pool(dep); 1713 1720 list_del(&dep->endpoint.ep_list); 1721 + } 1714 1722 1715 1723 kfree(dep); 1716 1724 }
+7 -2
drivers/usb/host/ehci-sched.c
··· 213 213 } 214 214 215 215 static const unsigned char 216 - max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 }; 216 + max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 }; 217 217 218 218 /* carryover low/fullspeed bandwidth that crosses uframe boundries */ 219 219 static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) ··· 646 646 /* reschedule QH iff another request is queued */ 647 647 if (!list_empty(&qh->qtd_list) && ehci->rh_state == EHCI_RH_RUNNING) { 648 648 rc = qh_schedule(ehci, qh); 649 + if (rc == 0) { 650 + qh_refresh(ehci, qh); 651 + qh_link_periodic(ehci, qh); 652 + } 649 653 650 654 /* An error here likely indicates handshake failure 651 655 * or no space left in the schedule. Neither fault ··· 657 653 * 658 654 * FIXME kill the now-dysfunctional queued urbs 659 655 */ 660 - if (rc != 0) 656 + else { 661 657 ehci_err(ehci, "can't reschedule qh %p, err %d\n", 662 658 qh, rc); 659 + } 663 660 } 664 661 665 662 /* maybe turn off periodic schedule */
+7 -3
drivers/usb/host/xhci-mem.c
··· 1827 1827 } 1828 1828 spin_unlock_irqrestore(&xhci->lock, flags); 1829 1829 1830 + if (!xhci->rh_bw) 1831 + goto no_bw; 1832 + 1830 1833 num_ports = HCS_MAX_PORTS(xhci->hcs_params1); 1831 1834 for (i = 0; i < num_ports; i++) { 1832 1835 struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; ··· 1848 1845 } 1849 1846 } 1850 1847 1848 + no_bw: 1851 1849 xhci->num_usb2_ports = 0; 1852 1850 xhci->num_usb3_ports = 0; 1853 1851 xhci->num_active_eps = 0; ··· 2260 2256 u32 page_size, temp; 2261 2257 int i; 2262 2258 2259 + INIT_LIST_HEAD(&xhci->lpm_failed_devs); 2260 + INIT_LIST_HEAD(&xhci->cancel_cmd_list); 2261 + 2263 2262 page_size = xhci_readl(xhci, &xhci->op_regs->page_size); 2264 2263 xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); 2265 2264 for (i = 0; i < 16; i++) { ··· 2341 2334 xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); 2342 2335 if (!xhci->cmd_ring) 2343 2336 goto fail; 2344 - INIT_LIST_HEAD(&xhci->cancel_cmd_list); 2345 2337 xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); 2346 2338 xhci_dbg(xhci, "First segment DMA is 0x%llx\n", 2347 2339 (unsigned long long)xhci->cmd_ring->first_seg->dma); ··· 2450 2444 goto fail; 2451 2445 if (xhci_setup_port_arrays(xhci, flags)) 2452 2446 goto fail; 2453 - 2454 - INIT_LIST_HEAD(&xhci->lpm_failed_devs); 2455 2447 2456 2448 /* Enable USB 3.0 device notifications for function remote wake, which 2457 2449 * is necessary for allowing USB 3.0 devices to do remote wakeup from
+8
drivers/usb/host/xhci-pci.c
··· 221 221 static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) 222 222 { 223 223 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 224 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 225 + 226 + /* 227 + * Systems with the TI redriver that loses port status change events 228 + * need to have the registers polled during D3, so avoid D3cold. 229 + */ 230 + if (xhci_compliance_mode_recovery_timer_quirk_check()) 231 + pdev->no_d3cold = true; 224 232 225 233 return xhci_suspend(xhci); 226 234 }
+13 -3
drivers/usb/host/xhci.c
··· 466 466 * Systems: 467 467 * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 468 468 */ 469 - static bool compliance_mode_recovery_timer_quirk_check(void) 469 + bool xhci_compliance_mode_recovery_timer_quirk_check(void) 470 470 { 471 471 const char *dmi_product_name, *dmi_sys_vendor; 472 472 ··· 517 517 xhci_dbg(xhci, "Finished xhci_init\n"); 518 518 519 519 /* Initializing Compliance Mode Recovery Data If Needed */ 520 - if (compliance_mode_recovery_timer_quirk_check()) { 520 + if (xhci_compliance_mode_recovery_timer_quirk_check()) { 521 521 xhci->quirks |= XHCI_COMP_MODE_QUIRK; 522 522 compliance_mode_recovery_timer_init(xhci); 523 523 } ··· 956 956 struct usb_hcd *hcd = xhci_to_hcd(xhci); 957 957 struct usb_hcd *secondary_hcd; 958 958 int retval = 0; 959 + bool comp_timer_running = false; 959 960 960 961 /* Wait a bit if either of the roothubs need to settle from the 961 962 * transition into bus suspend. ··· 994 993 995 994 /* If restore operation fails, re-initialize the HC during resume */ 996 995 if ((temp & STS_SRE) || hibernated) { 996 + 997 + if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && 998 + !(xhci_all_ports_seen_u0(xhci))) { 999 + del_timer_sync(&xhci->comp_mode_recovery_timer); 1000 + xhci_dbg(xhci, "Compliance Mode Recovery Timer deleted!\n"); 1001 + } 1002 + 997 1003 /* Let the USB core know _both_ roothubs lost power. */ 998 1004 usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); 999 1005 usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); ··· 1043 1035 retval = xhci_init(hcd->primary_hcd); 1044 1036 if (retval) 1045 1037 return retval; 1038 + comp_timer_running = true; 1039 + 1046 1040 xhci_dbg(xhci, "Start the primary HCD\n"); 1047 1041 retval = xhci_run(hcd->primary_hcd); 1048 1042 if (!retval) { ··· 1086 1076 * to suffer the Compliance Mode issue again. It doesn't matter if 1087 1077 * ports have entered previously to U0 before system's suspension. 1088 1078 */ 1089 - if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 1079 + if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running) 1090 1080 compliance_mode_recovery_timer_init(xhci); 1091 1081 1092 1082 /* Re-enable port polling. */
+3
drivers/usb/host/xhci.h
··· 1853 1853 struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); 1854 1854 struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); 1855 1855 1856 + /* xHCI quirks */ 1857 + bool xhci_compliance_mode_recovery_timer_quirk_check(void); 1858 + 1856 1859 #endif /* __LINUX_XHCI_HCD_H */
+8 -10
drivers/usb/musb/musb_host.c
··· 1232 1232 void __iomem *mbase = musb->mregs; 1233 1233 struct dma_channel *dma; 1234 1234 bool transfer_pending = false; 1235 - static bool use_sg; 1236 1235 1237 1236 musb_ep_select(mbase, epnum); 1238 1237 tx_csr = musb_readw(epio, MUSB_TXCSR); ··· 1462 1463 * NULL. 1463 1464 */ 1464 1465 if (!urb->transfer_buffer) 1465 - use_sg = true; 1466 + qh->use_sg = true; 1466 1467 1467 - if (use_sg) { 1468 + if (qh->use_sg) { 1468 1469 /* sg_miter_start is already done in musb_ep_program */ 1469 1470 if (!sg_miter_next(&qh->sg_miter)) { 1470 1471 dev_err(musb->controller, "error: sg list empty\n"); ··· 1483 1484 1484 1485 qh->segsize = length; 1485 1486 1486 - if (use_sg) { 1487 + if (qh->use_sg) { 1487 1488 if (offset + length >= urb->transfer_buffer_length) 1488 - use_sg = false; 1489 + qh->use_sg = false; 1489 1490 } 1490 1491 1491 1492 musb_ep_select(mbase, epnum); ··· 1551 1552 bool done = false; 1552 1553 u32 status; 1553 1554 struct dma_channel *dma; 1554 - static bool use_sg; 1555 1555 unsigned int sg_flags = SG_MITER_ATOMIC | SG_MITER_TO_SG; 1556 1556 1557 1557 musb_ep_select(mbase, epnum); ··· 1876 1878 * NULL. 1877 1879 */ 1878 1880 if (!urb->transfer_buffer) { 1879 - use_sg = true; 1881 + qh->use_sg = true; 1880 1882 sg_miter_start(&qh->sg_miter, urb->sg, 1, 1881 1883 sg_flags); 1882 1884 } 1883 1885 1884 - if (use_sg) { 1886 + if (qh->use_sg) { 1885 1887 if (!sg_miter_next(&qh->sg_miter)) { 1886 1888 dev_err(musb->controller, "error: sg list empty\n"); 1887 1889 sg_miter_stop(&qh->sg_miter); ··· 1911 1913 urb->actual_length += xfer_len; 1912 1914 qh->offset += xfer_len; 1913 1915 if (done) { 1914 - if (use_sg) 1915 - use_sg = false; 1916 + if (qh->use_sg) 1917 + qh->use_sg = false; 1916 1918 1917 1919 if (urb->status == -EINPROGRESS) 1918 1920 urb->status = status;
+1
drivers/usb/musb/musb_host.h
··· 74 74 u16 frame; /* for periodic schedule */ 75 75 unsigned iso_idx; /* in urb->iso_frame_desc[] */ 76 76 struct sg_mapping_iter sg_miter; /* for highmem in PIO mode */ 77 + bool use_sg; /* to track urb using sglist */ 77 78 }; 78 79 79 80 /* map from control or bulk queue head to the first qh on that ring */
+1 -1
drivers/usb/serial/ark3116.c
··· 43 43 #define DRIVER_NAME "ark3116" 44 44 45 45 /* usb timeout of 1 second */ 46 - #define ARK_TIMEOUT (1*HZ) 46 + #define ARK_TIMEOUT 1000 47 47 48 48 static const struct usb_device_id id_table[] = { 49 49 { USB_DEVICE(0x6547, 0x0232) },
+17 -1
drivers/usb/serial/cypress_m8.c
··· 65 65 static const struct usb_device_id id_table_cyphidcomrs232[] = { 66 66 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, 67 67 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, 68 + { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, 68 69 { } /* Terminating entry */ 69 70 }; 70 71 ··· 79 78 { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, 80 79 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, 81 80 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, 81 + { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, 82 82 { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, 83 83 { } /* Terminating entry */ 84 84 }; ··· 231 229 * Cypress serial helper functions 232 230 *****************************************************************************/ 233 231 232 + /* FRWD Dongle hidcom needs to skip reset and speed checks */ 233 + static inline bool is_frwd(struct usb_device *dev) 234 + { 235 + return ((le16_to_cpu(dev->descriptor.idVendor) == VENDOR_ID_FRWD) && 236 + (le16_to_cpu(dev->descriptor.idProduct) == PRODUCT_ID_CYPHIDCOM_FRWD)); 237 + } 234 238 235 239 static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) 236 240 { ··· 244 236 priv = usb_get_serial_port_data(port); 245 237 246 238 if (unstable_bauds) 239 + return new_rate; 240 + 241 + /* FRWD Dongle uses 115200 bps */ 242 + if (is_frwd(port->serial->dev)) 247 243 return new_rate; 248 244 249 245 /* ··· 460 448 return -ENOMEM; 461 449 } 462 450 463 - usb_reset_configuration(serial->dev); 451 + /* Skip reset for FRWD device. It is a workaound: 452 + device hangs if it receives SET_CONFIGURE in Configured 453 + state. */ 454 + if (!is_frwd(serial->dev)) 455 + usb_reset_configuration(serial->dev); 464 456 465 457 priv->cmd_ctrl = 0; 466 458 priv->line_control = 0;
+4
drivers/usb/serial/cypress_m8.h
··· 24 24 #define VENDOR_ID_CYPRESS 0x04b4 25 25 #define PRODUCT_ID_CYPHIDCOM 0x5500 26 26 27 + /* FRWD Dongle - a GPS sports watch */ 28 + #define VENDOR_ID_FRWD 0x6737 29 + #define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001 30 + 27 31 /* Powercom UPS, chip CY7C63723 */ 28 32 #define VENDOR_ID_POWERCOM 0x0d9f 29 33 #define PRODUCT_ID_UPS 0x0002
+2 -2
drivers/usb/serial/iuu_phoenix.c
··· 287 287 usb_bulk_msg(serial->dev, 288 288 usb_sndbulkpipe(serial->dev, 289 289 port->bulk_out_endpointAddress), buf, 290 - count, &actual, HZ * 1); 290 + count, &actual, 1000); 291 291 292 292 if (status != IUU_OPERATION_OK) 293 293 dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); ··· 307 307 usb_bulk_msg(serial->dev, 308 308 usb_rcvbulkpipe(serial->dev, 309 309 port->bulk_in_endpointAddress), buf, 310 - count, &actual, HZ * 1); 310 + count, &actual, 1000); 311 311 312 312 if (status != IUU_OPERATION_OK) 313 313 dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status);
-10
drivers/usb/serial/keyspan.c
··· 1548 1548 struct keyspan_serial_private *s_priv; 1549 1549 struct keyspan_port_private *p_priv; 1550 1550 const struct keyspan_device_details *d_details; 1551 - int outcont_urb; 1552 1551 struct urb *this_urb; 1553 1552 int device_port, err; 1554 1553 ··· 1558 1559 d_details = s_priv->device_details; 1559 1560 device_port = port->number - port->serial->minor; 1560 1561 1561 - outcont_urb = d_details->outcont_endpoints[port->number]; 1562 1562 this_urb = p_priv->outcont_urb; 1563 1563 1564 1564 dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe)); ··· 1683 1685 err = usb_submit_urb(this_urb, GFP_ATOMIC); 1684 1686 if (err != 0) 1685 1687 dev_dbg(&port->dev, "%s - usb_submit_urb(setup) failed (%d)\n", __func__, err); 1686 - #if 0 1687 - else { 1688 - dev_dbg(&port->dev, "%s - usb_submit_urb(%d) OK %d bytes (end %d)\n", __func__ 1689 - outcont_urb, this_urb->transfer_buffer_length, 1690 - usb_pipeendpoint(this_urb->pipe)); 1691 - } 1692 - #endif 1693 - 1694 1688 return 0; 1695 1689 } 1696 1690
+18 -7
drivers/usb/serial/mos7720.c
··· 40 40 #define DRIVER_DESC "Moschip USB Serial Driver" 41 41 42 42 /* default urb timeout */ 43 - #define MOS_WDR_TIMEOUT (HZ * 5) 43 + #define MOS_WDR_TIMEOUT 5000 44 44 45 45 #define MOS_MAX_PORT 0x02 46 46 #define MOS_WRITE 0x0E ··· 227 227 __u8 requesttype = (__u8)0xc0; 228 228 __u16 index = get_reg_index(reg); 229 229 __u16 value = get_reg_value(reg, serial_portnum); 230 - int status = usb_control_msg(usbdev, pipe, request, requesttype, value, 231 - index, data, 1, MOS_WDR_TIMEOUT); 232 - if (status < 0) 230 + u8 *buf; 231 + int status; 232 + 233 + buf = kmalloc(1, GFP_KERNEL); 234 + if (!buf) 235 + return -ENOMEM; 236 + 237 + status = usb_control_msg(usbdev, pipe, request, requesttype, value, 238 + index, buf, 1, MOS_WDR_TIMEOUT); 239 + if (status == 1) 240 + *data = *buf; 241 + else if (status < 0) 233 242 dev_err(&usbdev->dev, 234 243 "mos7720: usb_control_msg() failed: %d", status); 244 + kfree(buf); 245 + 235 246 return status; 236 247 } 237 248 ··· 1629 1618 mos7720_port->shadowMCR |= (UART_MCR_XONANY); 1630 1619 /* To set hardware flow control to the specified * 1631 1620 * serial port, in SP1/2_CONTROL_REG */ 1632 - if (port->number) 1621 + if (port_number) 1633 1622 write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01); 1634 1623 else 1635 1624 write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02); ··· 1938 1927 1939 1928 /* setting configuration feature to one */ 1940 1929 usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), 1941 - (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5*HZ); 1930 + (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5000); 1942 1931 1943 1932 /* start the interrupt urb */ 1944 1933 ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL); ··· 1981 1970 /* wait for synchronous usb calls to return */ 1982 1971 if (mos_parport->msg_pending) 1983 1972 wait_for_completion_timeout(&mos_parport->syncmsg_compl, 1984 - MOS_WDR_TIMEOUT); 1973 + msecs_to_jiffies(MOS_WDR_TIMEOUT)); 1985 1974 1986 1975 parport_remove_port(mos_parport->pp); 1987 1976 usb_set_serial_data(serial, NULL);
+27 -8
drivers/usb/serial/mos7840.c
··· 2142 2142 static int mos7810_check(struct usb_serial *serial) 2143 2143 { 2144 2144 int i, pass_count = 0; 2145 + u8 *buf; 2145 2146 __u16 data = 0, mcr_data = 0; 2146 2147 __u16 test_pattern = 0x55AA; 2148 + int res; 2149 + 2150 + buf = kmalloc(VENDOR_READ_LENGTH, GFP_KERNEL); 2151 + if (!buf) 2152 + return 0; /* failed to identify 7810 */ 2147 2153 2148 2154 /* Store MCR setting */ 2149 - usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 2155 + res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 2150 2156 MCS_RDREQ, MCS_RD_RTYPE, 0x0300, MODEM_CONTROL_REGISTER, 2151 - &mcr_data, VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); 2157 + buf, VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); 2158 + if (res == VENDOR_READ_LENGTH) 2159 + mcr_data = *buf; 2152 2160 2153 2161 for (i = 0; i < 16; i++) { 2154 2162 /* Send the 1-bit test pattern out to MCS7810 test pin */ ··· 2166 2158 MODEM_CONTROL_REGISTER, NULL, 0, MOS_WDR_TIMEOUT); 2167 2159 2168 2160 /* Read the test pattern back */ 2169 - usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 2170 - MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &data, 2171 - VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); 2161 + res = usb_control_msg(serial->dev, 2162 + usb_rcvctrlpipe(serial->dev, 0), MCS_RDREQ, 2163 + MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, 2164 + VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); 2165 + if (res == VENDOR_READ_LENGTH) 2166 + data = *buf; 2172 2167 2173 2168 /* If this is a MCS7810 device, both test patterns must match */ 2174 2169 if (((test_pattern >> i) ^ (~data >> 1)) & 0x0001) ··· 2185 2174 MCS_WR_RTYPE, 0x0300 | mcr_data, MODEM_CONTROL_REGISTER, NULL, 2186 2175 0, MOS_WDR_TIMEOUT); 2187 2176 2177 + kfree(buf); 2178 + 2188 2179 if (pass_count == 16) 2189 2180 return 1; 2190 2181 ··· 2196 2183 static int mos7840_calc_num_ports(struct usb_serial *serial) 2197 2184 { 2198 2185 __u16 data = 0x00; 2186 + u8 *buf; 2199 2187 int mos7840_num_ports; 2200 2188 2201 - usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 2202 - MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &data, 2203 - VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); 2189 + buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); 2190 + if (buf) { 2191 + usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 2192 + MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, 2193 + VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); 2194 + data = *buf; 2195 + kfree(buf); 2196 + } 2204 2197 2205 2198 if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || 2206 2199 serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) {
+3 -23
drivers/usb/serial/option.c
··· 250 250 #define ZTE_PRODUCT_MF622 0x0001 251 251 #define ZTE_PRODUCT_MF628 0x0015 252 252 #define ZTE_PRODUCT_MF626 0x0031 253 - #define ZTE_PRODUCT_CDMA_TECH 0xfffe 254 - #define ZTE_PRODUCT_AC8710 0xfff1 255 - #define ZTE_PRODUCT_AC2726 0xfff5 256 - #define ZTE_PRODUCT_AC8710T 0xffff 257 253 #define ZTE_PRODUCT_MC2718 0xffe8 258 - #define ZTE_PRODUCT_AD3812 0xffeb 259 - #define ZTE_PRODUCT_MC2716 0xffed 260 254 261 255 #define BENQ_VENDOR_ID 0x04a5 262 256 #define BENQ_PRODUCT_H10 0x4068 ··· 489 495 .reserved = BIT(4), 490 496 }; 491 497 492 - static const struct option_blacklist_info zte_ad3812_z_blacklist = { 493 - .sendsetup = BIT(0) | BIT(1) | BIT(2), 494 - }; 495 - 496 498 static const struct option_blacklist_info zte_mc2718_z_blacklist = { 497 499 .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4), 498 - }; 499 - 500 - static const struct option_blacklist_info zte_mc2716_z_blacklist = { 501 - .sendsetup = BIT(1) | BIT(2) | BIT(3), 502 500 }; 503 501 504 502 static const struct option_blacklist_info huawei_cdc12_blacklist = { ··· 579 593 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, 580 594 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff), 581 595 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, 596 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x14ac, 0xff, 0xff, 0xff), /* Huawei E1820 */ 597 + .driver_info = (kernel_ulong_t) &net_intf1_blacklist }, 582 598 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), 583 599 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, 584 600 { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, ··· 785 797 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) }, 786 798 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, 787 799 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, 788 - { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ 789 800 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 790 801 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ 791 802 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ ··· 1186 1199 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff), 1187 1200 .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 1188 1201 1189 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, 1190 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, 1191 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, 1192 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, 1202 + /* NOTE: most ZTE CDMA devices should be driven by zte_ev, not option */ 1193 1203 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff), 1194 1204 .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist }, 1195 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff), 1196 - .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, 1197 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), 1198 - .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, 1199 1205 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, 1200 1206 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, 1201 1207 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
+1
drivers/usb/serial/qcserial.c
··· 118 118 {USB_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ 119 119 {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ 120 120 {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ 121 + {USB_DEVICE(0x0AF0, 0x8120)}, /* Option GTM681W */ 121 122 122 123 /* non Gobi Qualcomm serial devices */ 123 124 {USB_DEVICE_INTERFACE_NUMBER(0x0f3d, 0x68a2, 0)}, /* Sierra Wireless MC7700 Device Management */
+1 -3
drivers/usb/serial/usb-serial.c
··· 408 408 unsigned int cmd, unsigned long arg) 409 409 { 410 410 struct usb_serial_port *port = tty->driver_data; 411 - int retval = -ENODEV; 411 + int retval = -ENOIOCTLCMD; 412 412 413 413 dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd); 414 414 ··· 420 420 default: 421 421 if (port->serial->type->ioctl) 422 422 retval = port->serial->type->ioctl(tty, cmd, arg); 423 - else 424 - retval = -ENOIOCTLCMD; 425 423 } 426 424 427 425 return retval;
+9
drivers/usb/serial/visor.c
··· 560 560 */ 561 561 #define COPY_PORT(dest, src) \ 562 562 do { \ 563 + int i; \ 564 + \ 565 + for (i = 0; i < ARRAY_SIZE(src->read_urbs); ++i) { \ 566 + dest->read_urbs[i] = src->read_urbs[i]; \ 567 + dest->read_urbs[i]->context = dest; \ 568 + dest->bulk_in_buffers[i] = src->bulk_in_buffers[i]; \ 569 + } \ 563 570 dest->read_urb = src->read_urb; \ 564 571 dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress;\ 565 572 dest->bulk_in_buffer = src->bulk_in_buffer; \ 573 + dest->bulk_in_size = src->bulk_in_size; \ 566 574 dest->interrupt_in_urb = src->interrupt_in_urb; \ 575 + dest->interrupt_in_urb->context = dest; \ 567 576 dest->interrupt_in_endpointAddress = \ 568 577 src->interrupt_in_endpointAddress;\ 569 578 dest->interrupt_in_buffer = src->interrupt_in_buffer; \
+1 -1
drivers/usb/serial/whiteheat.c
··· 649 649 struct whiteheat_port_settings port_settings; 650 650 unsigned int cflag = tty->termios.c_cflag; 651 651 652 - port_settings.port = port->number + 1; 652 + port_settings.port = port->number - port->serial->minor + 1; 653 653 654 654 /* get the byte size */ 655 655 switch (cflag & CSIZE) {
+35 -23
drivers/usb/serial/zte_ev.c
··· 41 41 int len; 42 42 unsigned char *buf; 43 43 44 - if (port->number != 0) 45 - return -ENODEV; 46 - 47 44 buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); 48 45 if (!buf) 49 46 return -ENOMEM; ··· 50 53 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 51 54 0x22, 0x21, 52 55 0x0001, 0x0000, NULL, len, 53 - HZ * USB_CTRL_GET_TIMEOUT); 56 + USB_CTRL_GET_TIMEOUT); 54 57 dev_dbg(dev, "result = %d\n", result); 55 58 56 59 /* send 2st cmd and recieve data */ ··· 62 65 result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 63 66 0x21, 0xa1, 64 67 0x0000, 0x0000, buf, len, 65 - HZ * USB_CTRL_GET_TIMEOUT); 68 + USB_CTRL_GET_TIMEOUT); 66 69 debug_data(dev, __func__, len, buf, result); 67 70 68 71 /* send 3 cmd */ ··· 81 84 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 82 85 0x20, 0x21, 83 86 0x0000, 0x0000, buf, len, 84 - HZ * USB_CTRL_GET_TIMEOUT); 87 + USB_CTRL_GET_TIMEOUT); 85 88 debug_data(dev, __func__, len, buf, result); 86 89 87 90 /* send 4 cmd */ ··· 92 95 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 93 96 0x22, 0x21, 94 97 0x0003, 0x0000, NULL, len, 95 - HZ * USB_CTRL_GET_TIMEOUT); 98 + USB_CTRL_GET_TIMEOUT); 96 99 dev_dbg(dev, "result = %d\n", result); 97 100 98 101 /* send 5 cmd */ ··· 104 107 result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 105 108 0x21, 0xa1, 106 109 0x0000, 0x0000, buf, len, 107 - HZ * USB_CTRL_GET_TIMEOUT); 110 + USB_CTRL_GET_TIMEOUT); 108 111 debug_data(dev, __func__, len, buf, result); 109 112 110 113 /* send 6 cmd */ ··· 123 126 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 124 127 0x20, 0x21, 125 128 0x0000, 0x0000, buf, len, 126 - HZ * USB_CTRL_GET_TIMEOUT); 129 + USB_CTRL_GET_TIMEOUT); 127 130 debug_data(dev, __func__, len, buf, result); 128 131 kfree(buf); 129 132 ··· 163 166 int len; 164 167 unsigned char *buf; 165 168 166 - if (port->number != 0) 167 - return; 168 - 169 169 buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); 170 170 if (!buf) 171 171 return; ··· 172 178 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 173 179 0x22, 0x21, 174 180 0x0002, 0x0000, NULL, len, 175 - HZ * USB_CTRL_GET_TIMEOUT); 181 + USB_CTRL_GET_TIMEOUT); 176 182 dev_dbg(dev, "result = %d\n", result); 177 183 178 184 /* send 2st ctl cmd(CTL 21 22 03 00 00 00 00 00 ) */ ··· 180 186 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 181 187 0x22, 0x21, 182 188 0x0003, 0x0000, NULL, len, 183 - HZ * USB_CTRL_GET_TIMEOUT); 189 + USB_CTRL_GET_TIMEOUT); 184 190 dev_dbg(dev, "result = %d\n", result); 185 191 186 192 /* send 3st cmd and recieve data */ ··· 192 198 result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 193 199 0x21, 0xa1, 194 200 0x0000, 0x0000, buf, len, 195 - HZ * USB_CTRL_GET_TIMEOUT); 201 + USB_CTRL_GET_TIMEOUT); 196 202 debug_data(dev, __func__, len, buf, result); 197 203 198 204 /* send 4 cmd */ ··· 211 217 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 212 218 0x20, 0x21, 213 219 0x0000, 0x0000, buf, len, 214 - HZ * USB_CTRL_GET_TIMEOUT); 220 + USB_CTRL_GET_TIMEOUT); 215 221 debug_data(dev, __func__, len, buf, result); 216 222 217 223 /* send 5 cmd */ ··· 222 228 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 223 229 0x22, 0x21, 224 230 0x0003, 0x0000, NULL, len, 225 - HZ * USB_CTRL_GET_TIMEOUT); 231 + USB_CTRL_GET_TIMEOUT); 226 232 dev_dbg(dev, "result = %d\n", result); 227 233 228 234 /* send 6 cmd */ ··· 234 240 result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 235 241 0x21, 0xa1, 236 242 0x0000, 0x0000, buf, len, 237 - HZ * USB_CTRL_GET_TIMEOUT); 243 + USB_CTRL_GET_TIMEOUT); 238 244 debug_data(dev, __func__, len, buf, result); 239 245 240 246 /* send 7 cmd */ ··· 253 259 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 254 260 0x20, 0x21, 255 261 0x0000, 0x0000, buf, len, 256 - HZ * USB_CTRL_GET_TIMEOUT); 262 + USB_CTRL_GET_TIMEOUT); 257 263 debug_data(dev, __func__, len, buf, result); 258 264 259 265 /* send 8 cmd */ ··· 264 270 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 265 271 0x22, 0x21, 266 272 0x0003, 0x0000, NULL, len, 267 - HZ * USB_CTRL_GET_TIMEOUT); 273 + USB_CTRL_GET_TIMEOUT); 268 274 dev_dbg(dev, "result = %d\n", result); 269 275 270 276 kfree(buf); ··· 273 279 } 274 280 275 281 static const struct usb_device_id id_table[] = { 276 - { USB_DEVICE(0x19d2, 0xffff) }, /* AC8700 */ 277 - { USB_DEVICE(0x19d2, 0xfffe) }, 278 - { USB_DEVICE(0x19d2, 0xfffd) }, /* MG880 */ 282 + /* AC8710, AC8710T */ 283 + { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffff, 0xff, 0xff, 0xff) }, 284 + /* AC8700 */ 285 + { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfffe, 0xff, 0xff, 0xff) }, 286 + /* MG880 */ 287 + { USB_DEVICE(0x19d2, 0xfffd) }, 288 + { USB_DEVICE(0x19d2, 0xfffc) }, 289 + { USB_DEVICE(0x19d2, 0xfffb) }, 290 + /* AC2726, AC8710_V3 */ 291 + { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfff1, 0xff, 0xff, 0xff) }, 292 + { USB_DEVICE(0x19d2, 0xfff6) }, 293 + { USB_DEVICE(0x19d2, 0xfff7) }, 294 + { USB_DEVICE(0x19d2, 0xfff8) }, 295 + { USB_DEVICE(0x19d2, 0xfff9) }, 296 + { USB_DEVICE(0x19d2, 0xffee) }, 297 + /* AC2716, MC2716 */ 298 + { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffed, 0xff, 0xff, 0xff) }, 299 + /* AD3812 */ 300 + { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffeb, 0xff, 0xff, 0xff) }, 301 + { USB_DEVICE(0x19d2, 0xffec) }, 279 302 { USB_DEVICE(0x05C6, 0x3197) }, 280 303 { USB_DEVICE(0x05C6, 0x6000) }, 304 + { USB_DEVICE(0x05C6, 0x9008) }, 281 305 { }, 282 306 }; 283 307 MODULE_DEVICE_TABLE(usb, id_table);
+1 -1
drivers/vfio/vfio.c
··· 1360 1360 */ 1361 1361 static char *vfio_devnode(struct device *dev, umode_t *mode) 1362 1362 { 1363 - if (MINOR(dev->devt) == 0) 1363 + if (mode && (MINOR(dev->devt) == 0)) 1364 1364 *mode = S_IRUGO | S_IWUGO; 1365 1365 1366 1366 return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev));
+2 -2
fs/cifs/connect.c
··· 3279 3279 pos = full_path + unc_len; 3280 3280 3281 3281 if (pplen) { 3282 - *pos++ = CIFS_DIR_SEP(cifs_sb); 3283 - strncpy(pos, vol->prepath, pplen); 3282 + *pos = CIFS_DIR_SEP(cifs_sb); 3283 + strncpy(pos + 1, vol->prepath, pplen); 3284 3284 pos += pplen; 3285 3285 } 3286 3286
+6
fs/ecryptfs/file.c
··· 295 295 static int 296 296 ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync) 297 297 { 298 + int rc; 299 + 300 + rc = filemap_write_and_wait(file->f_mapping); 301 + if (rc) 302 + return rc; 303 + 298 304 return vfs_fsync(ecryptfs_file_to_lower(file), datasync); 299 305 } 300 306
+9 -3
fs/fuse/dir.c
··· 180 180 static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) 181 181 { 182 182 struct inode *inode; 183 + struct dentry *parent; 184 + struct fuse_conn *fc; 183 185 184 186 inode = ACCESS_ONCE(entry->d_inode); 185 187 if (inode && is_bad_inode(inode)) ··· 189 187 else if (fuse_dentry_time(entry) < get_jiffies_64()) { 190 188 int err; 191 189 struct fuse_entry_out outarg; 192 - struct fuse_conn *fc; 193 190 struct fuse_req *req; 194 191 struct fuse_forget_link *forget; 195 - struct dentry *parent; 196 192 u64 attr_version; 197 193 198 194 /* For negative dentries, always do a fresh lookup */ ··· 241 241 entry_attr_timeout(&outarg), 242 242 attr_version); 243 243 fuse_change_entry_timeout(entry, &outarg); 244 + } else if (inode) { 245 + fc = get_fuse_conn(inode); 246 + if (fc->readdirplus_auto) { 247 + parent = dget_parent(entry); 248 + fuse_advise_use_readdirplus(parent->d_inode); 249 + dput(parent); 250 + } 244 251 } 245 - fuse_advise_use_readdirplus(inode); 246 252 return 1; 247 253 } 248 254
+49 -9
fs/fuse/file.c
··· 16 16 #include <linux/compat.h> 17 17 #include <linux/swap.h> 18 18 #include <linux/aio.h> 19 + #include <linux/falloc.h> 19 20 20 21 static const struct file_operations fuse_direct_io_file_operations; 21 22 ··· 1279 1278 1280 1279 iov_iter_init(&ii, iov, nr_segs, count, 0); 1281 1280 1282 - req = fuse_get_req(fc, fuse_iter_npages(&ii)); 1281 + if (io->async) 1282 + req = fuse_get_req_for_background(fc, fuse_iter_npages(&ii)); 1283 + else 1284 + req = fuse_get_req(fc, fuse_iter_npages(&ii)); 1283 1285 if (IS_ERR(req)) 1284 1286 return PTR_ERR(req); 1285 1287 ··· 1318 1314 break; 1319 1315 if (count) { 1320 1316 fuse_put_request(fc, req); 1321 - req = fuse_get_req(fc, fuse_iter_npages(&ii)); 1317 + if (io->async) 1318 + req = fuse_get_req_for_background(fc, 1319 + fuse_iter_npages(&ii)); 1320 + else 1321 + req = fuse_get_req(fc, fuse_iter_npages(&ii)); 1322 1322 if (IS_ERR(req)) 1323 1323 break; 1324 1324 } ··· 2373 2365 fuse_do_setattr(inode, &attr, file); 2374 2366 } 2375 2367 2368 + static inline loff_t fuse_round_up(loff_t off) 2369 + { 2370 + return round_up(off, FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); 2371 + } 2372 + 2376 2373 static ssize_t 2377 2374 fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, 2378 2375 loff_t offset, unsigned long nr_segs) ··· 2385 2372 ssize_t ret = 0; 2386 2373 struct file *file = iocb->ki_filp; 2387 2374 struct fuse_file *ff = file->private_data; 2375 + bool async_dio = ff->fc->async_dio; 2388 2376 loff_t pos = 0; 2389 2377 struct inode *inode; 2390 2378 loff_t i_size; ··· 2397 2383 i_size = i_size_read(inode); 2398 2384 2399 2385 /* optimization for short read */ 2400 - if (rw != WRITE && offset + count > i_size) { 2386 + if (async_dio && rw != WRITE && offset + count > i_size) { 2401 2387 if (offset >= i_size) 2402 2388 return 0; 2403 - count = i_size - offset; 2389 + count = min_t(loff_t, count, fuse_round_up(i_size - offset)); 2404 2390 } 2405 2391 2406 2392 io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL); ··· 2418 2404 * By default, we want to optimize all I/Os with async request 2419 2405 * submission to the client filesystem if supported. 2420 2406 */ 2421 - io->async = ff->fc->async_dio; 2407 + io->async = async_dio; 2422 2408 io->iocb = iocb; 2423 2409 2424 2410 /* ··· 2426 2412 * to wait on real async I/O requests, so we must submit this request 2427 2413 * synchronously. 2428 2414 */ 2429 - if (!is_sync_kiocb(iocb) && (offset + count > i_size)) 2415 + if (!is_sync_kiocb(iocb) && (offset + count > i_size) && rw == WRITE) 2430 2416 io->async = false; 2431 2417 2432 2418 if (rw == WRITE) ··· 2438 2424 fuse_aio_complete(io, ret < 0 ? ret : 0, -1); 2439 2425 2440 2426 /* we have a non-extending, async request, so return */ 2441 - if (ret > 0 && !is_sync_kiocb(iocb)) 2427 + if (!is_sync_kiocb(iocb)) 2442 2428 return -EIOCBQUEUED; 2443 2429 2444 2430 ret = wait_on_sync_kiocb(iocb); ··· 2460 2446 loff_t length) 2461 2447 { 2462 2448 struct fuse_file *ff = file->private_data; 2449 + struct inode *inode = file->f_inode; 2463 2450 struct fuse_conn *fc = ff->fc; 2464 2451 struct fuse_req *req; 2465 2452 struct fuse_fallocate_in inarg = { ··· 2474 2459 if (fc->no_fallocate) 2475 2460 return -EOPNOTSUPP; 2476 2461 2462 + if (mode & FALLOC_FL_PUNCH_HOLE) { 2463 + mutex_lock(&inode->i_mutex); 2464 + fuse_set_nowrite(inode); 2465 + } 2466 + 2477 2467 req = fuse_get_req_nopages(fc); 2478 - if (IS_ERR(req)) 2479 - return PTR_ERR(req); 2468 + if (IS_ERR(req)) { 2469 + err = PTR_ERR(req); 2470 + goto out; 2471 + } 2480 2472 2481 2473 req->in.h.opcode = FUSE_FALLOCATE; 2482 2474 req->in.h.nodeid = ff->nodeid; ··· 2497 2475 err = -EOPNOTSUPP; 2498 2476 } 2499 2477 fuse_put_request(fc, req); 2478 + 2479 + if (err) 2480 + goto out; 2481 + 2482 + /* we could have extended the file */ 2483 + if (!(mode & FALLOC_FL_KEEP_SIZE)) 2484 + fuse_write_update_size(inode, offset + length); 2485 + 2486 + if (mode & FALLOC_FL_PUNCH_HOLE) 2487 + truncate_pagecache_range(inode, offset, offset + length - 1); 2488 + 2489 + fuse_invalidate_attr(inode); 2490 + 2491 + out: 2492 + if (mode & FALLOC_FL_PUNCH_HOLE) { 2493 + fuse_release_nowrite(inode); 2494 + mutex_unlock(&inode->i_mutex); 2495 + } 2500 2496 2501 2497 return err; 2502 2498 }
+4 -3
fs/fuse/inode.c
··· 867 867 fc->dont_mask = 1; 868 868 if (arg->flags & FUSE_AUTO_INVAL_DATA) 869 869 fc->auto_inval_data = 1; 870 - if (arg->flags & FUSE_DO_READDIRPLUS) 870 + if (arg->flags & FUSE_DO_READDIRPLUS) { 871 871 fc->do_readdirplus = 1; 872 - if (arg->flags & FUSE_READDIRPLUS_AUTO) 873 - fc->readdirplus_auto = 1; 872 + if (arg->flags & FUSE_READDIRPLUS_AUTO) 873 + fc->readdirplus_auto = 1; 874 + } 874 875 if (arg->flags & FUSE_ASYNC_DIO) 875 876 fc->async_dio = 1; 876 877 } else {
+13 -4
fs/gfs2/bmap.c
··· 1286 1286 if (ret) 1287 1287 return ret; 1288 1288 1289 + ret = get_write_access(inode); 1290 + if (ret) 1291 + return ret; 1292 + 1289 1293 inode_dio_wait(inode); 1290 1294 1291 1295 ret = gfs2_rs_alloc(GFS2_I(inode)); 1292 1296 if (ret) 1293 - return ret; 1297 + goto out; 1294 1298 1295 1299 oldsize = inode->i_size; 1296 - if (newsize >= oldsize) 1297 - return do_grow(inode, newsize); 1300 + if (newsize >= oldsize) { 1301 + ret = do_grow(inode, newsize); 1302 + goto out; 1303 + } 1298 1304 1299 - return do_shrink(inode, oldsize, newsize); 1305 + ret = do_shrink(inode, oldsize, newsize); 1306 + out: 1307 + put_write_access(inode); 1308 + return ret; 1300 1309 } 1301 1310 1302 1311 int gfs2_truncatei_resume(struct gfs2_inode *ip)
+33 -10
fs/gfs2/dir.c
··· 354 354 return ERR_PTR(-EIO); 355 355 } 356 356 357 - hc = kmalloc(hsize, GFP_NOFS); 358 - ret = -ENOMEM; 357 + hc = kmalloc(hsize, GFP_NOFS | __GFP_NOWARN); 358 + if (hc == NULL) 359 + hc = __vmalloc(hsize, GFP_NOFS, PAGE_KERNEL); 360 + 359 361 if (hc == NULL) 360 362 return ERR_PTR(-ENOMEM); 361 363 362 364 ret = gfs2_dir_read_data(ip, hc, hsize); 363 365 if (ret < 0) { 364 - kfree(hc); 366 + if (is_vmalloc_addr(hc)) 367 + vfree(hc); 368 + else 369 + kfree(hc); 365 370 return ERR_PTR(ret); 366 371 } 367 372 368 373 spin_lock(&inode->i_lock); 369 - if (ip->i_hash_cache) 370 - kfree(hc); 371 - else 374 + if (ip->i_hash_cache) { 375 + if (is_vmalloc_addr(hc)) 376 + vfree(hc); 377 + else 378 + kfree(hc); 379 + } else { 372 380 ip->i_hash_cache = hc; 381 + } 373 382 spin_unlock(&inode->i_lock); 374 383 375 384 return ip->i_hash_cache; ··· 394 385 { 395 386 __be64 *hc = ip->i_hash_cache; 396 387 ip->i_hash_cache = NULL; 397 - kfree(hc); 388 + if (is_vmalloc_addr(hc)) 389 + vfree(hc); 390 + else 391 + kfree(hc); 398 392 } 399 393 400 394 static inline int gfs2_dirent_sentinel(const struct gfs2_dirent *dent) ··· 1125 1113 if (IS_ERR(hc)) 1126 1114 return PTR_ERR(hc); 1127 1115 1128 - h = hc2 = kmalloc(hsize_bytes * 2, GFP_NOFS); 1116 + h = hc2 = kmalloc(hsize_bytes * 2, GFP_NOFS | __GFP_NOWARN); 1117 + if (hc2 == NULL) 1118 + hc2 = __vmalloc(hsize_bytes * 2, GFP_NOFS, PAGE_KERNEL); 1119 + 1129 1120 if (!hc2) 1130 1121 return -ENOMEM; 1131 1122 ··· 1160 1145 gfs2_dinode_out(dip, dibh->b_data); 1161 1146 brelse(dibh); 1162 1147 out_kfree: 1163 - kfree(hc2); 1148 + if (is_vmalloc_addr(hc2)) 1149 + vfree(hc2); 1150 + else 1151 + kfree(hc2); 1164 1152 return error; 1165 1153 } 1166 1154 ··· 1864 1846 memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); 1865 1847 1866 1848 ht = kzalloc(size, GFP_NOFS); 1849 + if (ht == NULL) 1850 + ht = vzalloc(size); 1867 1851 if (!ht) 1868 1852 return -ENOMEM; 1869 1853 ··· 1953 1933 gfs2_rlist_free(&rlist); 1954 1934 gfs2_quota_unhold(dip); 1955 1935 out: 1956 - kfree(ht); 1936 + if (is_vmalloc_addr(ht)) 1937 + vfree(ht); 1938 + else 1939 + kfree(ht); 1957 1940 return error; 1958 1941 } 1959 1942
+13 -6
fs/gfs2/file.c
··· 402 402 /* Update file times before taking page lock */ 403 403 file_update_time(vma->vm_file); 404 404 405 + ret = get_write_access(inode); 406 + if (ret) 407 + goto out; 408 + 405 409 ret = gfs2_rs_alloc(ip); 406 410 if (ret) 407 - return ret; 411 + goto out_write_access; 408 412 409 413 gfs2_size_hint(vma->vm_file, pos, PAGE_CACHE_SIZE); 410 414 411 415 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 412 416 ret = gfs2_glock_nq(&gh); 413 417 if (ret) 414 - goto out; 418 + goto out_uninit; 415 419 416 420 set_bit(GLF_DIRTY, &ip->i_gl->gl_flags); 417 421 set_bit(GIF_SW_PAGED, &ip->i_flags); ··· 484 480 gfs2_quota_unlock(ip); 485 481 out_unlock: 486 482 gfs2_glock_dq(&gh); 487 - out: 483 + out_uninit: 488 484 gfs2_holder_uninit(&gh); 489 485 if (ret == 0) { 490 486 set_page_dirty(page); 491 487 wait_for_stable_page(page); 492 488 } 489 + out_write_access: 490 + put_write_access(inode); 491 + out: 493 492 sb_end_pagefault(inode->i_sb); 494 493 return block_page_mkwrite_return(ret); 495 494 } ··· 601 594 kfree(file->private_data); 602 595 file->private_data = NULL; 603 596 604 - if ((file->f_mode & FMODE_WRITE) && 605 - (atomic_read(&inode->i_writecount) == 1)) 606 - gfs2_rs_delete(ip); 597 + if (!(file->f_mode & FMODE_WRITE)) 598 + return 0; 607 599 600 + gfs2_rs_delete(ip); 608 601 return 0; 609 602 } 610 603
+1
fs/gfs2/inode.c
··· 189 189 return inode; 190 190 191 191 fail_refresh: 192 + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; 192 193 ip->i_iopen_gh.gh_gl->gl_object = NULL; 193 194 gfs2_glock_dq_uninit(&ip->i_iopen_gh); 194 195 fail_iopen:
+3 -1
fs/gfs2/lops.c
··· 419 419 if (total > limit) 420 420 num = limit; 421 421 gfs2_log_unlock(sdp); 422 - page = gfs2_get_log_desc(sdp, GFS2_LOG_DESC_METADATA, num + 1, num); 422 + page = gfs2_get_log_desc(sdp, 423 + is_databuf ? GFS2_LOG_DESC_JDATA : 424 + GFS2_LOG_DESC_METADATA, num + 1, num); 423 425 ld = page_address(page); 424 426 gfs2_log_lock(sdp); 425 427 ptr = (__be64 *)(ld + 1);
+3 -1
fs/gfs2/rgrp.c
··· 638 638 */ 639 639 void gfs2_rs_delete(struct gfs2_inode *ip) 640 640 { 641 + struct inode *inode = &ip->i_inode; 642 + 641 643 down_write(&ip->i_rw_mutex); 642 - if (ip->i_res) { 644 + if (ip->i_res && atomic_read(&inode->i_writecount) <= 1) { 643 645 gfs2_rs_deltree(ip->i_res); 644 646 BUG_ON(ip->i_res->rs_free); 645 647 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res);
+5 -1
fs/gfs2/super.c
··· 1444 1444 /* Must not read inode block until block type has been verified */ 1445 1445 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh); 1446 1446 if (unlikely(error)) { 1447 + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; 1447 1448 gfs2_glock_dq_uninit(&ip->i_iopen_gh); 1448 1449 goto out; 1449 1450 } ··· 1515 1514 if (gfs2_rs_active(ip->i_res)) 1516 1515 gfs2_rs_deltree(ip->i_res); 1517 1516 1518 - if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) 1517 + if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) { 1518 + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; 1519 1519 gfs2_glock_dq(&ip->i_iopen_gh); 1520 + } 1520 1521 gfs2_holder_uninit(&ip->i_iopen_gh); 1521 1522 gfs2_glock_dq_uninit(&gh); 1522 1523 if (error && error != GLR_TRYFAILED && error != -EROFS) ··· 1537 1534 ip->i_gl = NULL; 1538 1535 if (ip->i_iopen_gh.gh_gl) { 1539 1536 ip->i_iopen_gh.gh_gl->gl_object = NULL; 1537 + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; 1540 1538 gfs2_glock_dq_uninit(&ip->i_iopen_gh); 1541 1539 } 1542 1540 }
+4
fs/hpfs/file.c
··· 109 109 { 110 110 struct inode *inode = mapping->host; 111 111 112 + hpfs_lock(inode->i_sb); 113 + 112 114 if (to > inode->i_size) { 113 115 truncate_pagecache(inode, to, inode->i_size); 114 116 hpfs_truncate(inode); 115 117 } 118 + 119 + hpfs_unlock(inode->i_sb); 116 120 } 117 121 118 122 static int hpfs_write_begin(struct file *file, struct address_space *mapping,
+7 -1
fs/jfs/jfs_logmgr.c
··· 2009 2009 2010 2010 bio->bi_end_io = lbmIODone; 2011 2011 bio->bi_private = bp; 2012 - submit_bio(READ_SYNC, bio); 2012 + /*check if journaling to disk has been disabled*/ 2013 + if (log->no_integrity) { 2014 + bio->bi_size = 0; 2015 + lbmIODone(bio, 0); 2016 + } else { 2017 + submit_bio(READ_SYNC, bio); 2018 + } 2013 2019 2014 2020 wait_event(bp->l_ioevent, (bp->l_flag != lbmREAD)); 2015 2021
+30 -8
fs/jfs/super.c
··· 611 611 { 612 612 struct jfs_sb_info *sbi = JFS_SBI(sb); 613 613 struct jfs_log *log = sbi->log; 614 + int rc = 0; 614 615 615 616 if (!(sb->s_flags & MS_RDONLY)) { 616 617 txQuiesce(sb); 617 - lmLogShutdown(log); 618 - updateSuper(sb, FM_CLEAN); 618 + rc = lmLogShutdown(log); 619 + if (rc) { 620 + jfs_error(sb, "jfs_freeze: lmLogShutdown failed"); 621 + 622 + /* let operations fail rather than hang */ 623 + txResume(sb); 624 + 625 + return rc; 626 + } 627 + rc = updateSuper(sb, FM_CLEAN); 628 + if (rc) { 629 + jfs_err("jfs_freeze: updateSuper failed\n"); 630 + /* 631 + * Don't fail here. Everything succeeded except 632 + * marking the superblock clean, so there's really 633 + * no harm in leaving it frozen for now. 634 + */ 635 + } 619 636 } 620 637 return 0; 621 638 } ··· 644 627 int rc = 0; 645 628 646 629 if (!(sb->s_flags & MS_RDONLY)) { 647 - updateSuper(sb, FM_MOUNT); 648 - if ((rc = lmLogInit(log))) 649 - jfs_err("jfs_unlock failed with return code %d", rc); 650 - else 651 - txResume(sb); 630 + rc = updateSuper(sb, FM_MOUNT); 631 + if (rc) { 632 + jfs_error(sb, "jfs_unfreeze: updateSuper failed"); 633 + goto out; 634 + } 635 + rc = lmLogInit(log); 636 + if (rc) 637 + jfs_error(sb, "jfs_unfreeze: lmLogInit failed"); 638 + out: 639 + txResume(sb); 652 640 } 653 - return 0; 641 + return rc; 654 642 } 655 643 656 644 static struct dentry *jfs_do_mount(struct file_system_type *fs_type,
+1
fs/proc/base.c
··· 2118 2118 nstr[notify & ~SIGEV_THREAD_ID], 2119 2119 (notify & SIGEV_THREAD_ID) ? "tid" : "pid", 2120 2120 pid_nr_ns(timer->it_pid, tp->ns)); 2121 + seq_printf(m, "ClockID: %d\n", timer->it_clock); 2121 2122 2122 2123 return 0; 2123 2124 }
+18 -13
fs/xfs/xfs_acl.c
··· 21 21 #include "xfs_bmap_btree.h" 22 22 #include "xfs_inode.h" 23 23 #include "xfs_vnodeops.h" 24 + #include "xfs_sb.h" 25 + #include "xfs_mount.h" 24 26 #include "xfs_trace.h" 25 27 #include <linux/slab.h> 26 28 #include <linux/xattr.h> ··· 36 34 */ 37 35 38 36 STATIC struct posix_acl * 39 - xfs_acl_from_disk(struct xfs_acl *aclp) 37 + xfs_acl_from_disk( 38 + struct xfs_acl *aclp, 39 + int max_entries) 40 40 { 41 41 struct posix_acl_entry *acl_e; 42 42 struct posix_acl *acl; ··· 46 42 unsigned int count, i; 47 43 48 44 count = be32_to_cpu(aclp->acl_cnt); 49 - if (count > XFS_ACL_MAX_ENTRIES) 45 + if (count > max_entries) 50 46 return ERR_PTR(-EFSCORRUPTED); 51 47 52 48 acl = posix_acl_alloc(count, GFP_KERNEL); ··· 112 108 struct xfs_inode *ip = XFS_I(inode); 113 109 struct posix_acl *acl; 114 110 struct xfs_acl *xfs_acl; 115 - int len = sizeof(struct xfs_acl); 116 111 unsigned char *ea_name; 117 112 int error; 113 + int len; 118 114 119 115 acl = get_cached_acl(inode, type); 120 116 if (acl != ACL_NOT_CACHED) ··· 137 133 * If we have a cached ACLs value just return it, not need to 138 134 * go out to the disk. 139 135 */ 140 - 141 - xfs_acl = kzalloc(sizeof(struct xfs_acl), GFP_KERNEL); 136 + len = XFS_ACL_MAX_SIZE(ip->i_mount); 137 + xfs_acl = kzalloc(len, GFP_KERNEL); 142 138 if (!xfs_acl) 143 139 return ERR_PTR(-ENOMEM); 144 140 ··· 157 153 goto out; 158 154 } 159 155 160 - acl = xfs_acl_from_disk(xfs_acl); 156 + acl = xfs_acl_from_disk(xfs_acl, XFS_ACL_MAX_ENTRIES(ip->i_mount)); 161 157 if (IS_ERR(acl)) 162 158 goto out; 163 159 ··· 193 189 194 190 if (acl) { 195 191 struct xfs_acl *xfs_acl; 196 - int len; 192 + int len = XFS_ACL_MAX_SIZE(ip->i_mount); 197 193 198 - xfs_acl = kzalloc(sizeof(struct xfs_acl), GFP_KERNEL); 194 + xfs_acl = kzalloc(len, GFP_KERNEL); 199 195 if (!xfs_acl) 200 196 return -ENOMEM; 201 197 202 198 xfs_acl_to_disk(xfs_acl, acl); 203 - len = sizeof(struct xfs_acl) - 204 - (sizeof(struct xfs_acl_entry) * 205 - (XFS_ACL_MAX_ENTRIES - acl->a_count)); 199 + 200 + /* subtract away the unused acl entries */ 201 + len -= sizeof(struct xfs_acl_entry) * 202 + (XFS_ACL_MAX_ENTRIES(ip->i_mount) - acl->a_count); 206 203 207 204 error = -xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl, 208 205 len, ATTR_ROOT); ··· 248 243 static int 249 244 xfs_acl_exists(struct inode *inode, unsigned char *name) 250 245 { 251 - int len = sizeof(struct xfs_acl); 246 + int len = XFS_ACL_MAX_SIZE(XFS_M(inode->i_sb)); 252 247 253 248 return (xfs_attr_get(XFS_I(inode), name, NULL, &len, 254 249 ATTR_ROOT|ATTR_KERNOVAL) == 0); ··· 384 379 goto out_release; 385 380 386 381 error = -EINVAL; 387 - if (acl->a_count > XFS_ACL_MAX_ENTRIES) 382 + if (acl->a_count > XFS_ACL_MAX_ENTRIES(XFS_M(inode->i_sb))) 388 383 goto out_release; 389 384 390 385 if (type == ACL_TYPE_ACCESS) {
+25 -8
fs/xfs/xfs_acl.h
··· 22 22 struct posix_acl; 23 23 struct xfs_inode; 24 24 25 - #define XFS_ACL_MAX_ENTRIES 25 26 25 #define XFS_ACL_NOT_PRESENT (-1) 27 26 28 27 /* On-disk XFS access control list structure */ 29 - struct xfs_acl { 30 - __be32 acl_cnt; 31 - struct xfs_acl_entry { 32 - __be32 ae_tag; 33 - __be32 ae_id; 34 - __be16 ae_perm; 35 - } acl_entry[XFS_ACL_MAX_ENTRIES]; 28 + struct xfs_acl_entry { 29 + __be32 ae_tag; 30 + __be32 ae_id; 31 + __be16 ae_perm; 32 + __be16 ae_pad; /* fill the implicit hole in the structure */ 36 33 }; 34 + 35 + struct xfs_acl { 36 + __be32 acl_cnt; 37 + struct xfs_acl_entry acl_entry[0]; 38 + }; 39 + 40 + /* 41 + * The number of ACL entries allowed is defined by the on-disk format. 42 + * For v4 superblocks, that is limited to 25 entries. For v5 superblocks, it is 43 + * limited only by the maximum size of the xattr that stores the information. 44 + */ 45 + #define XFS_ACL_MAX_ENTRIES(mp) \ 46 + (xfs_sb_version_hascrc(&mp->m_sb) \ 47 + ? (XATTR_SIZE_MAX - sizeof(struct xfs_acl)) / \ 48 + sizeof(struct xfs_acl_entry) \ 49 + : 25) 50 + 51 + #define XFS_ACL_MAX_SIZE(mp) \ 52 + (sizeof(struct xfs_acl) + \ 53 + sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp))) 37 54 38 55 /* On-disk XFS extended attribute names */ 39 56 #define SGI_ACL_FILE (unsigned char *)"SGI_ACL_FILE"
+1 -1
fs/xfs/xfs_attr_leaf.c
··· 3258 3258 name_rmt = xfs_attr3_leaf_name_remote(leaf, i); 3259 3259 if (name_rmt->valueblk) { 3260 3260 lp->valueblk = be32_to_cpu(name_rmt->valueblk); 3261 - lp->valuelen = XFS_B_TO_FSB(dp->i_mount, 3261 + lp->valuelen = xfs_attr3_rmt_blocks(dp->i_mount, 3262 3262 be32_to_cpu(name_rmt->valuelen)); 3263 3263 lp++; 3264 3264 }
+16 -21
fs/xfs/xfs_dquot.c
··· 249 249 d->dd_diskdq.d_version = XFS_DQUOT_VERSION; 250 250 d->dd_diskdq.d_id = cpu_to_be32(curid); 251 251 d->dd_diskdq.d_flags = type; 252 - if (xfs_sb_version_hascrc(&mp->m_sb)) 252 + if (xfs_sb_version_hascrc(&mp->m_sb)) { 253 253 uuid_copy(&d->dd_uuid, &mp->m_sb.sb_uuid); 254 + xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk), 255 + XFS_DQUOT_CRC_OFF); 256 + } 254 257 } 255 258 256 259 xfs_trans_dquot_buf(tp, bp, ··· 289 286 dqp->q_low_space[XFS_QLOWSP_5_PCNT] = space * 5; 290 287 } 291 288 292 - STATIC void 293 - xfs_dquot_buf_calc_crc( 294 - struct xfs_mount *mp, 295 - struct xfs_buf *bp) 296 - { 297 - struct xfs_dqblk *d = (struct xfs_dqblk *)bp->b_addr; 298 - int i; 299 - 300 - if (!xfs_sb_version_hascrc(&mp->m_sb)) 301 - return; 302 - 303 - for (i = 0; i < mp->m_quotainfo->qi_dqperchunk; i++, d++) { 304 - xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk), 305 - offsetof(struct xfs_dqblk, dd_crc)); 306 - } 307 - } 308 - 309 289 STATIC bool 310 290 xfs_dquot_buf_verify_crc( 311 291 struct xfs_mount *mp, ··· 314 328 315 329 for (i = 0; i < ndquots; i++, d++) { 316 330 if (!xfs_verify_cksum((char *)d, sizeof(struct xfs_dqblk), 317 - offsetof(struct xfs_dqblk, dd_crc))) 331 + XFS_DQUOT_CRC_OFF)) 318 332 return false; 319 333 if (!uuid_equal(&d->dd_uuid, &mp->m_sb.sb_uuid)) 320 334 return false; 321 335 } 322 - 323 336 return true; 324 337 } 325 338 ··· 378 393 } 379 394 } 380 395 396 + /* 397 + * we don't calculate the CRC here as that is done when the dquot is flushed to 398 + * the buffer after the update is done. This ensures that the dquot in the 399 + * buffer always has an up-to-date CRC value. 400 + */ 381 401 void 382 402 xfs_dquot_buf_write_verify( 383 403 struct xfs_buf *bp) ··· 394 404 xfs_buf_ioerror(bp, EFSCORRUPTED); 395 405 return; 396 406 } 397 - xfs_dquot_buf_calc_crc(mp, bp); 398 407 } 399 408 400 409 const struct xfs_buf_ops xfs_dquot_buf_ops = { ··· 1140 1151 * copy the lsn into the on-disk dquot now while we have the in memory 1141 1152 * dquot here. This can't be done later in the write verifier as we 1142 1153 * can't get access to the log item at that point in time. 1154 + * 1155 + * We also calculate the CRC here so that the on-disk dquot in the 1156 + * buffer always has a valid CRC. This ensures there is no possibility 1157 + * of a dquot without an up-to-date CRC getting to disk. 1143 1158 */ 1144 1159 if (xfs_sb_version_hascrc(&mp->m_sb)) { 1145 1160 struct xfs_dqblk *dqb = (struct xfs_dqblk *)ddqp; 1146 1161 1147 1162 dqb->dd_lsn = cpu_to_be64(dqp->q_logitem.qli_item.li_lsn); 1163 + xfs_update_cksum((char *)dqb, sizeof(struct xfs_dqblk), 1164 + XFS_DQUOT_CRC_OFF); 1148 1165 } 1149 1166 1150 1167 /*
+16
fs/xfs/xfs_inode.c
··· 1638 1638 dip->di_next_unlinked = agi->agi_unlinked[bucket_index]; 1639 1639 offset = ip->i_imap.im_boffset + 1640 1640 offsetof(xfs_dinode_t, di_next_unlinked); 1641 + 1642 + /* need to recalc the inode CRC if appropriate */ 1643 + xfs_dinode_calc_crc(mp, dip); 1644 + 1641 1645 xfs_trans_inode_buf(tp, ibp); 1642 1646 xfs_trans_log_buf(tp, ibp, offset, 1643 1647 (offset + sizeof(xfs_agino_t) - 1)); ··· 1727 1723 dip->di_next_unlinked = cpu_to_be32(NULLAGINO); 1728 1724 offset = ip->i_imap.im_boffset + 1729 1725 offsetof(xfs_dinode_t, di_next_unlinked); 1726 + 1727 + /* need to recalc the inode CRC if appropriate */ 1728 + xfs_dinode_calc_crc(mp, dip); 1729 + 1730 1730 xfs_trans_inode_buf(tp, ibp); 1731 1731 xfs_trans_log_buf(tp, ibp, offset, 1732 1732 (offset + sizeof(xfs_agino_t) - 1)); ··· 1804 1796 dip->di_next_unlinked = cpu_to_be32(NULLAGINO); 1805 1797 offset = ip->i_imap.im_boffset + 1806 1798 offsetof(xfs_dinode_t, di_next_unlinked); 1799 + 1800 + /* need to recalc the inode CRC if appropriate */ 1801 + xfs_dinode_calc_crc(mp, dip); 1802 + 1807 1803 xfs_trans_inode_buf(tp, ibp); 1808 1804 xfs_trans_log_buf(tp, ibp, offset, 1809 1805 (offset + sizeof(xfs_agino_t) - 1)); ··· 1821 1809 last_dip->di_next_unlinked = cpu_to_be32(next_agino); 1822 1810 ASSERT(next_agino != 0); 1823 1811 offset = last_offset + offsetof(xfs_dinode_t, di_next_unlinked); 1812 + 1813 + /* need to recalc the inode CRC if appropriate */ 1814 + xfs_dinode_calc_crc(mp, last_dip); 1815 + 1824 1816 xfs_trans_inode_buf(tp, last_ibp); 1825 1817 xfs_trans_log_buf(tp, last_ibp, offset, 1826 1818 (offset + sizeof(xfs_agino_t) - 1));
+77 -7
fs/xfs/xfs_log_recover.c
··· 1599 1599 } 1600 1600 1601 1601 /* 1602 - * Sort the log items in the transaction. Cancelled buffers need 1603 - * to be put first so they are processed before any items that might 1604 - * modify the buffers. If they are cancelled, then the modifications 1605 - * don't need to be replayed. 1602 + * Sort the log items in the transaction. 1603 + * 1604 + * The ordering constraints are defined by the inode allocation and unlink 1605 + * behaviour. The rules are: 1606 + * 1607 + * 1. Every item is only logged once in a given transaction. Hence it 1608 + * represents the last logged state of the item. Hence ordering is 1609 + * dependent on the order in which operations need to be performed so 1610 + * required initial conditions are always met. 1611 + * 1612 + * 2. Cancelled buffers are recorded in pass 1 in a separate table and 1613 + * there's nothing to replay from them so we can simply cull them 1614 + * from the transaction. However, we can't do that until after we've 1615 + * replayed all the other items because they may be dependent on the 1616 + * cancelled buffer and replaying the cancelled buffer can remove it 1617 + * form the cancelled buffer table. Hence they have tobe done last. 1618 + * 1619 + * 3. Inode allocation buffers must be replayed before inode items that 1620 + * read the buffer and replay changes into it. 1621 + * 1622 + * 4. Inode unlink buffers must be replayed after inode items are replayed. 1623 + * This ensures that inodes are completely flushed to the inode buffer 1624 + * in a "free" state before we remove the unlinked inode list pointer. 1625 + * 1626 + * Hence the ordering needs to be inode allocation buffers first, inode items 1627 + * second, inode unlink buffers third and cancelled buffers last. 1628 + * 1629 + * But there's a problem with that - we can't tell an inode allocation buffer 1630 + * apart from a regular buffer, so we can't separate them. We can, however, 1631 + * tell an inode unlink buffer from the others, and so we can separate them out 1632 + * from all the other buffers and move them to last. 1633 + * 1634 + * Hence, 4 lists, in order from head to tail: 1635 + * - buffer_list for all buffers except cancelled/inode unlink buffers 1636 + * - item_list for all non-buffer items 1637 + * - inode_buffer_list for inode unlink buffers 1638 + * - cancel_list for the cancelled buffers 1606 1639 */ 1607 1640 STATIC int 1608 1641 xlog_recover_reorder_trans( ··· 1645 1612 { 1646 1613 xlog_recover_item_t *item, *n; 1647 1614 LIST_HEAD(sort_list); 1615 + LIST_HEAD(cancel_list); 1616 + LIST_HEAD(buffer_list); 1617 + LIST_HEAD(inode_buffer_list); 1618 + LIST_HEAD(inode_list); 1648 1619 1649 1620 list_splice_init(&trans->r_itemq, &sort_list); 1650 1621 list_for_each_entry_safe(item, n, &sort_list, ri_list) { ··· 1656 1619 1657 1620 switch (ITEM_TYPE(item)) { 1658 1621 case XFS_LI_BUF: 1659 - if (!(buf_f->blf_flags & XFS_BLF_CANCEL)) { 1622 + if (buf_f->blf_flags & XFS_BLF_CANCEL) { 1660 1623 trace_xfs_log_recover_item_reorder_head(log, 1661 1624 trans, item, pass); 1662 - list_move(&item->ri_list, &trans->r_itemq); 1625 + list_move(&item->ri_list, &cancel_list); 1663 1626 break; 1664 1627 } 1628 + if (buf_f->blf_flags & XFS_BLF_INODE_BUF) { 1629 + list_move(&item->ri_list, &inode_buffer_list); 1630 + break; 1631 + } 1632 + list_move_tail(&item->ri_list, &buffer_list); 1633 + break; 1665 1634 case XFS_LI_INODE: 1666 1635 case XFS_LI_DQUOT: 1667 1636 case XFS_LI_QUOTAOFF: ··· 1675 1632 case XFS_LI_EFI: 1676 1633 trace_xfs_log_recover_item_reorder_tail(log, 1677 1634 trans, item, pass); 1678 - list_move_tail(&item->ri_list, &trans->r_itemq); 1635 + list_move_tail(&item->ri_list, &inode_list); 1679 1636 break; 1680 1637 default: 1681 1638 xfs_warn(log->l_mp, ··· 1686 1643 } 1687 1644 } 1688 1645 ASSERT(list_empty(&sort_list)); 1646 + if (!list_empty(&buffer_list)) 1647 + list_splice(&buffer_list, &trans->r_itemq); 1648 + if (!list_empty(&inode_list)) 1649 + list_splice_tail(&inode_list, &trans->r_itemq); 1650 + if (!list_empty(&inode_buffer_list)) 1651 + list_splice_tail(&inode_buffer_list, &trans->r_itemq); 1652 + if (!list_empty(&cancel_list)) 1653 + list_splice_tail(&cancel_list, &trans->r_itemq); 1689 1654 return 0; 1690 1655 } 1691 1656 ··· 1912 1861 buffer_nextp = (xfs_agino_t *)xfs_buf_offset(bp, 1913 1862 next_unlinked_offset); 1914 1863 *buffer_nextp = *logged_nextp; 1864 + 1865 + /* 1866 + * If necessary, recalculate the CRC in the on-disk inode. We 1867 + * have to leave the inode in a consistent state for whoever 1868 + * reads it next.... 1869 + */ 1870 + xfs_dinode_calc_crc(mp, (struct xfs_dinode *) 1871 + xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize)); 1872 + 1915 1873 } 1916 1874 1917 1875 return 0; ··· 2325 2265 d->dd_diskdq.d_version = XFS_DQUOT_VERSION; 2326 2266 d->dd_diskdq.d_flags = type; 2327 2267 d->dd_diskdq.d_id = cpu_to_be32(id); 2268 + 2269 + if (xfs_sb_version_hascrc(&mp->m_sb)) { 2270 + uuid_copy(&d->dd_uuid, &mp->m_sb.sb_uuid); 2271 + xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk), 2272 + XFS_DQUOT_CRC_OFF); 2273 + } 2328 2274 2329 2275 return errs; 2330 2276 } ··· 2859 2793 } 2860 2794 2861 2795 memcpy(ddq, recddq, item->ri_buf[1].i_len); 2796 + if (xfs_sb_version_hascrc(&mp->m_sb)) { 2797 + xfs_update_cksum((char *)ddq, sizeof(struct xfs_dqblk), 2798 + XFS_DQUOT_CRC_OFF); 2799 + } 2862 2800 2863 2801 ASSERT(dq_f->qlf_size == 2); 2864 2802 ASSERT(bp->b_target->bt_mount == mp);
+30 -10
fs/xfs/xfs_qm.c
··· 41 41 #include "xfs_qm.h" 42 42 #include "xfs_trace.h" 43 43 #include "xfs_icache.h" 44 + #include "xfs_cksum.h" 44 45 45 46 /* 46 47 * The global quota manager. There is only one of these for the entire ··· 840 839 xfs_dqid_t id, 841 840 uint type) 842 841 { 843 - xfs_disk_dquot_t *ddq; 842 + struct xfs_dqblk *dqb; 844 843 int j; 845 844 846 845 trace_xfs_reset_dqcounts(bp, _RET_IP_); ··· 854 853 do_div(j, sizeof(xfs_dqblk_t)); 855 854 ASSERT(mp->m_quotainfo->qi_dqperchunk == j); 856 855 #endif 857 - ddq = bp->b_addr; 856 + dqb = bp->b_addr; 858 857 for (j = 0; j < mp->m_quotainfo->qi_dqperchunk; j++) { 858 + struct xfs_disk_dquot *ddq; 859 + 860 + ddq = (struct xfs_disk_dquot *)&dqb[j]; 861 + 859 862 /* 860 863 * Do a sanity check, and if needed, repair the dqblk. Don't 861 864 * output any warnings because it's perfectly possible to ··· 876 871 ddq->d_bwarns = 0; 877 872 ddq->d_iwarns = 0; 878 873 ddq->d_rtbwarns = 0; 879 - ddq = (xfs_disk_dquot_t *) ((xfs_dqblk_t *)ddq + 1); 874 + 875 + if (xfs_sb_version_hascrc(&mp->m_sb)) { 876 + xfs_update_cksum((char *)&dqb[j], 877 + sizeof(struct xfs_dqblk), 878 + XFS_DQUOT_CRC_OFF); 879 + } 880 880 } 881 881 } 882 882 ··· 917 907 XFS_FSB_TO_DADDR(mp, bno), 918 908 mp->m_quotainfo->qi_dqchunklen, 0, &bp, 919 909 &xfs_dquot_buf_ops); 910 + 911 + /* 912 + * CRC and validation errors will return a EFSCORRUPTED here. If 913 + * this occurs, re-read without CRC validation so that we can 914 + * repair the damage via xfs_qm_reset_dqcounts(). This process 915 + * will leave a trace in the log indicating corruption has 916 + * been detected. 917 + */ 918 + if (error == EFSCORRUPTED) { 919 + error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, 920 + XFS_FSB_TO_DADDR(mp, bno), 921 + mp->m_quotainfo->qi_dqchunklen, 0, &bp, 922 + NULL); 923 + } 924 + 920 925 if (error) 921 926 break; 922 927 923 - /* 924 - * XXX(hch): need to figure out if it makes sense to validate 925 - * the CRC here. 926 - */ 927 928 xfs_qm_reset_dqcounts(mp, bp, firstid, type); 928 929 xfs_buf_delwri_queue(bp, buffer_list); 929 930 xfs_buf_relse(bp); 930 - /* 931 - * goto the next block. 932 - */ 931 + 932 + /* goto the next block. */ 933 933 bno++; 934 934 firstid += mp->m_quotainfo->qi_dqperchunk; 935 935 }
+2
fs/xfs/xfs_quota.h
··· 87 87 uuid_t dd_uuid; /* location information */ 88 88 } xfs_dqblk_t; 89 89 90 + #define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc) 91 + 90 92 /* 91 93 * flags for q_flags field in the dquot. 92 94 */
+11
fs/xfs/xfs_super.c
··· 1373 1373 } 1374 1374 1375 1375 /* 1376 + * V5 filesystems always use attr2 format for attributes. 1377 + */ 1378 + if (xfs_sb_version_hascrc(&mp->m_sb) && 1379 + (mp->m_flags & XFS_MOUNT_NOATTR2)) { 1380 + xfs_warn(mp, 1381 + "Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.", 1382 + MNTOPT_NOATTR2, MNTOPT_ATTR2); 1383 + return XFS_ERROR(EINVAL); 1384 + } 1385 + 1386 + /* 1376 1387 * mkfs'ed attr2 will turn on attr2 mount unless explicitly 1377 1388 * told by noattr2 to turn it off 1378 1389 */
+4
include/asm-generic/io.h
··· 343 343 #endif /* CONFIG_GENERIC_IOMAP */ 344 344 #endif /* CONFIG_HAS_IOPORT */ 345 345 346 + #ifndef xlate_dev_kmem_ptr 346 347 #define xlate_dev_kmem_ptr(p) p 348 + #endif 349 + #ifndef xlate_dev_mem_ptr 347 350 #define xlate_dev_mem_ptr(p) __va(p) 351 + #endif 348 352 349 353 #ifdef CONFIG_VIRT_TO_BUS 350 354 #ifndef virt_to_bus
+1 -16
include/asm-generic/tlb.h
··· 97 97 unsigned long start; 98 98 unsigned long end; 99 99 unsigned int need_flush : 1, /* Did free PTEs */ 100 - fast_mode : 1; /* No batching */ 101 - 102 100 /* we are in the middle of an operation to clear 103 101 * a full mm and can make some optimizations */ 104 - unsigned int fullmm : 1, 102 + fullmm : 1, 105 103 /* we have performed an operation which 106 104 * requires a complete flush of the tlb */ 107 105 need_flush_all : 1; ··· 111 113 }; 112 114 113 115 #define HAVE_GENERIC_MMU_GATHER 114 - 115 - static inline int tlb_fast_mode(struct mmu_gather *tlb) 116 - { 117 - #ifdef CONFIG_SMP 118 - return tlb->fast_mode; 119 - #else 120 - /* 121 - * For UP we don't need to worry about TLB flush 122 - * and page free order so much.. 123 - */ 124 - return 1; 125 - #endif 126 - } 127 116 128 117 void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm); 129 118 void tlb_flush_mmu(struct mmu_gather *tlb);
+1 -1
include/linux/cgroup.h
··· 707 707 * 708 708 * If a subsystem synchronizes against the parent in its ->css_online() and 709 709 * before starting iterating, and synchronizes against @pos on each 710 - * iteration, any descendant cgroup which finished ->css_offline() is 710 + * iteration, any descendant cgroup which finished ->css_online() is 711 711 * guaranteed to be visible in the future iterations. 712 712 * 713 713 * In other words, the following guarantees that a descendant can't escape
+11
include/linux/list.h
··· 362 362 list_entry((ptr)->next, type, member) 363 363 364 364 /** 365 + * list_first_entry_or_null - get the first element from a list 366 + * @ptr: the list head to take the element from. 367 + * @type: the type of the struct this is embedded in. 368 + * @member: the name of the list_struct within the struct. 369 + * 370 + * Note that if the list is empty, it returns NULL. 371 + */ 372 + #define list_first_entry_or_null(ptr, type, member) \ 373 + (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) 374 + 375 + /** 365 376 * list_for_each - iterate over a list 366 377 * @pos: the &struct list_head to use as a loop cursor. 367 378 * @head: the head for your list.
+16
include/linux/netfilter_ipv6.h
··· 17 17 18 18 extern int ipv6_netfilter_init(void); 19 19 extern void ipv6_netfilter_fini(void); 20 + 21 + /* 22 + * Hook functions for ipv6 to allow xt_* modules to be built-in even 23 + * if IPv6 is a module. 24 + */ 25 + struct nf_ipv6_ops { 26 + int (*chk_addr)(struct net *net, const struct in6_addr *addr, 27 + const struct net_device *dev, int strict); 28 + }; 29 + 30 + extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops; 31 + static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) 32 + { 33 + return rcu_dereference(nf_ipv6_ops); 34 + } 35 + 20 36 #else /* CONFIG_NETFILTER */ 21 37 static inline int ipv6_netfilter_init(void) { return 0; } 22 38 static inline void ipv6_netfilter_fini(void) { return; }
+20
include/linux/rculist.h
··· 461 461 &(pos)->member)), typeof(*(pos)), member)) 462 462 463 463 /** 464 + * hlist_for_each_entry_rcu_notrace - iterate over rcu list of given type (for tracing) 465 + * @pos: the type * to use as a loop cursor. 466 + * @head: the head for your list. 467 + * @member: the name of the hlist_node within the struct. 468 + * 469 + * This list-traversal primitive may safely run concurrently with 470 + * the _rcu list-mutation primitives such as hlist_add_head_rcu() 471 + * as long as the traversal is guarded by rcu_read_lock(). 472 + * 473 + * This is the same as hlist_for_each_entry_rcu() except that it does 474 + * not do any RCU debugging or tracing. 475 + */ 476 + #define hlist_for_each_entry_rcu_notrace(pos, head, member) \ 477 + for (pos = hlist_entry_safe (rcu_dereference_raw_notrace(hlist_first_rcu(head)),\ 478 + typeof(*(pos)), member); \ 479 + pos; \ 480 + pos = hlist_entry_safe(rcu_dereference_raw_notrace(hlist_next_rcu(\ 481 + &(pos)->member)), typeof(*(pos)), member)) 482 + 483 + /** 464 484 * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type 465 485 * @pos: the type * to use as a loop cursor. 466 486 * @head: the head for your list.
+6 -1
include/linux/rculist_nulls.h
··· 105 105 * @head: the head for your list. 106 106 * @member: the name of the hlist_nulls_node within the struct. 107 107 * 108 + * The barrier() is needed to make sure compiler doesn't cache first element [1], 109 + * as this loop can be restarted [2] 110 + * [1] Documentation/atomic_ops.txt around line 114 111 + * [2] Documentation/RCU/rculist_nulls.txt around line 146 108 112 */ 109 113 #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ 110 - for (pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ 114 + for (({barrier();}), \ 115 + pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ 111 116 (!is_a_nulls(pos)) && \ 112 117 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ 113 118 pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)))
+9
include/linux/rcupdate.h
··· 640 640 641 641 #define rcu_dereference_raw(p) rcu_dereference_check(p, 1) /*@@@ needed? @@@*/ 642 642 643 + /* 644 + * The tracing infrastructure traces RCU (we want that), but unfortunately 645 + * some of the RCU checks causes tracing to lock up the system. 646 + * 647 + * The tracing version of rcu_dereference_raw() must not call 648 + * rcu_read_lock_held(). 649 + */ 650 + #define rcu_dereference_raw_notrace(p) __rcu_dereference_check((p), 1, __rcu) 651 + 643 652 /** 644 653 * rcu_access_index() - fetch RCU index with no dereferencing 645 654 * @p: The index to read
+15
include/linux/skbuff.h
··· 2852 2852 SKB_GSO_CB(inner_skb)->mac_offset; 2853 2853 } 2854 2854 2855 + static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra) 2856 + { 2857 + int new_headroom, headroom; 2858 + int ret; 2859 + 2860 + headroom = skb_headroom(skb); 2861 + ret = pskb_expand_head(skb, extra, 0, GFP_ATOMIC); 2862 + if (ret) 2863 + return ret; 2864 + 2865 + new_headroom = skb_headroom(skb); 2866 + SKB_GSO_CB(skb)->mac_offset += (new_headroom - headroom); 2867 + return 0; 2868 + } 2869 + 2855 2870 static inline bool skb_is_gso(const struct sk_buff *skb) 2856 2871 { 2857 2872 return skb_shinfo(skb)->gso_size;
+3
include/linux/socket.h
··· 320 320 321 321 struct timespec; 322 322 323 + /* The __sys_...msg variants allow MSG_CMSG_COMPAT */ 324 + extern long __sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags); 325 + extern long __sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags); 323 326 extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, 324 327 unsigned int flags, struct timespec *timeout); 325 328 extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg,
+1 -1
include/net/addrconf.h
··· 65 65 66 66 extern int ipv6_chk_addr(struct net *net, 67 67 const struct in6_addr *addr, 68 - struct net_device *dev, 68 + const struct net_device *dev, 69 69 int strict); 70 70 71 71 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
+11 -7
include/net/sch_generic.h
··· 679 679 #endif 680 680 681 681 struct psched_ratecfg { 682 - u64 rate_bps; 683 - u32 mult; 684 - u32 shift; 682 + u64 rate_bps; 683 + u32 mult; 684 + u16 overhead; 685 + u8 shift; 685 686 }; 686 687 687 688 static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, 688 689 unsigned int len) 689 690 { 690 - return ((u64)len * r->mult) >> r->shift; 691 + return ((u64)(len + r->overhead) * r->mult) >> r->shift; 691 692 } 692 693 693 - extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate); 694 + extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); 694 695 695 - static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r) 696 + static inline void psched_ratecfg_getrate(struct tc_ratespec *res, 697 + const struct psched_ratecfg *r) 696 698 { 697 - return r->rate_bps >> 3; 699 + memset(res, 0, sizeof(*res)); 700 + res->rate = r->rate_bps >> 3; 701 + res->overhead = r->overhead; 698 702 } 699 703 700 704 #endif
+5
include/net/xfrm.h
··· 1160 1160 } 1161 1161 } 1162 1162 1163 + extern void xfrm_garbage_collect(struct net *net); 1164 + 1163 1165 #else 1164 1166 1165 1167 static inline void xfrm_sk_free_policy(struct sock *sk) {} ··· 1195 1193 struct sk_buff *skb) 1196 1194 { 1197 1195 return 1; 1196 + } 1197 + static inline void xfrm_garbage_collect(struct net *net) 1198 + { 1198 1199 } 1199 1200 #endif 1200 1201
+16 -15
kernel/cgroup.c
··· 1686 1686 */ 1687 1687 cgroup_drop_root(opts.new_root); 1688 1688 1689 - if (((root->flags | opts.flags) & CGRP_ROOT_SANE_BEHAVIOR) && 1690 - root->flags != opts.flags) { 1691 - pr_err("cgroup: sane_behavior: new mount options should match the existing superblock\n"); 1692 - ret = -EINVAL; 1693 - goto drop_new_super; 1689 + if (root->flags != opts.flags) { 1690 + if ((root->flags | opts.flags) & CGRP_ROOT_SANE_BEHAVIOR) { 1691 + pr_err("cgroup: sane_behavior: new mount options should match the existing superblock\n"); 1692 + ret = -EINVAL; 1693 + goto drop_new_super; 1694 + } else { 1695 + pr_warning("cgroup: new mount options do not match the existing superblock, will be ignored\n"); 1696 + } 1694 1697 } 1695 1698 1696 1699 /* no subsys rebinding, so refcounts don't change */ ··· 2702 2699 goto out; 2703 2700 } 2704 2701 2702 + cfe->type = (void *)cft; 2703 + cfe->dentry = dentry; 2704 + dentry->d_fsdata = cfe; 2705 + simple_xattrs_init(&cfe->xattrs); 2706 + 2705 2707 mode = cgroup_file_mode(cft); 2706 2708 error = cgroup_create_file(dentry, mode | S_IFREG, cgrp->root->sb); 2707 2709 if (!error) { 2708 - cfe->type = (void *)cft; 2709 - cfe->dentry = dentry; 2710 - dentry->d_fsdata = cfe; 2711 - simple_xattrs_init(&cfe->xattrs); 2712 2710 list_add_tail(&cfe->node, &parent->files); 2713 2711 cfe = NULL; 2714 2712 } ··· 2957 2953 WARN_ON_ONCE(!rcu_read_lock_held()); 2958 2954 2959 2955 /* if first iteration, pretend we just visited @cgroup */ 2960 - if (!pos) { 2961 - if (list_empty(&cgroup->children)) 2962 - return NULL; 2956 + if (!pos) 2963 2957 pos = cgroup; 2964 - } 2965 2958 2966 2959 /* visit the first child if exists */ 2967 2960 next = list_first_or_null_rcu(&pos->children, struct cgroup, sibling); ··· 2966 2965 return next; 2967 2966 2968 2967 /* no child, visit my or the closest ancestor's next sibling */ 2969 - do { 2968 + while (pos != cgroup) { 2970 2969 next = list_entry_rcu(pos->sibling.next, struct cgroup, 2971 2970 sibling); 2972 2971 if (&next->sibling != &pos->parent->children) 2973 2972 return next; 2974 2973 2975 2974 pos = pos->parent; 2976 - } while (pos != cgroup); 2975 + } 2977 2976 2978 2977 return NULL; 2979 2978 }
+7 -2
kernel/irq/irqdomain.c
··· 143 143 * irq_domain_add_simple() - Allocate and register a simple irq_domain. 144 144 * @of_node: pointer to interrupt controller's device tree node. 145 145 * @size: total number of irqs in mapping 146 - * @first_irq: first number of irq block assigned to the domain 146 + * @first_irq: first number of irq block assigned to the domain, 147 + * pass zero to assign irqs on-the-fly. This will result in a 148 + * linear IRQ domain so it is important to use irq_create_mapping() 149 + * for each used IRQ, especially when SPARSE_IRQ is enabled. 147 150 * @ops: map/unmap domain callbacks 148 151 * @host_data: Controller private data pointer 149 152 * ··· 194 191 /* A linear domain is the default */ 195 192 return irq_domain_add_linear(of_node, size, ops, host_data); 196 193 } 194 + EXPORT_SYMBOL_GPL(irq_domain_add_simple); 197 195 198 196 /** 199 197 * irq_domain_add_legacy() - Allocate and register a legacy revmap irq_domain. ··· 401 397 while (count--) { 402 398 int irq = irq_base + count; 403 399 struct irq_data *irq_data = irq_get_irq_data(irq); 404 - irq_hw_number_t hwirq = irq_data->hwirq; 400 + irq_hw_number_t hwirq; 405 401 406 402 if (WARN_ON(!irq_data || irq_data->domain != domain)) 407 403 continue; 408 404 405 + hwirq = irq_data->hwirq; 409 406 irq_set_status_flags(irq, IRQ_NOREQUEST); 410 407 411 408 /* remove chip and handler */
-1
kernel/time/ntp.c
··· 874 874 void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts) 875 875 { 876 876 struct pps_normtime pts_norm, freq_norm; 877 - unsigned long flags; 878 877 879 878 pts_norm = pps_normalize_ts(*phase_ts); 880 879
+7 -1
kernel/time/tick-broadcast.c
··· 511 511 } 512 512 } 513 513 514 + /* 515 + * Remove the current cpu from the pending mask. The event is 516 + * delivered immediately in tick_do_broadcast() ! 517 + */ 518 + cpumask_clear_cpu(smp_processor_id(), tick_broadcast_pending_mask); 519 + 514 520 /* Take care of enforced broadcast requests */ 515 521 cpumask_or(tmpmask, tmpmask, tick_broadcast_force_mask); 516 522 cpumask_clear(tick_broadcast_force_mask); ··· 581 575 582 576 raw_spin_lock_irqsave(&tick_broadcast_lock, flags); 583 577 if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ENTER) { 584 - WARN_ON_ONCE(cpumask_test_cpu(cpu, tick_broadcast_pending_mask)); 585 578 if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_oneshot_mask)) { 579 + WARN_ON_ONCE(cpumask_test_cpu(cpu, tick_broadcast_pending_mask)); 586 580 clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN); 587 581 /* 588 582 * We only reprogram the broadcast timer if we
+8
kernel/time/timekeeping.c
··· 975 975 976 976 read_persistent_clock(&timekeeping_suspend_time); 977 977 978 + /* 979 + * On some systems the persistent_clock can not be detected at 980 + * timekeeping_init by its return value, so if we see a valid 981 + * value returned, update the persistent_clock_exists flag. 982 + */ 983 + if (timekeeping_suspend_time.tv_sec || timekeeping_suspend_time.tv_nsec) 984 + persistent_clock_exist = true; 985 + 978 986 raw_spin_lock_irqsave(&timekeeper_lock, flags); 979 987 write_seqcount_begin(&timekeeper_seq); 980 988 timekeeping_forward_now(tk);
+9 -9
kernel/trace/ftrace.c
··· 120 120 121 121 /* 122 122 * Traverse the ftrace_global_list, invoking all entries. The reason that we 123 - * can use rcu_dereference_raw() is that elements removed from this list 123 + * can use rcu_dereference_raw_notrace() is that elements removed from this list 124 124 * are simply leaked, so there is no need to interact with a grace-period 125 - * mechanism. The rcu_dereference_raw() calls are needed to handle 125 + * mechanism. The rcu_dereference_raw_notrace() calls are needed to handle 126 126 * concurrent insertions into the ftrace_global_list. 127 127 * 128 128 * Silly Alpha and silly pointer-speculation compiler optimizations! 129 129 */ 130 130 #define do_for_each_ftrace_op(op, list) \ 131 - op = rcu_dereference_raw(list); \ 131 + op = rcu_dereference_raw_notrace(list); \ 132 132 do 133 133 134 134 /* 135 135 * Optimized for just a single item in the list (as that is the normal case). 136 136 */ 137 137 #define while_for_each_ftrace_op(op) \ 138 - while (likely(op = rcu_dereference_raw((op)->next)) && \ 138 + while (likely(op = rcu_dereference_raw_notrace((op)->next)) && \ 139 139 unlikely((op) != &ftrace_list_end)) 140 140 141 141 static inline void ftrace_ops_init(struct ftrace_ops *ops) ··· 779 779 if (hlist_empty(hhd)) 780 780 return NULL; 781 781 782 - hlist_for_each_entry_rcu(rec, hhd, node) { 782 + hlist_for_each_entry_rcu_notrace(rec, hhd, node) { 783 783 if (rec->ip == ip) 784 784 return rec; 785 785 } ··· 1165 1165 1166 1166 hhd = &hash->buckets[key]; 1167 1167 1168 - hlist_for_each_entry_rcu(entry, hhd, hlist) { 1168 + hlist_for_each_entry_rcu_notrace(entry, hhd, hlist) { 1169 1169 if (entry->ip == ip) 1170 1170 return entry; 1171 1171 } ··· 1422 1422 struct ftrace_hash *notrace_hash; 1423 1423 int ret; 1424 1424 1425 - filter_hash = rcu_dereference_raw(ops->filter_hash); 1426 - notrace_hash = rcu_dereference_raw(ops->notrace_hash); 1425 + filter_hash = rcu_dereference_raw_notrace(ops->filter_hash); 1426 + notrace_hash = rcu_dereference_raw_notrace(ops->notrace_hash); 1427 1427 1428 1428 if ((ftrace_hash_empty(filter_hash) || 1429 1429 ftrace_lookup_ip(filter_hash, ip)) && ··· 2920 2920 * on the hash. rcu_read_lock is too dangerous here. 2921 2921 */ 2922 2922 preempt_disable_notrace(); 2923 - hlist_for_each_entry_rcu(entry, hhd, node) { 2923 + hlist_for_each_entry_rcu_notrace(entry, hhd, node) { 2924 2924 if (entry->ip == ip) 2925 2925 entry->ops->func(ip, parent_ip, &entry->data); 2926 2926 }
+9 -1
kernel/trace/trace.c
··· 843 843 844 844 memcpy(max_data->comm, tsk->comm, TASK_COMM_LEN); 845 845 max_data->pid = tsk->pid; 846 - max_data->uid = task_uid(tsk); 846 + /* 847 + * If tsk == current, then use current_uid(), as that does not use 848 + * RCU. The irq tracer can be called out of RCU scope. 849 + */ 850 + if (tsk == current) 851 + max_data->uid = current_uid(); 852 + else 853 + max_data->uid = task_uid(tsk); 854 + 847 855 max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO; 848 856 max_data->policy = tsk->policy; 849 857 max_data->rt_priority = tsk->rt_priority;
+1 -1
kernel/trace/trace_selftest.c
··· 1159 1159 /* stop the tracing. */ 1160 1160 tracing_stop(); 1161 1161 /* check the trace buffer */ 1162 - ret = trace_test_buffer(tr, &count); 1162 + ret = trace_test_buffer(&tr->trace_buffer, &count); 1163 1163 trace->reset(tr); 1164 1164 tracing_start(); 1165 1165
-9
mm/memory.c
··· 220 220 tlb->start = -1UL; 221 221 tlb->end = 0; 222 222 tlb->need_flush = 0; 223 - tlb->fast_mode = (num_possible_cpus() == 1); 224 223 tlb->local.next = NULL; 225 224 tlb->local.nr = 0; 226 225 tlb->local.max = ARRAY_SIZE(tlb->__pages); ··· 242 243 #ifdef CONFIG_HAVE_RCU_TABLE_FREE 243 244 tlb_table_flush(tlb); 244 245 #endif 245 - 246 - if (tlb_fast_mode(tlb)) 247 - return; 248 246 249 247 for (batch = &tlb->local; batch; batch = batch->next) { 250 248 free_pages_and_swap_cache(batch->pages, batch->nr); ··· 283 287 struct mmu_gather_batch *batch; 284 288 285 289 VM_BUG_ON(!tlb->need_flush); 286 - 287 - if (tlb_fast_mode(tlb)) { 288 - free_page_and_swap_cache(page); 289 - return 1; /* avoid calling tlb_flush_mmu() */ 290 - } 291 290 292 291 batch = tlb->active; 293 292 batch->pages[batch->nr++] = page;
+11 -2
net/compat.c
··· 734 734 735 735 asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) 736 736 { 737 - return sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); 737 + if (flags & MSG_CMSG_COMPAT) 738 + return -EINVAL; 739 + return __sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); 738 740 } 739 741 740 742 asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, 741 743 unsigned int vlen, unsigned int flags) 742 744 { 745 + if (flags & MSG_CMSG_COMPAT) 746 + return -EINVAL; 743 747 return __sys_sendmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, 744 748 flags | MSG_CMSG_COMPAT); 745 749 } 746 750 747 751 asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) 748 752 { 749 - return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); 753 + if (flags & MSG_CMSG_COMPAT) 754 + return -EINVAL; 755 + return __sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); 750 756 } 751 757 752 758 asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, unsigned int flags) ··· 773 767 { 774 768 int datagrams; 775 769 struct timespec ktspec; 770 + 771 + if (flags & MSG_CMSG_COMPAT) 772 + return -EINVAL; 776 773 777 774 if (COMPAT_USE_64BIT_TIME) 778 775 return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
+11 -6
net/core/dev_addr_lists.c
··· 39 39 ha->refcount = 1; 40 40 ha->global_use = global; 41 41 ha->synced = sync; 42 + ha->sync_cnt = 0; 42 43 list_add_tail_rcu(&ha->list, &list->list); 43 44 list->count++; 44 45 ··· 67 66 } 68 67 if (sync) { 69 68 if (ha->synced) 70 - return 0; 69 + return -EEXIST; 71 70 else 72 71 ha->synced = true; 73 72 } ··· 140 139 141 140 err = __hw_addr_add_ex(to_list, ha->addr, addr_len, ha->type, 142 141 false, true); 143 - if (err) 142 + if (err && err != -EEXIST) 144 143 return err; 145 - ha->sync_cnt++; 146 - ha->refcount++; 144 + 145 + if (!err) { 146 + ha->sync_cnt++; 147 + ha->refcount++; 148 + } 147 149 148 150 return 0; 149 151 } ··· 163 159 if (err) 164 160 return; 165 161 ha->sync_cnt--; 166 - __hw_addr_del_entry(from_list, ha, false, true); 162 + /* address on from list is not marked synced */ 163 + __hw_addr_del_entry(from_list, ha, false, false); 167 164 } 168 165 169 166 static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list, ··· 801 796 return -EINVAL; 802 797 803 798 netif_addr_lock_nested(to); 804 - err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len); 799 + err = __hw_addr_sync_multiple(&to->mc, &from->mc, to->addr_len); 805 800 if (!err) 806 801 __dev_set_rx_mode(to); 807 802 netif_addr_unlock(to);
+2 -2
net/core/skbuff.c
··· 195 195 * the tail pointer in struct sk_buff! 196 196 */ 197 197 memset(skb, 0, offsetof(struct sk_buff, tail)); 198 - skb->data = NULL; 198 + skb->head = NULL; 199 199 skb->truesize = sizeof(struct sk_buff); 200 200 atomic_set(&skb->users, 1); 201 201 ··· 611 611 static void skb_release_all(struct sk_buff *skb) 612 612 { 613 613 skb_release_head_state(skb); 614 - if (likely(skb->data)) 614 + if (likely(skb->head)) 615 615 skb_release_data(skb); 616 616 } 617 617
+3 -3
net/core/sock.c
··· 210 210 "sk_lock-AF_TIPC" , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV" , 211 211 "sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN" , "sk_lock-AF_PHONET" , 212 212 "sk_lock-AF_IEEE802154", "sk_lock-AF_CAIF" , "sk_lock-AF_ALG" , 213 - "sk_lock-AF_NFC" , "sk_lock-AF_MAX" 213 + "sk_lock-AF_NFC" , "sk_lock-AF_VSOCK" , "sk_lock-AF_MAX" 214 214 }; 215 215 static const char *const af_family_slock_key_strings[AF_MAX+1] = { 216 216 "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , ··· 226 226 "slock-AF_TIPC" , "slock-AF_BLUETOOTH", "slock-AF_IUCV" , 227 227 "slock-AF_RXRPC" , "slock-AF_ISDN" , "slock-AF_PHONET" , 228 228 "slock-AF_IEEE802154", "slock-AF_CAIF" , "slock-AF_ALG" , 229 - "slock-AF_NFC" , "slock-AF_MAX" 229 + "slock-AF_NFC" , "slock-AF_VSOCK" ,"slock-AF_MAX" 230 230 }; 231 231 static const char *const af_family_clock_key_strings[AF_MAX+1] = { 232 232 "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , ··· 242 242 "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" , 243 243 "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" , 244 244 "clock-AF_IEEE802154", "clock-AF_CAIF" , "clock-AF_ALG" , 245 - "clock-AF_NFC" , "clock-AF_MAX" 245 + "clock-AF_NFC" , "clock-AF_VSOCK" , "clock-AF_MAX" 246 246 }; 247 247 248 248 /*
+1 -1
net/ipv4/ip_tunnel.c
··· 503 503 504 504 inner_iph = (const struct iphdr *)skb_inner_network_header(skb); 505 505 506 + memset(IPCB(skb), 0, sizeof(*IPCB(skb))); 506 507 dst = tnl_params->daddr; 507 508 if (dst == 0) { 508 509 /* NBMA tunnel */ ··· 659 658 660 659 skb_dst_drop(skb); 661 660 skb_dst_set(skb, &rt->dst); 662 - memset(IPCB(skb), 0, sizeof(*IPCB(skb))); 663 661 664 662 /* Push down and install the IP header. */ 665 663 skb_push(skb, sizeof(struct iphdr));
+4 -2
net/ipv4/netfilter/ipt_ULOG.c
··· 231 231 put_unaligned(tv.tv_usec, &pm->timestamp_usec); 232 232 put_unaligned(skb->mark, &pm->mark); 233 233 pm->hook = hooknum; 234 - if (prefix != NULL) 235 - strncpy(pm->prefix, prefix, sizeof(pm->prefix)); 234 + if (prefix != NULL) { 235 + strncpy(pm->prefix, prefix, sizeof(pm->prefix) - 1); 236 + pm->prefix[sizeof(pm->prefix) - 1] = '\0'; 237 + } 236 238 else if (loginfo->prefix[0] != '\0') 237 239 strncpy(pm->prefix, loginfo->prefix, sizeof(pm->prefix)); 238 240 else
+6 -1
net/ipv4/route.c
··· 737 737 { 738 738 struct rtable *rt; 739 739 struct flowi4 fl4; 740 + const struct iphdr *iph = (const struct iphdr *) skb->data; 741 + int oif = skb->dev->ifindex; 742 + u8 tos = RT_TOS(iph->tos); 743 + u8 prot = iph->protocol; 744 + u32 mark = skb->mark; 740 745 741 746 rt = (struct rtable *) dst; 742 747 743 - ip_rt_build_flow_key(&fl4, sk, skb); 748 + __build_flow_key(&fl4, sk, iph, oif, tos, prot, mark, 0); 744 749 __ip_do_redirect(rt, skb, &fl4, true); 745 750 } 746 751
+4 -2
net/ipv6/addrconf.c
··· 1487 1487 } 1488 1488 1489 1489 int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, 1490 - struct net_device *dev, int strict) 1490 + const struct net_device *dev, int strict) 1491 1491 { 1492 1492 struct inet6_ifaddr *ifp; 1493 1493 unsigned int hash = inet6_addr_hash(addr); ··· 2658 2658 sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0); 2659 2659 2660 2660 /* Failure cases are ignored */ 2661 - if (!IS_ERR(sp_rt)) 2661 + if (!IS_ERR(sp_rt)) { 2662 + sp_ifa->rt = sp_rt; 2662 2663 ip6_ins_rt(sp_rt); 2664 + } 2663 2665 } 2664 2666 read_unlock_bh(&idev->lock); 2665 2667 }
+7
net/ipv6/netfilter.c
··· 10 10 #include <linux/netfilter.h> 11 11 #include <linux/netfilter_ipv6.h> 12 12 #include <linux/export.h> 13 + #include <net/addrconf.h> 13 14 #include <net/dst.h> 14 15 #include <net/ipv6.h> 15 16 #include <net/ip6_route.h> ··· 187 186 return csum; 188 187 }; 189 188 189 + static const struct nf_ipv6_ops ipv6ops = { 190 + .chk_addr = ipv6_chk_addr, 191 + }; 192 + 190 193 static const struct nf_afinfo nf_ip6_afinfo = { 191 194 .family = AF_INET6, 192 195 .checksum = nf_ip6_checksum, ··· 203 198 204 199 int __init ipv6_netfilter_init(void) 205 200 { 201 + RCU_INIT_POINTER(nf_ipv6_ops, &ipv6ops); 206 202 return nf_register_afinfo(&nf_ip6_afinfo); 207 203 } 208 204 ··· 212 206 */ 213 207 void ipv6_netfilter_fini(void) 214 208 { 209 + RCU_INIT_POINTER(nf_ipv6_ops, NULL); 215 210 nf_unregister_afinfo(&nf_ip6_afinfo); 216 211 }
+1 -1
net/ipv6/proc.c
··· 90 90 SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS), 91 91 SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS), 92 92 SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS), 93 - SNMP_MIB_ITEM("InCsumErrors", IPSTATS_MIB_CSUMERRORS), 93 + /* IPSTATS_MIB_CSUMERRORS is not relevant in IPv6 (no checksum) */ 94 94 SNMP_MIB_SENTINEL 95 95 }; 96 96
+12 -8
net/ipv6/udp_offload.c
··· 46 46 unsigned int mss; 47 47 unsigned int unfrag_ip6hlen, unfrag_len; 48 48 struct frag_hdr *fptr; 49 - u8 *mac_start, *prevhdr; 49 + u8 *packet_start, *prevhdr; 50 50 u8 nexthdr; 51 51 u8 frag_hdr_sz = sizeof(struct frag_hdr); 52 52 int offset; 53 53 __wsum csum; 54 + int tnl_hlen; 54 55 55 56 mss = skb_shinfo(skb)->gso_size; 56 57 if (unlikely(skb->len <= mss)) ··· 84 83 skb->ip_summed = CHECKSUM_NONE; 85 84 86 85 /* Check if there is enough headroom to insert fragment header. */ 87 - if ((skb_mac_header(skb) < skb->head + frag_hdr_sz) && 88 - pskb_expand_head(skb, frag_hdr_sz, 0, GFP_ATOMIC)) 89 - goto out; 86 + tnl_hlen = skb_tnl_header_len(skb); 87 + if (skb_headroom(skb) < (tnl_hlen + frag_hdr_sz)) { 88 + if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz)) 89 + goto out; 90 + } 90 91 91 92 /* Find the unfragmentable header and shift it left by frag_hdr_sz 92 93 * bytes to insert fragment header. ··· 96 93 unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); 97 94 nexthdr = *prevhdr; 98 95 *prevhdr = NEXTHDR_FRAGMENT; 99 - unfrag_len = skb_network_header(skb) - skb_mac_header(skb) + 100 - unfrag_ip6hlen; 101 - mac_start = skb_mac_header(skb); 102 - memmove(mac_start-frag_hdr_sz, mac_start, unfrag_len); 96 + unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + 97 + unfrag_ip6hlen + tnl_hlen; 98 + packet_start = (u8 *) skb->head + SKB_GSO_CB(skb)->mac_offset; 99 + memmove(packet_start-frag_hdr_sz, packet_start, unfrag_len); 103 100 101 + SKB_GSO_CB(skb)->mac_offset -= frag_hdr_sz; 104 102 skb->mac_header -= frag_hdr_sz; 105 103 skb->network_header -= frag_hdr_sz; 106 104
+4
net/key/af_key.c
··· 2366 2366 2367 2367 out: 2368 2368 xfrm_pol_put(xp); 2369 + if (err == 0) 2370 + xfrm_garbage_collect(net); 2369 2371 return err; 2370 2372 } 2371 2373 ··· 2617 2615 2618 2616 out: 2619 2617 xfrm_pol_put(xp); 2618 + if (delete && err == 0) 2619 + xfrm_garbage_collect(net); 2620 2620 return err; 2621 2621 } 2622 2622
+37 -7
net/mac80211/iface.c
··· 159 159 return 0; 160 160 } 161 161 162 - static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr) 162 + static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr) 163 163 { 164 - struct ieee80211_sub_if_data *sdata; 164 + struct ieee80211_local *local = sdata->local; 165 + struct ieee80211_sub_if_data *iter; 165 166 u64 new, mask, tmp; 166 167 u8 *m; 167 168 int ret = 0; ··· 182 181 183 182 184 183 mutex_lock(&local->iflist_mtx); 185 - list_for_each_entry(sdata, &local->interfaces, list) { 186 - if (sdata->vif.type == NL80211_IFTYPE_MONITOR) 184 + list_for_each_entry(iter, &local->interfaces, list) { 185 + if (iter == sdata) 187 186 continue; 188 187 189 - m = sdata->vif.addr; 188 + if (iter->vif.type == NL80211_IFTYPE_MONITOR) 189 + continue; 190 + 191 + m = iter->vif.addr; 190 192 tmp = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | 191 193 ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | 192 194 ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); ··· 213 209 if (ieee80211_sdata_running(sdata)) 214 210 return -EBUSY; 215 211 216 - ret = ieee80211_verify_mac(sdata->local, sa->sa_data); 212 + ret = ieee80211_verify_mac(sdata, sa->sa_data); 217 213 if (ret) 218 214 return ret; 219 215 ··· 478 474 master->control_port_protocol; 479 475 sdata->control_port_no_encrypt = 480 476 master->control_port_no_encrypt; 477 + sdata->vif.cab_queue = master->vif.cab_queue; 478 + memcpy(sdata->vif.hw_queue, master->vif.hw_queue, 479 + sizeof(sdata->vif.hw_queue)); 481 480 break; 482 481 } 483 482 case NL80211_IFTYPE_AP: ··· 660 653 661 654 ieee80211_recalc_ps(local, -1); 662 655 663 - if (dev) { 656 + if (sdata->vif.type == NL80211_IFTYPE_MONITOR || 657 + sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { 658 + /* XXX: for AP_VLAN, actually track AP queues */ 659 + netif_tx_start_all_queues(dev); 660 + } else if (dev) { 664 661 unsigned long flags; 665 662 int n_acs = IEEE80211_NUM_ACS; 666 663 int ac; ··· 1490 1479 break; 1491 1480 } 1492 1481 1482 + /* 1483 + * Pick address of existing interface in case user changed 1484 + * MAC address manually, default to perm_addr. 1485 + */ 1493 1486 m = local->hw.wiphy->perm_addr; 1487 + list_for_each_entry(sdata, &local->interfaces, list) { 1488 + if (sdata->vif.type == NL80211_IFTYPE_MONITOR) 1489 + continue; 1490 + m = sdata->vif.addr; 1491 + break; 1492 + } 1494 1493 start = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | 1495 1494 ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | 1496 1495 ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); ··· 1716 1695 LIST_HEAD(wdev_list); 1717 1696 1718 1697 ASSERT_RTNL(); 1698 + 1699 + /* 1700 + * Close all AP_VLAN interfaces first, as otherwise they 1701 + * might be closed while the AP interface they belong to 1702 + * is closed, causing unregister_netdevice_many() to crash. 1703 + */ 1704 + list_for_each_entry(sdata, &local->interfaces, list) 1705 + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 1706 + dev_close(sdata->dev); 1719 1707 1720 1708 mutex_lock(&local->iflist_mtx); 1721 1709 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
+6 -6
net/mac80211/mlme.c
··· 3321 3321 if (WARN_ON_ONCE(!auth_data)) 3322 3322 return -EINVAL; 3323 3323 3324 - if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) 3325 - tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | 3326 - IEEE80211_TX_INTFL_MLME_CONN_TX; 3327 - 3328 3324 auth_data->tries++; 3329 3325 3330 3326 if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { ··· 3354 3358 auth_data->expected_transaction = trans; 3355 3359 } 3356 3360 3361 + if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) 3362 + tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | 3363 + IEEE80211_TX_INTFL_MLME_CONN_TX; 3364 + 3357 3365 ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, 3358 3366 auth_data->data, auth_data->data_len, 3359 3367 auth_data->bss->bssid, ··· 3381 3381 * will not answer to direct packet in unassociated state. 3382 3382 */ 3383 3383 ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1], 3384 - NULL, 0, (u32) -1, true, tx_flags, 3384 + NULL, 0, (u32) -1, true, 0, 3385 3385 auth_data->bss->channel, false); 3386 3386 rcu_read_unlock(); 3387 3387 } 3388 3388 3389 - if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { 3389 + if (tx_flags == 0) { 3390 3390 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 3391 3391 ifmgd->auth_data->timeout_started = true; 3392 3392 run_again(ifmgd, auth_data->timeout);
+2
net/netfilter/core.c
··· 30 30 31 31 const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly; 32 32 EXPORT_SYMBOL(nf_afinfo); 33 + const struct nf_ipv6_ops __rcu *nf_ipv6_ops __read_mostly; 34 + EXPORT_SYMBOL_GPL(nf_ipv6_ops); 33 35 34 36 int nf_register_afinfo(const struct nf_afinfo *afinfo) 35 37 {
+35
net/netfilter/ipvs/ip_vs_core.c
··· 1001 1001 return th->rst; 1002 1002 } 1003 1003 1004 + static inline bool is_new_conn(const struct sk_buff *skb, 1005 + struct ip_vs_iphdr *iph) 1006 + { 1007 + switch (iph->protocol) { 1008 + case IPPROTO_TCP: { 1009 + struct tcphdr _tcph, *th; 1010 + 1011 + th = skb_header_pointer(skb, iph->len, sizeof(_tcph), &_tcph); 1012 + if (th == NULL) 1013 + return false; 1014 + return th->syn; 1015 + } 1016 + case IPPROTO_SCTP: { 1017 + sctp_chunkhdr_t *sch, schunk; 1018 + 1019 + sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t), 1020 + sizeof(schunk), &schunk); 1021 + if (sch == NULL) 1022 + return false; 1023 + return sch->type == SCTP_CID_INIT; 1024 + } 1025 + default: 1026 + return false; 1027 + } 1028 + } 1029 + 1004 1030 /* Handle response packets: rewrite addresses and send away... 1005 1031 */ 1006 1032 static unsigned int ··· 1638 1612 * Check if the packet belongs to an existing connection entry 1639 1613 */ 1640 1614 cp = pp->conn_in_get(af, skb, &iph, 0); 1615 + 1616 + if (unlikely(sysctl_expire_nodest_conn(ipvs)) && cp && cp->dest && 1617 + unlikely(!atomic_read(&cp->dest->weight)) && !iph.fragoffs && 1618 + is_new_conn(skb, &iph)) { 1619 + ip_vs_conn_expire_now(cp); 1620 + __ip_vs_conn_put(cp); 1621 + cp = NULL; 1622 + } 1623 + 1641 1624 if (unlikely(!cp) && !iph.fragoffs) { 1642 1625 /* No (second) fragments need to enter here, as nf_defrag_ipv6 1643 1626 * replayed fragment zero will already have created the cp
+1 -1
net/netfilter/ipvs/ip_vs_sh.c
··· 67 67 #define IP_VS_SH_TAB_MASK (IP_VS_SH_TAB_SIZE - 1) 68 68 69 69 struct ip_vs_sh_state { 70 - struct ip_vs_sh_bucket buckets[IP_VS_SH_TAB_SIZE]; 71 70 struct rcu_head rcu_head; 71 + struct ip_vs_sh_bucket buckets[IP_VS_SH_TAB_SIZE]; 72 72 }; 73 73 74 74 /*
+1 -1
net/netfilter/xt_LOG.c
··· 737 737 dump_sk_uid_gid(m, skb->sk); 738 738 739 739 /* Max length: 16 "MARK=0xFFFFFFFF " */ 740 - if (!recurse && skb->mark) 740 + if (recurse && skb->mark) 741 741 sb_add(m, "MARK=0x%x ", skb->mark); 742 742 } 743 743
+17 -12
net/netfilter/xt_addrtype.c
··· 22 22 #include <net/ip6_fib.h> 23 23 #endif 24 24 25 + #include <linux/netfilter_ipv6.h> 25 26 #include <linux/netfilter/xt_addrtype.h> 26 27 #include <linux/netfilter/x_tables.h> 27 28 ··· 34 33 35 34 #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 36 35 static u32 match_lookup_rt6(struct net *net, const struct net_device *dev, 37 - const struct in6_addr *addr) 36 + const struct in6_addr *addr, u16 mask) 38 37 { 39 38 const struct nf_afinfo *afinfo; 40 39 struct flowi6 flow; 41 40 struct rt6_info *rt; 42 - u32 ret; 41 + u32 ret = 0; 43 42 int route_err; 44 43 45 44 memset(&flow, 0, sizeof(flow)); ··· 50 49 rcu_read_lock(); 51 50 52 51 afinfo = nf_get_afinfo(NFPROTO_IPV6); 53 - if (afinfo != NULL) 54 - route_err = afinfo->route(net, (struct dst_entry **)&rt, 55 - flowi6_to_flowi(&flow), !!dev); 56 - else 57 - route_err = 1; 52 + if (afinfo != NULL) { 53 + const struct nf_ipv6_ops *v6ops; 58 54 55 + if (dev && (mask & XT_ADDRTYPE_LOCAL)) { 56 + v6ops = nf_get_ipv6_ops(); 57 + if (v6ops && v6ops->chk_addr(net, addr, dev, true)) 58 + ret = XT_ADDRTYPE_LOCAL; 59 + } 60 + route_err = afinfo->route(net, (struct dst_entry **)&rt, 61 + flowi6_to_flowi(&flow), false); 62 + } else { 63 + route_err = 1; 64 + } 59 65 rcu_read_unlock(); 60 66 61 67 if (route_err) ··· 70 62 71 63 if (rt->rt6i_flags & RTF_REJECT) 72 64 ret = XT_ADDRTYPE_UNREACHABLE; 73 - else 74 - ret = 0; 75 65 76 - if (rt->rt6i_flags & RTF_LOCAL) 66 + if (dev == NULL && rt->rt6i_flags & RTF_LOCAL) 77 67 ret |= XT_ADDRTYPE_LOCAL; 78 68 if (rt->rt6i_flags & RTF_ANYCAST) 79 69 ret |= XT_ADDRTYPE_ANYCAST; 80 - 81 70 82 71 dst_release(&rt->dst); 83 72 return ret; ··· 95 90 96 91 if ((XT_ADDRTYPE_LOCAL | XT_ADDRTYPE_ANYCAST | 97 92 XT_ADDRTYPE_UNREACHABLE) & mask) 98 - return !!(mask & match_lookup_rt6(net, dev, addr)); 93 + return !!(mask & match_lookup_rt6(net, dev, addr, mask)); 99 94 return true; 100 95 } 101 96
+1 -1
net/netlink/af_netlink.c
··· 747 747 atomic_dec(&ring->pending); 748 748 sock_put(sk); 749 749 750 - skb->data = NULL; 750 + skb->head = NULL; 751 751 } 752 752 #endif 753 753 if (skb->sk != NULL)
-1
net/nfc/Makefile
··· 5 5 obj-$(CONFIG_NFC) += nfc.o 6 6 obj-$(CONFIG_NFC_NCI) += nci/ 7 7 obj-$(CONFIG_NFC_HCI) += hci/ 8 - #obj-$(CONFIG_NFC_LLCP) += llcp/ 9 8 10 9 nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \ 11 10 llcp_sock.o
+4 -4
net/sched/act_police.c
··· 231 231 } 232 232 if (R_tab) { 233 233 police->rate_present = true; 234 - psched_ratecfg_precompute(&police->rate, R_tab->rate.rate); 234 + psched_ratecfg_precompute(&police->rate, &R_tab->rate); 235 235 qdisc_put_rtab(R_tab); 236 236 } else { 237 237 police->rate_present = false; 238 238 } 239 239 if (P_tab) { 240 240 police->peak_present = true; 241 - psched_ratecfg_precompute(&police->peak, P_tab->rate.rate); 241 + psched_ratecfg_precompute(&police->peak, &P_tab->rate); 242 242 qdisc_put_rtab(P_tab); 243 243 } else { 244 244 police->peak_present = false; ··· 376 376 }; 377 377 378 378 if (police->rate_present) 379 - opt.rate.rate = psched_ratecfg_getrate(&police->rate); 379 + psched_ratecfg_getrate(&opt.rate, &police->rate); 380 380 if (police->peak_present) 381 - opt.peakrate.rate = psched_ratecfg_getrate(&police->peak); 381 + psched_ratecfg_getrate(&opt.peakrate, &police->peak); 382 382 if (nla_put(skb, TCA_POLICE_TBF, sizeof(opt), &opt)) 383 383 goto nla_put_failure; 384 384 if (police->tcfp_result &&
+5 -3
net/sched/sch_generic.c
··· 898 898 WARN_ON(timer_pending(&dev->watchdog_timer)); 899 899 } 900 900 901 - void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate) 901 + void psched_ratecfg_precompute(struct psched_ratecfg *r, 902 + const struct tc_ratespec *conf) 902 903 { 903 904 u64 factor; 904 905 u64 mult; 905 906 int shift; 906 907 907 - r->rate_bps = (u64)rate << 3; 908 - r->shift = 0; 908 + memset(r, 0, sizeof(*r)); 909 + r->overhead = conf->overhead; 910 + r->rate_bps = (u64)conf->rate << 3; 909 911 r->mult = 1; 910 912 /* 911 913 * Calibrate mult, shift so that token counting is accurate
+21 -21
net/sched/sch_htb.c
··· 109 109 } un; 110 110 struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */ 111 111 struct rb_node pq_node; /* node for event queue */ 112 - psched_time_t pq_key; 112 + s64 pq_key; 113 113 114 114 int prio_activity; /* for which prios are we active */ 115 115 enum htb_cmode cmode; /* current mode of the class */ ··· 121 121 /* token bucket parameters */ 122 122 struct psched_ratecfg rate; 123 123 struct psched_ratecfg ceil; 124 - s64 buffer, cbuffer; /* token bucket depth/rate */ 125 - psched_tdiff_t mbuffer; /* max wait time */ 126 - s64 tokens, ctokens; /* current number of tokens */ 127 - psched_time_t t_c; /* checkpoint time */ 124 + s64 buffer, cbuffer; /* token bucket depth/rate */ 125 + s64 mbuffer; /* max wait time */ 126 + s64 tokens, ctokens; /* current number of tokens */ 127 + s64 t_c; /* checkpoint time */ 128 128 }; 129 129 130 130 struct htb_sched { ··· 141 141 struct rb_root wait_pq[TC_HTB_MAXDEPTH]; 142 142 143 143 /* time of nearest event per level (row) */ 144 - psched_time_t near_ev_cache[TC_HTB_MAXDEPTH]; 144 + s64 near_ev_cache[TC_HTB_MAXDEPTH]; 145 145 146 146 int defcls; /* class where unclassified flows go to */ 147 147 148 148 /* filters for qdisc itself */ 149 149 struct tcf_proto *filter_list; 150 150 151 - int rate2quantum; /* quant = rate / rate2quantum */ 152 - psched_time_t now; /* cached dequeue time */ 151 + int rate2quantum; /* quant = rate / rate2quantum */ 152 + s64 now; /* cached dequeue time */ 153 153 struct qdisc_watchdog watchdog; 154 154 155 155 /* non shaped skbs; let them go directly thru */ ··· 664 664 * next pending event (0 for no event in pq, q->now for too many events). 665 665 * Note: Applied are events whose have cl->pq_key <= q->now. 666 666 */ 667 - static psched_time_t htb_do_events(struct htb_sched *q, int level, 668 - unsigned long start) 667 + static s64 htb_do_events(struct htb_sched *q, int level, 668 + unsigned long start) 669 669 { 670 670 /* don't run for longer than 2 jiffies; 2 is used instead of 671 671 * 1 to simplify things when jiffy is going to be incremented ··· 857 857 struct sk_buff *skb; 858 858 struct htb_sched *q = qdisc_priv(sch); 859 859 int level; 860 - psched_time_t next_event; 860 + s64 next_event; 861 861 unsigned long start_at; 862 862 863 863 /* try to dequeue direct packets as high prio (!) to minimize cpu work */ ··· 880 880 for (level = 0; level < TC_HTB_MAXDEPTH; level++) { 881 881 /* common case optimization - skip event handler quickly */ 882 882 int m; 883 - psched_time_t event; 883 + s64 event; 884 884 885 885 if (q->now >= q->near_ev_cache[level]) { 886 886 event = htb_do_events(q, level, start_at); ··· 1090 1090 1091 1091 memset(&opt, 0, sizeof(opt)); 1092 1092 1093 - opt.rate.rate = psched_ratecfg_getrate(&cl->rate); 1093 + psched_ratecfg_getrate(&opt.rate, &cl->rate); 1094 1094 opt.buffer = PSCHED_NS2TICKS(cl->buffer); 1095 - opt.ceil.rate = psched_ratecfg_getrate(&cl->ceil); 1095 + psched_ratecfg_getrate(&opt.ceil, &cl->ceil); 1096 1096 opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer); 1097 1097 opt.quantum = cl->quantum; 1098 1098 opt.prio = cl->prio; ··· 1117 1117 1118 1118 if (!cl->level && cl->un.leaf.q) 1119 1119 cl->qstats.qlen = cl->un.leaf.q->q.qlen; 1120 - cl->xstats.tokens = cl->tokens; 1121 - cl->xstats.ctokens = cl->ctokens; 1120 + cl->xstats.tokens = PSCHED_NS2TICKS(cl->tokens); 1121 + cl->xstats.ctokens = PSCHED_NS2TICKS(cl->ctokens); 1122 1122 1123 1123 if (gnet_stats_copy_basic(d, &cl->bstats) < 0 || 1124 1124 gnet_stats_copy_rate_est(d, NULL, &cl->rate_est) < 0 || ··· 1200 1200 parent->un.leaf.q = new_q ? new_q : &noop_qdisc; 1201 1201 parent->tokens = parent->buffer; 1202 1202 parent->ctokens = parent->cbuffer; 1203 - parent->t_c = psched_get_time(); 1203 + parent->t_c = ktime_to_ns(ktime_get()); 1204 1204 parent->cmode = HTB_CAN_SEND; 1205 1205 } 1206 1206 ··· 1417 1417 /* set class to be in HTB_CAN_SEND state */ 1418 1418 cl->tokens = PSCHED_TICKS2NS(hopt->buffer); 1419 1419 cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer); 1420 - cl->mbuffer = 60 * PSCHED_TICKS_PER_SEC; /* 1min */ 1421 - cl->t_c = psched_get_time(); 1420 + cl->mbuffer = 60ULL * NSEC_PER_SEC; /* 1min */ 1421 + cl->t_c = ktime_to_ns(ktime_get()); 1422 1422 cl->cmode = HTB_CAN_SEND; 1423 1423 1424 1424 /* attach to the hash list and parent's family */ ··· 1459 1459 cl->prio = TC_HTB_NUMPRIO - 1; 1460 1460 } 1461 1461 1462 - psched_ratecfg_precompute(&cl->rate, hopt->rate.rate); 1463 - psched_ratecfg_precompute(&cl->ceil, hopt->ceil.rate); 1462 + psched_ratecfg_precompute(&cl->rate, &hopt->rate); 1463 + psched_ratecfg_precompute(&cl->ceil, &hopt->ceil); 1464 1464 1465 1465 cl->buffer = PSCHED_TICKS2NS(hopt->buffer); 1466 1466 cl->cbuffer = PSCHED_TICKS2NS(hopt->buffer);
+4 -4
net/sched/sch_tbf.c
··· 298 298 q->tokens = q->buffer; 299 299 q->ptokens = q->mtu; 300 300 301 - psched_ratecfg_precompute(&q->rate, rtab->rate.rate); 301 + psched_ratecfg_precompute(&q->rate, &rtab->rate); 302 302 if (ptab) { 303 - psched_ratecfg_precompute(&q->peak, ptab->rate.rate); 303 + psched_ratecfg_precompute(&q->peak, &ptab->rate); 304 304 q->peak_present = true; 305 305 } else { 306 306 q->peak_present = false; ··· 350 350 goto nla_put_failure; 351 351 352 352 opt.limit = q->limit; 353 - opt.rate.rate = psched_ratecfg_getrate(&q->rate); 353 + psched_ratecfg_getrate(&opt.rate, &q->rate); 354 354 if (q->peak_present) 355 - opt.peakrate.rate = psched_ratecfg_getrate(&q->peak); 355 + psched_ratecfg_getrate(&opt.peakrate, &q->peak); 356 356 else 357 357 memset(&opt.peakrate, 0, sizeof(opt.peakrate)); 358 358 opt.mtu = PSCHED_NS2TICKS(q->mtu);
+42 -19
net/socket.c
··· 1956 1956 unsigned int name_len; 1957 1957 }; 1958 1958 1959 - static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg, 1959 + static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg, 1960 1960 struct msghdr *msg_sys, unsigned int flags, 1961 1961 struct used_address *used_address) 1962 1962 { ··· 2071 2071 * BSD sendmsg interface 2072 2072 */ 2073 2073 2074 - SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned int, flags) 2074 + long __sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) 2075 2075 { 2076 2076 int fput_needed, err; 2077 2077 struct msghdr msg_sys; 2078 - struct socket *sock = sockfd_lookup_light(fd, &err, &fput_needed); 2078 + struct socket *sock; 2079 2079 2080 + sock = sockfd_lookup_light(fd, &err, &fput_needed); 2080 2081 if (!sock) 2081 2082 goto out; 2082 2083 2083 - err = __sys_sendmsg(sock, msg, &msg_sys, flags, NULL); 2084 + err = ___sys_sendmsg(sock, msg, &msg_sys, flags, NULL); 2084 2085 2085 2086 fput_light(sock->file, fput_needed); 2086 2087 out: 2087 2088 return err; 2089 + } 2090 + 2091 + SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned int, flags) 2092 + { 2093 + if (flags & MSG_CMSG_COMPAT) 2094 + return -EINVAL; 2095 + return __sys_sendmsg(fd, msg, flags); 2088 2096 } 2089 2097 2090 2098 /* ··· 2125 2117 2126 2118 while (datagrams < vlen) { 2127 2119 if (MSG_CMSG_COMPAT & flags) { 2128 - err = __sys_sendmsg(sock, (struct msghdr __user *)compat_entry, 2129 - &msg_sys, flags, &used_address); 2120 + err = ___sys_sendmsg(sock, (struct msghdr __user *)compat_entry, 2121 + &msg_sys, flags, &used_address); 2130 2122 if (err < 0) 2131 2123 break; 2132 2124 err = __put_user(err, &compat_entry->msg_len); 2133 2125 ++compat_entry; 2134 2126 } else { 2135 - err = __sys_sendmsg(sock, (struct msghdr __user *)entry, 2136 - &msg_sys, flags, &used_address); 2127 + err = ___sys_sendmsg(sock, 2128 + (struct msghdr __user *)entry, 2129 + &msg_sys, flags, &used_address); 2137 2130 if (err < 0) 2138 2131 break; 2139 2132 err = put_user(err, &entry->msg_len); ··· 2158 2149 SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg, 2159 2150 unsigned int, vlen, unsigned int, flags) 2160 2151 { 2152 + if (flags & MSG_CMSG_COMPAT) 2153 + return -EINVAL; 2161 2154 return __sys_sendmmsg(fd, mmsg, vlen, flags); 2162 2155 } 2163 2156 2164 - static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg, 2157 + static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg, 2165 2158 struct msghdr *msg_sys, unsigned int flags, int nosec) 2166 2159 { 2167 2160 struct compat_msghdr __user *msg_compat = ··· 2255 2244 * BSD recvmsg interface 2256 2245 */ 2257 2246 2258 - SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, 2259 - unsigned int, flags) 2247 + long __sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags) 2260 2248 { 2261 2249 int fput_needed, err; 2262 2250 struct msghdr msg_sys; 2263 - struct socket *sock = sockfd_lookup_light(fd, &err, &fput_needed); 2251 + struct socket *sock; 2264 2252 2253 + sock = sockfd_lookup_light(fd, &err, &fput_needed); 2265 2254 if (!sock) 2266 2255 goto out; 2267 2256 2268 - err = __sys_recvmsg(sock, msg, &msg_sys, flags, 0); 2257 + err = ___sys_recvmsg(sock, msg, &msg_sys, flags, 0); 2269 2258 2270 2259 fput_light(sock->file, fput_needed); 2271 2260 out: 2272 2261 return err; 2262 + } 2263 + 2264 + SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, 2265 + unsigned int, flags) 2266 + { 2267 + if (flags & MSG_CMSG_COMPAT) 2268 + return -EINVAL; 2269 + return __sys_recvmsg(fd, msg, flags); 2273 2270 } 2274 2271 2275 2272 /* ··· 2317 2298 * No need to ask LSM for more than the first datagram. 2318 2299 */ 2319 2300 if (MSG_CMSG_COMPAT & flags) { 2320 - err = __sys_recvmsg(sock, (struct msghdr __user *)compat_entry, 2321 - &msg_sys, flags & ~MSG_WAITFORONE, 2322 - datagrams); 2301 + err = ___sys_recvmsg(sock, (struct msghdr __user *)compat_entry, 2302 + &msg_sys, flags & ~MSG_WAITFORONE, 2303 + datagrams); 2323 2304 if (err < 0) 2324 2305 break; 2325 2306 err = __put_user(err, &compat_entry->msg_len); 2326 2307 ++compat_entry; 2327 2308 } else { 2328 - err = __sys_recvmsg(sock, (struct msghdr __user *)entry, 2329 - &msg_sys, flags & ~MSG_WAITFORONE, 2330 - datagrams); 2309 + err = ___sys_recvmsg(sock, 2310 + (struct msghdr __user *)entry, 2311 + &msg_sys, flags & ~MSG_WAITFORONE, 2312 + datagrams); 2331 2313 if (err < 0) 2332 2314 break; 2333 2315 err = put_user(err, &entry->msg_len); ··· 2394 2374 { 2395 2375 int datagrams; 2396 2376 struct timespec timeout_sys; 2377 + 2378 + if (flags & MSG_CMSG_COMPAT) 2379 + return -EINVAL; 2397 2380 2398 2381 if (!timeout) 2399 2382 return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL);
+1 -1
net/wireless/nl80211.c
··· 3411 3411 (u32)sinfo->rx_bytes)) 3412 3412 goto nla_put_failure; 3413 3413 if ((sinfo->filled & (STATION_INFO_TX_BYTES | 3414 - NL80211_STA_INFO_TX_BYTES64)) && 3414 + STATION_INFO_TX_BYTES64)) && 3415 3415 nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, 3416 3416 (u32)sinfo->tx_bytes)) 3417 3417 goto nla_put_failure;
+3
net/wireless/sme.c
··· 231 231 mutex_lock(&rdev->sched_scan_mtx); 232 232 233 233 list_for_each_entry(wdev, &rdev->wdev_list, list) { 234 + if (!wdev->netdev) 235 + continue; 236 + 234 237 wdev_lock(wdev); 235 238 if (!netif_running(wdev->netdev)) { 236 239 wdev_unlock(wdev);
+2 -1
net/xfrm/xfrm_policy.c
··· 2557 2557 } 2558 2558 } 2559 2559 2560 - static void xfrm_garbage_collect(struct net *net) 2560 + void xfrm_garbage_collect(struct net *net) 2561 2561 { 2562 2562 flow_cache_flush(); 2563 2563 __xfrm_garbage_collect(net); 2564 2564 } 2565 + EXPORT_SYMBOL(xfrm_garbage_collect); 2565 2566 2566 2567 static void xfrm_garbage_collect_deferred(struct net *net) 2567 2568 {
+2
net/xfrm/xfrm_user.c
··· 1681 1681 1682 1682 out: 1683 1683 xfrm_pol_put(xp); 1684 + if (delete && err == 0) 1685 + xfrm_garbage_collect(net); 1684 1686 return err; 1685 1687 } 1686 1688
+1 -1
scripts/Makefile.lib
··· 264 264 quiet_cmd_dtc = DTC $@ 265 265 cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ 266 266 $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \ 267 - -i $(srctree)/arch/$(SRCARCH)/boot/dts $(DTC_FLAGS) \ 267 + -i $(dir $<) $(DTC_FLAGS) \ 268 268 -d $(depfile).dtc $(dtc-tmp) ; \ 269 269 cat $(depfile).pre $(depfile).dtc > $(depfile) 270 270
+1 -1
scripts/config
··· 105 105 ;; 106 106 --refresh) 107 107 ;; 108 - --*-after) 108 + --*-after|-E|-D|-M) 109 109 checkarg "$1" 110 110 A=$ARG 111 111 checkarg "$2"
+5 -4
scripts/kconfig/lxdialog/menubox.c
··· 303 303 } 304 304 } 305 305 306 - if (i < max_choice || 307 - key == KEY_UP || key == KEY_DOWN || 308 - key == '-' || key == '+' || 309 - key == KEY_PPAGE || key == KEY_NPAGE) { 306 + if (item_count() != 0 && 307 + (i < max_choice || 308 + key == KEY_UP || key == KEY_DOWN || 309 + key == '-' || key == '+' || 310 + key == KEY_PPAGE || key == KEY_NPAGE)) { 310 311 /* Remove highligt of current item */ 311 312 print_item(scroll + choice, choice, FALSE); 312 313
+6 -5
scripts/kconfig/mconf.c
··· 670 670 active_menu, &s_scroll); 671 671 if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) 672 672 break; 673 - if (!item_activate_selected()) 674 - continue; 675 - if (!item_tag()) 676 - continue; 677 - 673 + if (item_count() != 0) { 674 + if (!item_activate_selected()) 675 + continue; 676 + if (!item_tag()) 677 + continue; 678 + } 678 679 submenu = item_data(); 679 680 active_menu = item_data(); 680 681 if (submenu)
+14 -1
scripts/kconfig/menu.c
··· 146 146 struct menu *menu = current_entry; 147 147 148 148 while ((menu = menu->parent) != NULL) { 149 + struct expr *dup_expr; 150 + 149 151 if (!menu->visibility) 150 152 continue; 153 + /* 154 + * Do not add a reference to the 155 + * menu's visibility expression but 156 + * use a copy of it. Otherwise the 157 + * expression reduction functions 158 + * will modify expressions that have 159 + * multiple references which can 160 + * cause unwanted side effects. 161 + */ 162 + dup_expr = expr_copy(menu->visibility); 163 + 151 164 prop->visible.expr 152 165 = expr_alloc_and(prop->visible.expr, 153 - menu->visibility); 166 + dup_expr); 154 167 } 155 168 } 156 169
+14 -20
security/selinux/xfrm.c
··· 316 316 317 317 memcpy(new_ctx, old_ctx, sizeof(*new_ctx)); 318 318 memcpy(new_ctx->ctx_str, old_ctx->ctx_str, new_ctx->ctx_len); 319 + atomic_inc(&selinux_xfrm_refcount); 319 320 *new_ctxp = new_ctx; 320 321 } 321 322 return 0; ··· 327 326 */ 328 327 void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx) 329 328 { 329 + atomic_dec(&selinux_xfrm_refcount); 330 330 kfree(ctx); 331 331 } 332 332 ··· 337 335 int selinux_xfrm_policy_delete(struct xfrm_sec_ctx *ctx) 338 336 { 339 337 const struct task_security_struct *tsec = current_security(); 340 - int rc = 0; 341 338 342 - if (ctx) { 343 - rc = avc_has_perm(tsec->sid, ctx->ctx_sid, 344 - SECCLASS_ASSOCIATION, 345 - ASSOCIATION__SETCONTEXT, NULL); 346 - if (rc == 0) 347 - atomic_dec(&selinux_xfrm_refcount); 348 - } 339 + if (!ctx) 340 + return 0; 349 341 350 - return rc; 342 + return avc_has_perm(tsec->sid, ctx->ctx_sid, 343 + SECCLASS_ASSOCIATION, ASSOCIATION__SETCONTEXT, 344 + NULL); 351 345 } 352 346 353 347 /* ··· 368 370 */ 369 371 void selinux_xfrm_state_free(struct xfrm_state *x) 370 372 { 371 - struct xfrm_sec_ctx *ctx = x->security; 372 - kfree(ctx); 373 + atomic_dec(&selinux_xfrm_refcount); 374 + kfree(x->security); 373 375 } 374 376 375 377 /* ··· 379 381 { 380 382 const struct task_security_struct *tsec = current_security(); 381 383 struct xfrm_sec_ctx *ctx = x->security; 382 - int rc = 0; 383 384 384 - if (ctx) { 385 - rc = avc_has_perm(tsec->sid, ctx->ctx_sid, 386 - SECCLASS_ASSOCIATION, 387 - ASSOCIATION__SETCONTEXT, NULL); 388 - if (rc == 0) 389 - atomic_dec(&selinux_xfrm_refcount); 390 - } 385 + if (!ctx) 386 + return 0; 391 387 392 - return rc; 388 + return avc_has_perm(tsec->sid, ctx->ctx_sid, 389 + SECCLASS_ASSOCIATION, ASSOCIATION__SETCONTEXT, 390 + NULL); 393 391 } 394 392 395 393 /*
+42 -34
sound/pci/hda/hda_generic.c
··· 788 788 return; 789 789 if (codec->inv_eapd) 790 790 enable = !enable; 791 + if (spec->keep_eapd_on && !enable) 792 + return; 791 793 snd_hda_codec_update_cache(codec, pin, 0, 792 794 AC_VERB_SET_EAPD_BTLENABLE, 793 795 enable ? 0x02 : 0x00); ··· 1940 1938 * independent HP controls 1941 1939 */ 1942 1940 1943 - /* update HP auto-mute state too */ 1944 - static void update_hp_automute_hook(struct hda_codec *codec) 1945 - { 1946 - struct hda_gen_spec *spec = codec->spec; 1947 - 1948 - if (spec->hp_automute_hook) 1949 - spec->hp_automute_hook(codec, NULL); 1950 - else 1951 - snd_hda_gen_hp_automute(codec, NULL); 1952 - } 1953 - 1941 + static void call_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack); 1954 1942 static int indep_hp_info(struct snd_kcontrol *kcontrol, 1955 1943 struct snd_ctl_elem_info *uinfo) 1956 1944 { ··· 2001 2009 else 2002 2010 *dacp = spec->alt_dac_nid; 2003 2011 2004 - update_hp_automute_hook(codec); 2012 + call_hp_automute(codec, NULL); 2005 2013 ret = 1; 2006 2014 } 2007 2015 unlock: ··· 2297 2305 else 2298 2306 val = PIN_HP; 2299 2307 set_pin_target(codec, pin, val, true); 2300 - update_hp_automute_hook(codec); 2308 + call_hp_automute(codec, NULL); 2301 2309 } 2302 2310 } 2303 2311 ··· 2706 2714 val = snd_hda_get_default_vref(codec, nid); 2707 2715 } 2708 2716 snd_hda_set_pin_ctl_cache(codec, nid, val); 2709 - update_hp_automute_hook(codec); 2717 + call_hp_automute(codec, NULL); 2710 2718 2711 2719 return 1; 2712 2720 } ··· 3851 3859 } 3852 3860 EXPORT_SYMBOL_HDA(snd_hda_gen_mic_autoswitch); 3853 3861 3862 + /* call appropriate hooks */ 3863 + static void call_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) 3864 + { 3865 + struct hda_gen_spec *spec = codec->spec; 3866 + if (spec->hp_automute_hook) 3867 + spec->hp_automute_hook(codec, jack); 3868 + else 3869 + snd_hda_gen_hp_automute(codec, jack); 3870 + } 3871 + 3872 + static void call_line_automute(struct hda_codec *codec, 3873 + struct hda_jack_tbl *jack) 3874 + { 3875 + struct hda_gen_spec *spec = codec->spec; 3876 + if (spec->line_automute_hook) 3877 + spec->line_automute_hook(codec, jack); 3878 + else 3879 + snd_hda_gen_line_automute(codec, jack); 3880 + } 3881 + 3882 + static void call_mic_autoswitch(struct hda_codec *codec, 3883 + struct hda_jack_tbl *jack) 3884 + { 3885 + struct hda_gen_spec *spec = codec->spec; 3886 + if (spec->mic_autoswitch_hook) 3887 + spec->mic_autoswitch_hook(codec, jack); 3888 + else 3889 + snd_hda_gen_mic_autoswitch(codec, jack); 3890 + } 3891 + 3854 3892 /* update jack retasking */ 3855 3893 static void update_automute_all(struct hda_codec *codec) 3856 3894 { 3857 - struct hda_gen_spec *spec = codec->spec; 3858 - 3859 - update_hp_automute_hook(codec); 3860 - if (spec->line_automute_hook) 3861 - spec->line_automute_hook(codec, NULL); 3862 - else 3863 - snd_hda_gen_line_automute(codec, NULL); 3864 - if (spec->mic_autoswitch_hook) 3865 - spec->mic_autoswitch_hook(codec, NULL); 3866 - else 3867 - snd_hda_gen_mic_autoswitch(codec, NULL); 3895 + call_hp_automute(codec, NULL); 3896 + call_line_automute(codec, NULL); 3897 + call_mic_autoswitch(codec, NULL); 3868 3898 } 3869 3899 3870 3900 /* ··· 4023 4009 snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n", 4024 4010 nid); 4025 4011 snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, 4026 - spec->hp_automute_hook ? 4027 - spec->hp_automute_hook : 4028 - snd_hda_gen_hp_automute); 4012 + call_hp_automute); 4029 4013 spec->detect_hp = 1; 4030 4014 } 4031 4015 ··· 4036 4024 snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid); 4037 4025 snd_hda_jack_detect_enable_callback(codec, nid, 4038 4026 HDA_GEN_FRONT_EVENT, 4039 - spec->line_automute_hook ? 4040 - spec->line_automute_hook : 4041 - snd_hda_gen_line_automute); 4027 + call_line_automute); 4042 4028 spec->detect_lo = 1; 4043 4029 } 4044 4030 spec->automute_lo_possible = spec->detect_hp; ··· 4078 4068 snd_hda_jack_detect_enable_callback(codec, 4079 4069 spec->am_entry[i].pin, 4080 4070 HDA_GEN_MIC_EVENT, 4081 - spec->mic_autoswitch_hook ? 4082 - spec->mic_autoswitch_hook : 4083 - snd_hda_gen_mic_autoswitch); 4071 + call_mic_autoswitch); 4084 4072 return true; 4085 4073 } 4086 4074
+1
sound/pci/hda/hda_generic.h
··· 222 222 unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */ 223 223 unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */ 224 224 unsigned int own_eapd_ctl:1; /* set EAPD by own function */ 225 + unsigned int keep_eapd_on:1; /* don't turn off EAPD automatically */ 225 226 unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */ 226 227 unsigned int indep_hp:1; /* independent HP supported */ 227 228 unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */
+3
sound/pci/hda/patch_realtek.c
··· 3493 3493 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3494 3494 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3495 3495 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3496 + SND_PCI_QUIRK(0x1028, 0x05f8, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3497 + SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3496 3498 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 3497 3499 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), 3498 3500 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), ··· 3532 3530 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), 3533 3531 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), 3534 3532 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), 3533 + SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), 3535 3534 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), 3536 3535 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), 3537 3536 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
+9 -1
sound/pci/hda/patch_via.c
··· 136 136 spec->codec_type = VT1708S; 137 137 spec->no_pin_power_ctl = 1; 138 138 spec->gen.indep_hp = 1; 139 + spec->gen.keep_eapd_on = 1; 139 140 spec->gen.pcm_playback_hook = via_playback_pcm_hook; 140 141 return spec; 141 142 } ··· 232 231 233 232 static void set_widgets_power_state(struct hda_codec *codec) 234 233 { 234 + #if 0 /* FIXME: the assumed connections don't match always with the 235 + * actual routes by the generic parser, so better to disable 236 + * the control for safety. 237 + */ 235 238 struct via_spec *spec = codec->spec; 236 239 if (spec->set_widgets_power_state) 237 240 spec->set_widgets_power_state(codec); 241 + #endif 238 242 } 239 243 240 244 static void update_power_state(struct hda_codec *codec, hda_nid_t nid, ··· 484 478 /* Fix pop noise on headphones */ 485 479 int i; 486 480 for (i = 0; i < spec->gen.autocfg.hp_outs; i++) 487 - snd_hda_set_pin_ctl(codec, spec->gen.autocfg.hp_pins[i], 0); 481 + snd_hda_codec_write(codec, spec->gen.autocfg.hp_pins[i], 482 + 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 483 + 0x00); 488 484 } 489 485 490 486 return 0;
+2 -1
sound/pci/sis7019.c
··· 1341 1341 if (rc) 1342 1342 goto error_out; 1343 1343 1344 - if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0) { 1344 + rc = pci_set_dma_mask(pci, DMA_BIT_MASK(30)); 1345 + if (rc < 0) { 1345 1346 dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA"); 1346 1347 goto error_out_enabled; 1347 1348 }
+1
sound/usb/mixer.c
··· 886 886 case USB_ID(0x046d, 0x0808): 887 887 case USB_ID(0x046d, 0x0809): 888 888 case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ 889 + case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ 889 890 case USB_ID(0x046d, 0x0991): 890 891 /* Most audio usb devices lie about volume resolution. 891 892 * Most Logitech webcams have res = 384.
+12 -2
sound/usb/quirks-table.h
··· 215 215 .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL 216 216 }, 217 217 { 218 - USB_DEVICE(0x046d, 0x0990), 218 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 219 + USB_DEVICE_ID_MATCH_INT_CLASS | 220 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 221 + .idVendor = 0x046d, 222 + .idProduct = 0x0990, 223 + .bInterfaceClass = USB_CLASS_AUDIO, 224 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 219 225 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 220 226 .vendor_name = "Logitech, Inc.", 221 227 .product_name = "QuickCam Pro 9000", ··· 1798 1792 USB_DEVICE_VENDOR_SPEC(0x0582, 0x0108), 1799 1793 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 1800 1794 .ifnum = 0, 1801 - .type = QUIRK_MIDI_STANDARD_INTERFACE 1795 + .type = QUIRK_MIDI_FIXED_ENDPOINT, 1796 + .data = & (const struct snd_usb_midi_endpoint_info) { 1797 + .out_cables = 0x0007, 1798 + .in_cables = 0x0007 1799 + } 1802 1800 } 1803 1801 }, 1804 1802 {