···11* Freescale Smart Direct Memory Access (SDMA) Controller for i.MX2233Required properties:44-- compatible : Should be "fsl,imx31-sdma", "fsl,imx31-to1-sdma",55- "fsl,imx31-to2-sdma", "fsl,imx35-sdma", "fsl,imx35-to1-sdma",66- "fsl,imx35-to2-sdma", "fsl,imx51-sdma", "fsl,imx53-sdma" or77- "fsl,imx6q-sdma". The -to variants should be preferred since they88- allow to determnine the correct ROM script addresses needed for99- the driver to work without additional firmware.44+- compatible : Should be one of55+ "fsl,imx25-sdma"66+ "fsl,imx31-sdma", "fsl,imx31-to1-sdma", "fsl,imx31-to2-sdma"77+ "fsl,imx35-sdma", "fsl,imx35-to1-sdma", "fsl,imx35-to2-sdma"88+ "fsl,imx51-sdma"99+ "fsl,imx53-sdma"1010+ "fsl,imx6q-sdma"1111+ The -to variants should be preferred since they allow to determnine the1212+ correct ROM script addresses needed for the driver to work without additional1313+ firmware.1014- reg : Should contain SDMA registers location and length1115- interrupts : Should contain SDMA interrupt1216- #dma-cells : Must be <3>.
+20-5
MAINTAINERS
···538538ALTERA UART/JTAG UART SERIAL DRIVERS539539M: Tobias Klauser <tklauser@distanz.ch>540540L: linux-serial@vger.kernel.org541541-L: nios2-dev@sopc.et.ntust.edu.tw (moderated for non-subscribers)541541+L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)542542S: Maintained543543F: drivers/tty/serial/altera_uart.c544544F: drivers/tty/serial/altera_jtaguart.c···26112611M: Oliver Neukum <oliver@neukum.org>26122612M: Ali Akcaagac <aliakc@web.de>26132613M: Jamie Lenehan <lenehan@twibble.org>26142614-W: http://twibble.org/dist/dc395x/26152614L: dc395x@twibble.org26162616-L: http://lists.twibble.org/mailman/listinfo/dc395x/26152615+W: http://twibble.org/dist/dc395x/26162616+W: http://lists.twibble.org/mailman/listinfo/dc395x/26172617S: Maintained26182618F: Documentation/scsi/dc395x.txt26192619F: drivers/scsi/dc395x.*···28482848DRM DRIVERS28492849M: David Airlie <airlied@linux.ie>28502850L: dri-devel@lists.freedesktop.org28512851-T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git28512851+T: git git://people.freedesktop.org/~airlied/linux28522852S: Maintained28532853F: drivers/gpu/drm/28542854F: include/drm/28552855F: include/uapi/drm/28562856+28572857+RADEON DRM DRIVERS28582858+M: Alex Deucher <alexander.deucher@amd.com>28592859+M: Christian König <christian.koenig@amd.com>28602860+L: dri-devel@lists.freedesktop.org28612861+T: git git://people.freedesktop.org/~agd5f/linux28622862+S: Supported28632863+F: drivers/gpu/drm/radeon/28642864+F: include/drm/radeon*28652865+F: include/uapi/drm/radeon*2856286628572867INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)28582868M: Daniel Vetter <daniel.vetter@ffwll.ch>···55105500W: http://www.kernel.org/doc/man-pages55115501L: linux-man@vger.kernel.org55125502S: Maintained55035503+55045504+MARVELL ARMADA DRM SUPPORT55055505+M: Russell King <rmk+kernel@arm.linux.org.uk>55065506+S: Maintained55075507+F: drivers/gpu/drm/armada/5513550855145509MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)55155510M: Mirko Lindner <mlindner@marvell.com>···84648449M: Nicholas A. Bellinger <nab@linux-iscsi.org>84658450L: linux-scsi@vger.kernel.org84668451L: target-devel@vger.kernel.org84678467-L: http://groups.google.com/group/linux-iscsi-target-dev84688452W: http://www.linux-iscsi.org84538453+W: http://groups.google.com/group/linux-iscsi-target-dev84698454T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master84708455S: Supported84718456F: drivers/target/
+6-4
Makefile
···11VERSION = 322PATCHLEVEL = 1433SUBLEVEL = 044-EXTRAVERSION = -rc444+EXTRAVERSION = -rc555NAME = Shuffling Zombie Juror6677# *DOCUMENTATION*···605605ifdef CONFIG_CC_STACKPROTECTOR_REGULAR606606 stackp-flag := -fstack-protector607607 ifeq ($(call cc-option, $(stackp-flag)),)608608- $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \609609- -fstack-protector not supported by compiler))608608+ $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \609609+ -fstack-protector not supported by compiler)610610 endif611611-else ifdef CONFIG_CC_STACKPROTECTOR_STRONG611611+else612612+ifdef CONFIG_CC_STACKPROTECTOR_STRONG612613 stackp-flag := -fstack-protector-strong613614 ifeq ($(call cc-option, $(stackp-flag)),)614615 $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \···618617else619618 # Force off for distro compilers that enable stack protector by default.620619 stackp-flag := $(call cc-option, -fno-stack-protector)620620+endif621621endif622622KBUILD_CFLAGS += $(stackp-flag)623623
+2-1
arch/arm/kvm/arm.c
···878878 unsigned long cmd,879879 void *v)880880{881881- if (cmd == CPU_PM_EXIT) {881881+ if (cmd == CPU_PM_EXIT &&882882+ __hyp_get_vectors() == hyp_default_vectors) {882883 cpu_init_hyp_mode(NULL);883884 return NOTIFY_OK;884885 }
+10-1
arch/arm/kvm/interrupts.S
···220220 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are221221 * passed in r0 and r1.222222 *223223+ * A function pointer with a value of 0xffffffff has a special meaning,224224+ * and is used to implement __hyp_get_vectors in the same way as in225225+ * arch/arm/kernel/hyp_stub.S.226226+ *223227 * The calling convention follows the standard AAPCS:224228 * r0 - r3: caller save225229 * r12: caller save···367363host_switch_to_hyp:368364 pop {r0, r1, r2}369365366366+ /* Check for __hyp_get_vectors */367367+ cmp r0, #-1368368+ mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR369369+ beq 1f370370+370371 push {lr}371372 mrs lr, SPSR372373 push {lr}···387378 pop {lr}388379 msr SPSR_csxf, lr389380 pop {lr}390390- eret381381+1: eret391382392383guest_trap:393384 load_vcpu @ Load VCPU pointer to r0
···48484949 frame->sp = fp + 0x10;5050 frame->fp = *(unsigned long *)(fp);5151- frame->pc = *(unsigned long *)(fp + 8);5151+ /*5252+ * -4 here because we care about the PC at time of bl,5353+ * not where the return will go.5454+ */5555+ frame->pc = *(unsigned long *)(fp + 8) - 4;52565357 return 0;5458}
+25-2
arch/arm64/kvm/hyp.S
···694694695695 .align 2696696697697+/*698698+ * u64 kvm_call_hyp(void *hypfn, ...);699699+ *700700+ * This is not really a variadic function in the classic C-way and care must701701+ * be taken when calling this to ensure parameters are passed in registers702702+ * only, since the stack will change between the caller and the callee.703703+ *704704+ * Call the function with the first argument containing a pointer to the705705+ * function you wish to call in Hyp mode, and subsequent arguments will be706706+ * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the707707+ * function pointer can be passed). The function being called must be mapped708708+ * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are709709+ * passed in r0 and r1.710710+ *711711+ * A function pointer with a value of 0 has a special meaning, and is712712+ * used to implement __hyp_get_vectors in the same way as in713713+ * arch/arm64/kernel/hyp_stub.S.714714+ */697715ENTRY(kvm_call_hyp)698716 hvc #0699717 ret···755737 pop x2, x3756738 pop x0, x1757739758758- push lr, xzr740740+ /* Check for __hyp_get_vectors */741741+ cbnz x0, 1f742742+ mrs x0, vbar_el2743743+ b 2f744744+745745+1: push lr, xzr759746760747 /*761748 * Compute the function address in EL2, and shuffle the parameters.···773750 blr lr774751775752 pop lr, xzr776776- eret753753+2: eret777754778755el1_trap:779756 /*
···200200201201 /*202202 * We can't access below the stack pointer in the 32bit ABI and203203- * can access 288 bytes in the 64bit ABI203203+ * can access 288 bytes in the 64bit big-endian ABI,204204+ * or 512 bytes with the new ELFv2 little-endian ABI.204205 */205206 if (!is_32bit_task())206206- usp -= 288;207207+ usp -= USER_REDZONE_SIZE;207208208209 return (void __user *) (usp - len);209210}
···28282929#ifdef __powerpc64__30303131+/*3232+ * Size of redzone that userspace is allowed to use below the stack3333+ * pointer. This is 288 in the 64-bit big-endian ELF ABI, and 512 in3434+ * the new ELFv2 little-endian ABI, so we allow the larger amount.3535+ *3636+ * For kernel code we allow a 288-byte redzone, in order to conserve3737+ * kernel stack space; gcc currently only uses 288 bytes, and will3838+ * hopefully allow explicit control of the redzone size in future.3939+ */4040+#define USER_REDZONE_SIZE 5124141+#define KERNEL_REDZONE_SIZE 2884242+3143#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */3244#define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */3345#define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265)3446#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \3535- STACK_FRAME_OVERHEAD + 288)4747+ STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE)3648#define STACK_FRAME_MARKER 1237493850/* Size of dummy stack frame allocated when calling signal handler. */···53415442#else /* __powerpc64__ */55434444+#define USER_REDZONE_SIZE 04545+#define KERNEL_REDZONE_SIZE 05646#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */5747#define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */5848#define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
···7474 */7575static int test_24bit_addr(unsigned long ip, unsigned long addr)7676{7777+ addr = ppc_function_entry((void *)addr);77787879 /* use the create_branch to verify that this offset can be branched */7980 return create_branch((unsigned int *)ip, addr, 0);
+2-2
arch/powerpc/kernel/signal_64.c
···6565 struct siginfo __user *pinfo;6666 void __user *puc;6767 struct siginfo info;6868- /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */6969- char abigap[288];6868+ /* New 64 bit little-endian ABI allows redzone of 512 bytes below sp */6969+ char abigap[USER_REDZONE_SIZE];7070} __attribute__ ((aligned (16)));71717272static const char fmt32[] = KERN_INFO \
+43-53
arch/powerpc/platforms/powernv/eeh-ioda.c
···114114 ioda_eeh_inbB_dbgfs_set, "0x%llx\n");115115#endif /* CONFIG_DEBUG_FS */116116117117+117118/**118119 * ioda_eeh_post_init - Chip dependent post initialization119120 * @hose: PCI controller···222221 return ret;223222}224223224224+static void ioda_eeh_phb_diag(struct pci_controller *hose)225225+{226226+ struct pnv_phb *phb = hose->private_data;227227+ long rc;228228+229229+ rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob,230230+ PNV_PCI_DIAG_BUF_SIZE);231231+ if (rc != OPAL_SUCCESS) {232232+ pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n",233233+ __func__, hose->global_number, rc);234234+ return;235235+ }236236+237237+ pnv_pci_dump_phb_diag_data(hose, phb->diag.blob);238238+}239239+225240/**226241 * ioda_eeh_get_state - Retrieve the state of PE227242 * @pe: EEH PE···289272 result |= EEH_STATE_DMA_ACTIVE;290273 result |= EEH_STATE_MMIO_ENABLED;291274 result |= EEH_STATE_DMA_ENABLED;275275+ } else if (!(pe->state & EEH_PE_ISOLATED)) {276276+ eeh_pe_state_mark(pe, EEH_PE_ISOLATED);277277+ ioda_eeh_phb_diag(hose);292278 }293279294280 return result;···333313 pr_warning("%s: Unexpected EEH status 0x%x "334314 "on PHB#%x-PE#%x\n",335315 __func__, fstate, hose->global_number, pe_no);316316+ }317317+318318+ /* Dump PHB diag-data for frozen PE */319319+ if (result != EEH_STATE_NOT_SUPPORT &&320320+ (result & (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE)) !=321321+ (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE) &&322322+ !(pe->state & EEH_PE_ISOLATED)) {323323+ eeh_pe_state_mark(pe, EEH_PE_ISOLATED);324324+ ioda_eeh_phb_diag(hose);336325 }337326338327 return result;···559530}560531561532/**562562- * ioda_eeh_get_log - Retrieve error log563563- * @pe: EEH PE564564- * @severity: Severity level of the log565565- * @drv_log: buffer to store the log566566- * @len: space of the log buffer567567- *568568- * The function is used to retrieve error log from P7IOC.569569- */570570-static int ioda_eeh_get_log(struct eeh_pe *pe, int severity,571571- char *drv_log, unsigned long len)572572-{573573- s64 ret;574574- unsigned long flags;575575- struct pci_controller *hose = pe->phb;576576- struct pnv_phb *phb = hose->private_data;577577-578578- spin_lock_irqsave(&phb->lock, flags);579579-580580- ret = opal_pci_get_phb_diag_data2(phb->opal_id,581581- phb->diag.blob, PNV_PCI_DIAG_BUF_SIZE);582582- if (ret) {583583- spin_unlock_irqrestore(&phb->lock, flags);584584- pr_warning("%s: Can't get log for PHB#%x-PE#%x (%lld)\n",585585- __func__, hose->global_number, pe->addr, ret);586586- return -EIO;587587- }588588-589589- /* The PHB diag-data is always indicative */590590- pnv_pci_dump_phb_diag_data(hose, phb->diag.blob);591591-592592- spin_unlock_irqrestore(&phb->lock, flags);593593-594594- return 0;595595-}596596-597597-/**598533 * ioda_eeh_configure_bridge - Configure the PCI bridges for the indicated PE599534 * @pe: EEH PE600535 *···637644 pr_warning("%s: Invalid type of HUB#%llx diag-data (%d)\n",638645 __func__, phb->hub_id, data->type);639646 }640640-}641641-642642-static void ioda_eeh_phb_diag(struct pci_controller *hose)643643-{644644- struct pnv_phb *phb = hose->private_data;645645- long rc;646646-647647- rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob,648648- PNV_PCI_DIAG_BUF_SIZE);649649- if (rc != OPAL_SUCCESS) {650650- pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n",651651- __func__, hose->global_number, rc);652652- return;653653- }654654-655655- pnv_pci_dump_phb_diag_data(hose, phb->diag.blob);656647}657648658649static int ioda_eeh_get_phb_pe(struct pci_controller *hose,···812835 }813836814837 /*838838+ * EEH core will try recover from fenced PHB or839839+ * frozen PE. In the time for frozen PE, EEH core840840+ * enable IO path for that before collecting logs,841841+ * but it ruins the site. So we have to dump the842842+ * log in advance here.843843+ */844844+ if ((ret == EEH_NEXT_ERR_FROZEN_PE ||845845+ ret == EEH_NEXT_ERR_FENCED_PHB) &&846846+ !((*pe)->state & EEH_PE_ISOLATED)) {847847+ eeh_pe_state_mark(*pe, EEH_PE_ISOLATED);848848+ ioda_eeh_phb_diag(hose);849849+ }850850+851851+ /*815852 * If we have no errors on the specific PHB or only816853 * informative error there, we continue poking it.817854 * Otherwise, we need actions to be taken by upper···843852 .set_option = ioda_eeh_set_option,844853 .get_state = ioda_eeh_get_state,845854 .reset = ioda_eeh_reset,846846- .get_log = ioda_eeh_get_log,847855 .configure_bridge = ioda_eeh_configure_bridge,848856 .next_error = ioda_eeh_next_error849857};
+12-9
arch/powerpc/platforms/powernv/opal-xscom.c
···7171 }7272}73737474-static u64 opal_scom_unmangle(u64 reg)7474+static u64 opal_scom_unmangle(u64 addr)7575{7676 /*7777 * XSCOM indirect addresses have the top bit set. Additionally7878- * the reset of the top 3 nibbles is always 0.7878+ * the rest of the top 3 nibbles is always 0.7979 *8080 * Because the debugfs interface uses signed offsets and shifts8181 * the address left by 3, we basically cannot use the top 4 bits···8686 * conversion here. To leave room for further xscom address8787 * expansion, we only clear out the top byte8888 *8989+ * For in-kernel use, we also support the real indirect bit, so9090+ * we test for any of the top 5 bits9191+ *8992 */9090- if (reg & (1ull << 59))9191- reg = (reg & ~(0xffull << 56)) | (1ull << 63);9292- return reg;9393+ if (addr & (0x1full << 59))9494+ addr = (addr & ~(0xffull << 56)) | (1ull << 63);9595+ return addr;9396}94979598static int opal_scom_read(scom_map_t map, u64 reg, u64 *value)···10198 int64_t rc;10299 __be64 v;103100104104- reg = opal_scom_unmangle(reg);105105- rc = opal_xscom_read(m->chip, m->addr + reg, (__be64 *)__pa(&v));101101+ reg = opal_scom_unmangle(m->addr + reg);102102+ rc = opal_xscom_read(m->chip, reg, (__be64 *)__pa(&v));106103 *value = be64_to_cpu(v);107104 return opal_xscom_err_xlate(rc);108105}···112109 struct opal_scom_map *m = map;113110 int64_t rc;114111115115- reg = opal_scom_unmangle(reg);116116- rc = opal_xscom_write(m->chip, m->addr + reg, value);112112+ reg = opal_scom_unmangle(m->addr + reg);113113+ rc = opal_xscom_write(m->chip, reg, value);117114 return opal_xscom_err_xlate(rc);118115}119116
···206206 zdev->dma_table = NULL;207207}208208209209-static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, unsigned long start,210210- int size)209209+static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev,210210+ unsigned long start, int size)211211{212212- unsigned long boundary_size = 0x1000000;212212+ unsigned long boundary_size;213213214214+ boundary_size = ALIGN(dma_get_seg_boundary(&zdev->pdev->dev) + 1,215215+ PAGE_SIZE) >> PAGE_SHIFT;214216 return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages,215217 start, size, 0, boundary_size, 0);216218}
+5-4
arch/x86/boot/compressed/aslr.c
···111111};112112113113#define MEM_AVOID_MAX 5114114-struct mem_vector mem_avoid[MEM_AVOID_MAX];114114+static struct mem_vector mem_avoid[MEM_AVOID_MAX];115115116116static bool mem_contains(struct mem_vector *region, struct mem_vector *item)117117{···180180}181181182182/* Does this memory vector overlap a known avoided area? */183183-bool mem_avoid_overlap(struct mem_vector *img)183183+static bool mem_avoid_overlap(struct mem_vector *img)184184{185185 int i;186186···192192 return false;193193}194194195195-unsigned long slots[CONFIG_RANDOMIZE_BASE_MAX_OFFSET / CONFIG_PHYSICAL_ALIGN];196196-unsigned long slot_max = 0;195195+static unsigned long slots[CONFIG_RANDOMIZE_BASE_MAX_OFFSET /196196+ CONFIG_PHYSICAL_ALIGN];197197+static unsigned long slot_max;197198198199static void slots_append(unsigned long addr)199200{
+3
arch/x86/kernel/cpu/perf_event.c
···11921192 for (i = 0; i < cpuc->n_events; i++) {11931193 if (event == cpuc->event_list[i]) {1194119411951195+ if (i >= cpuc->n_events - cpuc->n_added)11961196+ --cpuc->n_added;11971197+11951198 if (x86_pmu.put_event_constraints)11961199 x86_pmu.put_event_constraints(cpuc, event);11971200
···1081108110821082 rsr a0, sar10831083 s32i a3, a2, PT_AREG310841084+ s32i a0, a2, PT_SAR10851085+10861086+ /* The spill routine might clobber a4, a7, a8, a11, a12, and a15. */10871087+10841088 s32i a4, a2, PT_AREG410851085- s32i a0, a2, PT_AREG5 # store SAR to PT_AREG510861086-10871087- /* The spill routine might clobber a7, a11, and a15. */10881088-10891089 s32i a7, a2, PT_AREG710901090+ s32i a8, a2, PT_AREG810901091 s32i a11, a2, PT_AREG1110921092+ s32i a12, a2, PT_AREG1210911093 s32i a15, a2, PT_AREG151092109410931093- call0 _spill_registers # destroys a3, a4, and SAR10951095+ /*10961096+ * Rotate ws so that the current windowbase is at bit 0.10971097+ * Assume ws = xxxwww1yy (www1 current window frame).10981098+ * Rotate ws right so that a4 = yyxxxwww1.10991099+ */11001100+11011101+ rsr a0, windowbase11021102+ rsr a3, windowstart # a3 = xxxwww1yy11031103+ ssr a0 # holds WB11041104+ slli a0, a3, WSBITS11051105+ or a3, a3, a0 # a3 = xxxwww1yyxxxwww1yy11061106+ srl a3, a3 # a3 = 00xxxwww1yyxxxwww111071107+11081108+ /* We are done if there are no more than the current register frame. */11091109+11101110+ extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww11111111+ movi a0, (1 << (WSBITS-1))11121112+ _beqz a3, .Lnospill # only one active frame? jump11131113+11141114+ /* We want 1 at the top, so that we return to the current windowbase */11151115+11161116+ or a3, a3, a0 # 1yyxxxwww11171117+11181118+ /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */11191119+11201120+ wsr a3, windowstart # save shifted windowstart11211121+ neg a0, a311221122+ and a3, a0, a3 # first bit set from right: 00001000011231123+11241124+ ffs_ws a0, a3 # a0: shifts to skip empty frames11251125+ movi a3, WSBITS11261126+ sub a0, a3, a0 # WSBITS-a0:number of 0-bits from right11271127+ ssr a0 # save in SAR for later.11281128+11291129+ rsr a3, windowbase11301130+ add a3, a3, a011311131+ wsr a3, windowbase11321132+ rsync11331133+11341134+ rsr a3, windowstart11351135+ srl a3, a3 # shift windowstart11361136+11371137+ /* WB is now just one frame below the oldest frame in the register11381138+ window. WS is shifted so the oldest frame is in bit 0, thus, WB11391139+ and WS differ by one 4-register frame. */11401140+11411141+ /* Save frames. Depending what call was used (call4, call8, call12),11421142+ * we have to save 4,8. or 12 registers.11431143+ */11441144+11451145+11461146+.Lloop: _bbsi.l a3, 1, .Lc411471147+ _bbci.l a3, 2, .Lc1211481148+11491149+.Lc8: s32e a4, a13, -1611501150+ l32e a4, a5, -1211511151+ s32e a8, a4, -3211521152+ s32e a5, a13, -1211531153+ s32e a6, a13, -811541154+ s32e a7, a13, -411551155+ s32e a9, a4, -2811561156+ s32e a10, a4, -2411571157+ s32e a11, a4, -2011581158+ srli a11, a3, 2 # shift windowbase by 211591159+ rotw 211601160+ _bnei a3, 1, .Lloop11611161+ j .Lexit11621162+11631163+.Lc4: s32e a4, a9, -1611641164+ s32e a5, a9, -1211651165+ s32e a6, a9, -811661166+ s32e a7, a9, -411671167+11681168+ srli a7, a3, 111691169+ rotw 111701170+ _bnei a3, 1, .Lloop11711171+ j .Lexit11721172+11731173+.Lc12: _bbci.l a3, 3, .Linvalid_mask # bit 2 shouldn't be zero!11741174+11751175+ /* 12-register frame (call12) */11761176+11771177+ l32e a0, a5, -1211781178+ s32e a8, a0, -4811791179+ mov a8, a011801180+11811181+ s32e a9, a8, -4411821182+ s32e a10, a8, -4011831183+ s32e a11, a8, -3611841184+ s32e a12, a8, -3211851185+ s32e a13, a8, -2811861186+ s32e a14, a8, -2411871187+ s32e a15, a8, -2011881188+ srli a15, a3, 311891189+11901190+ /* The stack pointer for a4..a7 is out of reach, so we rotate the11911191+ * window, grab the stackpointer, and rotate back.11921192+ * Alternatively, we could also use the following approach, but that11931193+ * makes the fixup routine much more complicated:11941194+ * rotw 111951195+ * s32e a0, a13, -1611961196+ * ...11971197+ * rotw 211981198+ */11991199+12001200+ rotw 112011201+ mov a4, a1312021202+ rotw -112031203+12041204+ s32e a4, a8, -1612051205+ s32e a5, a8, -1212061206+ s32e a6, a8, -812071207+ s32e a7, a8, -412081208+12091209+ rotw 312101210+12111211+ _beqi a3, 1, .Lexit12121212+ j .Lloop12131213+12141214+.Lexit:12151215+12161216+ /* Done. Do the final rotation and set WS */12171217+12181218+ rotw 112191219+ rsr a3, windowbase12201220+ ssl a312211221+ movi a3, 112221222+ sll a3, a312231223+ wsr a3, windowstart12241224+.Lnospill:1094122510951226 /* Advance PC, restore registers and SAR, and return from exception. */1096122710971097- l32i a3, a2, PT_AREG510981098- l32i a4, a2, PT_AREG412281228+ l32i a3, a2, PT_SAR10991229 l32i a0, a2, PT_AREG011001230 wsr a3, sar11011231 l32i a3, a2, PT_AREG31102123211031233 /* Restore clobbered registers. */1104123412351235+ l32i a4, a2, PT_AREG411051236 l32i a7, a2, PT_AREG712371237+ l32i a8, a2, PT_AREG811061238 l32i a11, a2, PT_AREG1112391239+ l32i a12, a2, PT_AREG1211071240 l32i a15, a2, PT_AREG151108124111091242 movi a2, 011101243 rfe12441244+12451245+.Linvalid_mask:12461246+12471247+ /* We get here because of an unrecoverable error in the window12481248+ * registers, so set up a dummy frame and kill the user application.12491249+ * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer.12501250+ */12511251+12521252+ movi a0, 112531253+ movi a1, 012541254+12551255+ wsr a0, windowstart12561256+ wsr a1, windowbase12571257+ rsync12581258+12591259+ movi a0, 012601260+12611261+ rsr a3, excsave112621262+ l32i a1, a3, EXC_TABLE_KSTK12631263+12641264+ movi a4, (1 << PS_WOE_BIT) | LOCKLEVEL12651265+ wsr a4, ps12661266+ rsync12671267+12681268+ movi a6, SIGSEGV12691269+ movi a4, do_exit12701270+ callx4 a412711271+12721272+ /* shouldn't return, so panic */12731273+12741274+ wsr a0, excsave112751275+ movi a0, unrecoverable_exception12761276+ callx0 a0 # should not return12771277+1: j 1b12781278+1111127911121280ENDPROC(fast_syscall_spill_registers)11131281···12841116 * We get here if the spill routine causes an exception, e.g. tlb miss.12851117 * We basically restore WINDOWBASE and WINDOWSTART to the condition when12861118 * we entered the spill routine and jump to the user exception handler.11191119+ *11201120+ * Note that we only need to restore the bits in windowstart that have not11211121+ * been spilled yet by the _spill_register routine. Luckily, a3 contains a11221122+ * rotated windowstart with only those bits set for frames that haven't been11231123+ * spilled yet. Because a3 is rotated such that bit 0 represents the register11241124+ * frame for the current windowbase - 1, we need to rotate a3 left by the11251125+ * value of the current windowbase + 1 and move it to windowstart.12871126 *12881127 * a0: value of depc, original value in depc12891128 * a2: trashed, original value in EXC_TABLE_DOUBLE_SAVE···13061131 /* We need to make sure the current registers (a0-a3) are preserved.13071132 * To do this, we simply set the bit for the current window frame13081133 * in WS, so that the exception handlers save them to the task stack.11341134+ *11351135+ * Note: we use a3 to set the windowbase, so we take a special care11361136+ * of it, saving it in the original _spill_registers frame across11371137+ * the exception handler call.13091138 */1310113913111140 xsr a3, excsave1 # get spill-mask13121141 slli a3, a3, 1 # shift left by one11421142+ addi a3, a3, 1 # set the bit for the current window frame1313114313141144 slli a2, a3, 32-WSBITS13151145 src a2, a3, a2 # a2 = xxwww1yyxxxwww1yy......···13991219 rfde1400122014011221ENDPROC(fast_syscall_spill_registers_fixup_return)14021402-14031403-/*14041404- * spill all registers.14051405- *14061406- * This is not a real function. The following conditions must be met:14071407- *14081408- * - must be called with call0.14091409- * - uses a3, a4 and SAR.14101410- * - the last 'valid' register of each frame are clobbered.14111411- * - the caller must have registered a fixup handler14121412- * (or be inside a critical section)14131413- * - PS_EXCM must be set (PS_WOE cleared?)14141414- */14151415-14161416-ENTRY(_spill_registers)14171417-14181418- /*14191419- * Rotate ws so that the current windowbase is at bit 0.14201420- * Assume ws = xxxwww1yy (www1 current window frame).14211421- * Rotate ws right so that a4 = yyxxxwww1.14221422- */14231423-14241424- rsr a4, windowbase14251425- rsr a3, windowstart # a3 = xxxwww1yy14261426- ssr a4 # holds WB14271427- slli a4, a3, WSBITS14281428- or a3, a3, a4 # a3 = xxxwww1yyxxxwww1yy14291429- srl a3, a3 # a3 = 00xxxwww1yyxxxwww114301430-14311431- /* We are done if there are no more than the current register frame. */14321432-14331433- extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww14341434- movi a4, (1 << (WSBITS-1))14351435- _beqz a3, .Lnospill # only one active frame? jump14361436-14371437- /* We want 1 at the top, so that we return to the current windowbase */14381438-14391439- or a3, a3, a4 # 1yyxxxwww14401440-14411441- /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */14421442-14431443- wsr a3, windowstart # save shifted windowstart14441444- neg a4, a314451445- and a3, a4, a3 # first bit set from right: 00001000014461446-14471447- ffs_ws a4, a3 # a4: shifts to skip empty frames14481448- movi a3, WSBITS14491449- sub a4, a3, a4 # WSBITS-a4:number of 0-bits from right14501450- ssr a4 # save in SAR for later.14511451-14521452- rsr a3, windowbase14531453- add a3, a3, a414541454- wsr a3, windowbase14551455- rsync14561456-14571457- rsr a3, windowstart14581458- srl a3, a3 # shift windowstart14591459-14601460- /* WB is now just one frame below the oldest frame in the register14611461- window. WS is shifted so the oldest frame is in bit 0, thus, WB14621462- and WS differ by one 4-register frame. */14631463-14641464- /* Save frames. Depending what call was used (call4, call8, call12),14651465- * we have to save 4,8. or 12 registers.14661466- */14671467-14681468- _bbsi.l a3, 1, .Lc414691469- _bbsi.l a3, 2, .Lc814701470-14711471- /* Special case: we have a call12-frame starting at a4. */14721472-14731473- _bbci.l a3, 3, .Lc12 # bit 3 shouldn't be zero! (Jump to Lc12 first)14741474-14751475- s32e a4, a1, -16 # a1 is valid with an empty spill area14761476- l32e a4, a5, -1214771477- s32e a8, a4, -4814781478- mov a8, a414791479- l32e a4, a1, -1614801480- j .Lc12c14811481-14821482-.Lnospill:14831483- ret14841484-14851485-.Lloop: _bbsi.l a3, 1, .Lc414861486- _bbci.l a3, 2, .Lc1214871487-14881488-.Lc8: s32e a4, a13, -1614891489- l32e a4, a5, -1214901490- s32e a8, a4, -3214911491- s32e a5, a13, -1214921492- s32e a6, a13, -814931493- s32e a7, a13, -414941494- s32e a9, a4, -2814951495- s32e a10, a4, -2414961496- s32e a11, a4, -2014971497-14981498- srli a11, a3, 2 # shift windowbase by 214991499- rotw 215001500- _bnei a3, 1, .Lloop15011501-15021502-.Lexit: /* Done. Do the final rotation, set WS, and return. */15031503-15041504- rotw 115051505- rsr a3, windowbase15061506- ssl a315071507- movi a3, 115081508- sll a3, a315091509- wsr a3, windowstart15101510- ret15111511-15121512-.Lc4: s32e a4, a9, -1615131513- s32e a5, a9, -1215141514- s32e a6, a9, -815151515- s32e a7, a9, -415161516-15171517- srli a7, a3, 115181518- rotw 115191519- _bnei a3, 1, .Lloop15201520- j .Lexit15211521-15221522-.Lc12: _bbci.l a3, 3, .Linvalid_mask # bit 2 shouldn't be zero!15231523-15241524- /* 12-register frame (call12) */15251525-15261526- l32e a2, a5, -1215271527- s32e a8, a2, -4815281528- mov a8, a215291529-15301530-.Lc12c: s32e a9, a8, -4415311531- s32e a10, a8, -4015321532- s32e a11, a8, -3615331533- s32e a12, a8, -3215341534- s32e a13, a8, -2815351535- s32e a14, a8, -2415361536- s32e a15, a8, -2015371537- srli a15, a3, 315381538-15391539- /* The stack pointer for a4..a7 is out of reach, so we rotate the15401540- * window, grab the stackpointer, and rotate back.15411541- * Alternatively, we could also use the following approach, but that15421542- * makes the fixup routine much more complicated:15431543- * rotw 115441544- * s32e a0, a13, -1615451545- * ...15461546- * rotw 215471547- */15481548-15491549- rotw 115501550- mov a5, a1315511551- rotw -115521552-15531553- s32e a4, a9, -1615541554- s32e a5, a9, -1215551555- s32e a6, a9, -815561556- s32e a7, a9, -415571557-15581558- rotw 315591559-15601560- _beqi a3, 1, .Lexit15611561- j .Lloop15621562-15631563-.Linvalid_mask:15641564-15651565- /* We get here because of an unrecoverable error in the window15661566- * registers. If we are in user space, we kill the application,15671567- * however, this condition is unrecoverable in kernel space.15681568- */15691569-15701570- rsr a0, ps15711571- _bbci.l a0, PS_UM_BIT, 1f15721572-15731573- /* User space: Setup a dummy frame and kill application.15741574- * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer.15751575- */15761576-15771577- movi a0, 115781578- movi a1, 015791579-15801580- wsr a0, windowstart15811581- wsr a1, windowbase15821582- rsync15831583-15841584- movi a0, 015851585-15861586- rsr a3, excsave115871587- l32i a1, a3, EXC_TABLE_KSTK15881588-15891589- movi a4, (1 << PS_WOE_BIT) | LOCKLEVEL15901590- wsr a4, ps15911591- rsync15921592-15931593- movi a6, SIGSEGV15941594- movi a4, do_exit15951595- callx4 a415961596-15971597-1: /* Kernel space: PANIC! */15981598-15991599- wsr a0, excsave116001600- movi a0, unrecoverable_exception16011601- callx0 a0 # should not return16021602-1: j 1b16031603-16041604-ENDPROC(_spill_registers)1605122216061223#ifdef CONFIG_MMU16071224/*···1771179417721795ENDPROC(system_call)1773179617971797+/*17981798+ * Spill live registers on the kernel stack macro.17991799+ *18001800+ * Entry condition: ps.woe is set, ps.excm is cleared18011801+ * Exit condition: windowstart has single bit set18021802+ * May clobber: a12, a1318031803+ */18041804+ .macro spill_registers_kernel18051805+18061806+#if XCHAL_NUM_AREGS > 1618071807+ call12 1f18081808+ _j 2f18091809+ retw18101810+ .align 418111811+1:18121812+ _entry a1, 4818131813+ addi a12, a0, 318141814+#if XCHAL_NUM_AREGS > 3218151815+ .rept (XCHAL_NUM_AREGS - 32) / 1218161816+ _entry a1, 4818171817+ mov a12, a018181818+ .endr18191819+#endif18201820+ _entry a1, 4818211821+#if XCHAL_NUM_AREGS % 12 == 018221822+ mov a8, a818231823+#elif XCHAL_NUM_AREGS % 12 == 418241824+ mov a12, a1218251825+#elif XCHAL_NUM_AREGS % 12 == 818261826+ mov a4, a418271827+#endif18281828+ retw18291829+2:18301830+#else18311831+ mov a12, a1218321832+#endif18331833+ .endm1774183417751835/*17761836 * Task switch.···1820180618211807 entry a1, 161822180818231823- mov a12, a2 # preserve 'prev' (a2)18241824- mov a13, a3 # and 'next' (a3)18091809+ mov a10, a2 # preserve 'prev' (a2)18101810+ mov a11, a3 # and 'next' (a3)1825181118261812 l32i a4, a2, TASK_THREAD_INFO18271813 l32i a5, a3, TASK_THREAD_INFO1828181418291829- save_xtregs_user a4 a6 a8 a9 a10 a11 THREAD_XTREGS_USER18151815+ save_xtregs_user a4 a6 a8 a9 a12 a13 THREAD_XTREGS_USER1830181618311831- s32i a0, a12, THREAD_RA # save return address18321832- s32i a1, a12, THREAD_SP # save stack pointer18171817+ s32i a0, a10, THREAD_RA # save return address18181818+ s32i a1, a10, THREAD_SP # save stack pointer1833181918341820 /* Disable ints while we manipulate the stack pointer. */1835182118361836- movi a14, (1 << PS_EXCM_BIT) | LOCKLEVEL18371837- xsr a14, ps18221822+ rsil a14, LOCKLEVEL18381823 rsr a3, excsave118391824 rsync18401825 s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */···1848183518491836 /* Flush register file. */1850183718511851- call0 _spill_registers # destroys a3, a4, and SAR18381838+ spill_registers_kernel1852183918531840 /* Set kernel stack (and leave critical section)18541841 * Note: It's save to set it here. The stack will not be overwritten···1864185118651852 /* restore context of the task 'next' */1866185318671867- l32i a0, a13, THREAD_RA # restore return address18681868- l32i a1, a13, THREAD_SP # restore stack pointer18541854+ l32i a0, a11, THREAD_RA # restore return address18551855+ l32i a1, a11, THREAD_SP # restore stack pointer1869185618701870- load_xtregs_user a5 a6 a8 a9 a10 a11 THREAD_XTREGS_USER18571857+ load_xtregs_user a5 a6 a8 a9 a12 a13 THREAD_XTREGS_USER1871185818721859 wsr a14, ps18731873- mov a2, a12 # return 'prev'18601860+ mov a2, a10 # return 'prev'18741861 rsync1875186218761863 retw
···122122EXPORT_SYMBOL(insl);123123124124extern long common_exception_return;125125-extern long _spill_registers;126125EXPORT_SYMBOL(common_exception_return);127127-EXPORT_SYMBOL(_spill_registers);128126129127#ifdef CONFIG_FUNCTION_TRACER130128EXPORT_SYMBOL(_mcount);
+9-4
arch/xtensa/mm/init.c
···909091919292/*9393- * Initialize the bootmem system and give it all the memory we have available.9393+ * Initialize the bootmem system and give it all low memory we have available.9494 */95959696void __init bootmem_init(void)···142142143143 /* Add all remaining memory pieces into the bootmem map */144144145145- for (i=0; i<sysmem.nr_banks; i++)146146- free_bootmem(sysmem.bank[i].start,147147- sysmem.bank[i].end - sysmem.bank[i].start);145145+ for (i = 0; i < sysmem.nr_banks; i++) {146146+ if (sysmem.bank[i].start >> PAGE_SHIFT < max_low_pfn) {147147+ unsigned long end = min(max_low_pfn << PAGE_SHIFT,148148+ sysmem.bank[i].end);149149+ free_bootmem(sysmem.bank[i].start,150150+ end - sysmem.bank[i].start);151151+ }152152+ }148153149154}150155
+1-1
arch/xtensa/mm/mmu.c
···3939 set_itlbcfg_register(0);4040 set_dtlbcfg_register(0);4141#endif4242-#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF4242+#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)4343 /*4444 * Update the IO area mapping in case xtensa_kio_paddr has changed4545 */
+4-3
arch/xtensa/platforms/xtfpga/setup.c
···135135136136static int __init machine_setup(void)137137{138138- struct device_node *serial;138138+ struct device_node *clock;139139 struct device_node *eth = NULL;140140141141- for_each_compatible_node(serial, NULL, "ns16550a")142142- update_clock_frequency(serial);141141+ for_each_node_by_name(clock, "main-oscillator")142142+ update_clock_frequency(clock);143143144144 if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))145145 update_local_mac(eth);···290290 * knows whether they set it correctly on the DIP switches.291291 */292292 pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr);293293+ ethoc_pdata.eth_clkfreq = *(long *)XTFPGA_CLKFRQ_VADDR;293294294295 return 0;295296}
+2-7
arch/xtensa/variants/fsf/include/variant/tie.h
···1818#define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */1919#define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */20202121-/* Basic parameters of each coprocessor: */2222-#define XCHAL_CP7_NAME "XTIOP"2323-#define XCHAL_CP7_IDENT XTIOP2424-#define XCHAL_CP7_SA_SIZE 0 /* size of state save area */2525-#define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */2626-#define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */2727-2821/* Filler info for unassigned coprocessors, to simplify arrays etc: */2922#define XCHAL_NCP_SA_SIZE 03023#define XCHAL_NCP_SA_ALIGN 1···3542#define XCHAL_CP5_SA_ALIGN 13643#define XCHAL_CP6_SA_SIZE 03744#define XCHAL_CP6_SA_ALIGN 14545+#define XCHAL_CP7_SA_SIZE 04646+#define XCHAL_CP7_SA_ALIGN 138473948/* Save area for non-coprocessor optional and custom (TIE) state: */4049#define XCHAL_NCP_SA_SIZE 0
+32-37
drivers/acpi/processor_throttling.c
···5656 int target_state; /* target T-state */5757};58585959+struct acpi_processor_throttling_arg {6060+ struct acpi_processor *pr;6161+ int target_state;6262+ bool force;6363+};6464+5965#define THROTTLING_PRECHANGE (1)6066#define THROTTLING_POSTCHANGE (2)6167···10661060 return 0;10671061}1068106210631063+static long acpi_processor_throttling_fn(void *data)10641064+{10651065+ struct acpi_processor_throttling_arg *arg = data;10661066+ struct acpi_processor *pr = arg->pr;10671067+10681068+ return pr->throttling.acpi_processor_set_throttling(pr,10691069+ arg->target_state, arg->force);10701070+}10711071+10691072int acpi_processor_set_throttling(struct acpi_processor *pr,10701073 int state, bool force)10711074{10721072- cpumask_var_t saved_mask;10731075 int ret = 0;10741076 unsigned int i;10751077 struct acpi_processor *match_pr;10761078 struct acpi_processor_throttling *p_throttling;10791079+ struct acpi_processor_throttling_arg arg;10771080 struct throttling_tstate t_state;10781078- cpumask_var_t online_throttling_cpus;1079108110801082 if (!pr)10811083 return -EINVAL;···10941080 if ((state < 0) || (state > (pr->throttling.state_count - 1)))10951081 return -EINVAL;1096108210971097- if (!alloc_cpumask_var(&saved_mask, GFP_KERNEL))10981098- return -ENOMEM;10991099-11001100- if (!alloc_cpumask_var(&online_throttling_cpus, GFP_KERNEL)) {11011101- free_cpumask_var(saved_mask);11021102- return -ENOMEM;11031103- }11041104-11051083 if (cpu_is_offline(pr->id)) {11061084 /*11071085 * the cpu pointed by pr->id is offline. Unnecessary to change···11021096 return -ENODEV;11031097 }1104109811051105- cpumask_copy(saved_mask, ¤t->cpus_allowed);11061099 t_state.target_state = state;11071100 p_throttling = &(pr->throttling);11081108- cpumask_and(online_throttling_cpus, cpu_online_mask,11091109- p_throttling->shared_cpu_map);11011101+11101102 /*11111103 * The throttling notifier will be called for every11121104 * affected cpu in order to get one proper T-state.11131105 * The notifier event is THROTTLING_PRECHANGE.11141106 */11151115- for_each_cpu(i, online_throttling_cpus) {11071107+ for_each_cpu_and(i, cpu_online_mask, p_throttling->shared_cpu_map) {11161108 t_state.cpu = i;11171109 acpi_processor_throttling_notifier(THROTTLING_PRECHANGE,11181110 &t_state);···11221118 * it can be called only for the cpu pointed by pr.11231119 */11241120 if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) {11251125- /* FIXME: use work_on_cpu() */11261126- if (set_cpus_allowed_ptr(current, cpumask_of(pr->id))) {11271127- /* Can't migrate to the pr->id CPU. Exit */11281128- ret = -ENODEV;11291129- goto exit;11301130- }11311131- ret = p_throttling->acpi_processor_set_throttling(pr,11321132- t_state.target_state, force);11211121+ arg.pr = pr;11221122+ arg.target_state = state;11231123+ arg.force = force;11241124+ ret = work_on_cpu(pr->id, acpi_processor_throttling_fn, &arg);11331125 } else {11341126 /*11351127 * When the T-state coordination is SW_ALL or HW_ALL,11361128 * it is necessary to set T-state for every affected11371129 * cpus.11381130 */11391139- for_each_cpu(i, online_throttling_cpus) {11311131+ for_each_cpu_and(i, cpu_online_mask,11321132+ p_throttling->shared_cpu_map) {11401133 match_pr = per_cpu(processors, i);11411134 /*11421135 * If the pointer is invalid, we will report the···11541153 "on CPU %d\n", i));11551154 continue;11561155 }11571157- t_state.cpu = i;11581158- /* FIXME: use work_on_cpu() */11591159- if (set_cpus_allowed_ptr(current, cpumask_of(i)))11601160- continue;11611161- ret = match_pr->throttling.11621162- acpi_processor_set_throttling(11631163- match_pr, t_state.target_state, force);11561156+11571157+ arg.pr = match_pr;11581158+ arg.target_state = state;11591159+ arg.force = force;11601160+ ret = work_on_cpu(pr->id, acpi_processor_throttling_fn,11611161+ &arg);11641162 }11651163 }11661164 /*···11681168 * affected cpu to update the T-states.11691169 * The notifier event is THROTTLING_POSTCHANGE11701170 */11711171- for_each_cpu(i, online_throttling_cpus) {11711171+ for_each_cpu_and(i, cpu_online_mask, p_throttling->shared_cpu_map) {11721172 t_state.cpu = i;11731173 acpi_processor_throttling_notifier(THROTTLING_POSTCHANGE,11741174 &t_state);11751175 }11761176- /* restore the previous state */11771177- /* FIXME: use work_on_cpu() */11781178- set_cpus_allowed_ptr(current, saved_mask);11791179-exit:11801180- free_cpumask_var(online_throttling_cpus);11811181- free_cpumask_var(saved_mask);11761176+11821177 return ret;11831178}11841179
+1
drivers/base/firmware_class.c
···15801580 switch (mode) {15811581 case PM_HIBERNATION_PREPARE:15821582 case PM_SUSPEND_PREPARE:15831583+ case PM_RESTORE_PREPARE:15831584 kill_requests_without_uevent();15841585 device_cache_fw_images();15851586 break;
···943943944944 /* Attempt to 'get' the MCH register we want */945945 pdev = NULL;946946- while (!pvt->pci_dev_16_1_fsb_addr_map ||947947- !pvt->pci_dev_16_2_fsb_err_regs) {948948- pdev = pci_get_device(PCI_VENDOR_ID_INTEL,949949- PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev);950950- if (!pdev) {951951- /* End of list, leave */952952- i7300_printk(KERN_ERR,953953- "'system address,Process Bus' "954954- "device not found:"955955- "vendor 0x%x device 0x%x ERR funcs "956956- "(broken BIOS?)\n",957957- PCI_VENDOR_ID_INTEL,958958- PCI_DEVICE_ID_INTEL_I7300_MCH_ERR);959959- goto error;960960- }961961-946946+ while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL,947947+ PCI_DEVICE_ID_INTEL_I7300_MCH_ERR,948948+ pdev))) {962949 /* Store device 16 funcs 1 and 2 */963950 switch (PCI_FUNC(pdev->devfn)) {964951 case 1:965965- pvt->pci_dev_16_1_fsb_addr_map = pdev;952952+ if (!pvt->pci_dev_16_1_fsb_addr_map)953953+ pvt->pci_dev_16_1_fsb_addr_map =954954+ pci_dev_get(pdev);966955 break;967956 case 2:968968- pvt->pci_dev_16_2_fsb_err_regs = pdev;957957+ if (!pvt->pci_dev_16_2_fsb_err_regs)958958+ pvt->pci_dev_16_2_fsb_err_regs =959959+ pci_dev_get(pdev);969960 break;970961 }962962+ }963963+964964+ if (!pvt->pci_dev_16_1_fsb_addr_map ||965965+ !pvt->pci_dev_16_2_fsb_err_regs) {966966+ /* At least one device was not found */967967+ i7300_printk(KERN_ERR,968968+ "'system address,Process Bus' device not found:"969969+ "vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n",970970+ PCI_VENDOR_ID_INTEL,971971+ PCI_DEVICE_ID_INTEL_I7300_MCH_ERR);972972+ goto error;971973 }972974973975 edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s %x:%x\n",
+7-2
drivers/edac/i7core_edac.c
···13341334 * is at addr 8086:2c40, instead of 8086:2c41. So, we need13351335 * to probe for the alternate address in case of failure13361336 */13371337- if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev)13371337+ if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) {13381338+ pci_dev_get(*prev); /* pci_get_device will put it */13381339 pdev = pci_get_device(PCI_VENDOR_ID_INTEL,13391340 PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev);13411341+ }1340134213411341- if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev)13431343+ if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE &&13441344+ !pdev) {13451345+ pci_dev_get(*prev); /* pci_get_device will put it */13421346 pdev = pci_get_device(PCI_VENDOR_ID_INTEL,13431347 PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT,13441348 *prev);13491349+ }1345135013461351 if (!pdev) {13471352 if (*prev) {
-12
drivers/extcon/extcon-arizona.c
···222222 struct snd_soc_dapm_context *dapm = arizona->dapm;223223 int ret;224224225225- mutex_lock(&dapm->card->dapm_mutex);226226-227225 ret = snd_soc_dapm_force_enable_pin(dapm, widget);228226 if (ret != 0)229227 dev_warn(arizona->dev, "Failed to enable %s: %d\n",230228 widget, ret);231229232232- mutex_unlock(&dapm->card->dapm_mutex);233233-234230 snd_soc_dapm_sync(dapm);235231236232 if (!arizona->pdata.micd_force_micbias) {237237- mutex_lock(&dapm->card->dapm_mutex);238238-239233 ret = snd_soc_dapm_disable_pin(arizona->dapm, widget);240234 if (ret != 0)241235 dev_warn(arizona->dev, "Failed to disable %s: %d\n",242236 widget, ret);243243-244244- mutex_unlock(&dapm->card->dapm_mutex);245237246238 snd_soc_dapm_sync(dapm);247239 }···296304 ARIZONA_MICD_ENA, 0,297305 &change);298306299299- mutex_lock(&dapm->card->dapm_mutex);300300-301307 ret = snd_soc_dapm_disable_pin(dapm, widget);302308 if (ret != 0)303309 dev_warn(arizona->dev,304310 "Failed to disable %s: %d\n",305311 widget, ret);306306-307307- mutex_unlock(&dapm->card->dapm_mutex);308312309313 snd_soc_dapm_sync(dapm);310314
+1-1
drivers/fmc/fmc-write-eeprom.c
···2727/* The "file=" is like the generic "gateware=" used elsewhere */2828static char *fwe_file[FMC_MAX_CARDS];2929static int fwe_file_n;3030-module_param_array_named(file, fwe_file, charp, &fwe_file_n, 444);3030+module_param_array_named(file, fwe_file, charp, &fwe_file_n, 0444);31313232static int fwe_run_tlv(struct fmc_device *fmc, const struct firmware *fw,3333 int write)
+15-1
drivers/gpu/drm/radeon/atombios_crtc.c
···17741774 return ATOM_PPLL1;17751775 DRM_ERROR("unable to allocate a PPLL\n");17761776 return ATOM_PPLL_INVALID;17771777+ } else if (ASIC_IS_DCE41(rdev)) {17781778+ /* Don't share PLLs on DCE4.1 chips */17791779+ if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(radeon_crtc->encoder))) {17801780+ if (rdev->clock.dp_extclk)17811781+ /* skip PPLL programming if using ext clock */17821782+ return ATOM_PPLL_INVALID;17831783+ }17841784+ pll_in_use = radeon_get_pll_use_mask(crtc);17851785+ if (!(pll_in_use & (1 << ATOM_PPLL1)))17861786+ return ATOM_PPLL1;17871787+ if (!(pll_in_use & (1 << ATOM_PPLL2)))17881788+ return ATOM_PPLL2;17891789+ DRM_ERROR("unable to allocate a PPLL\n");17901790+ return ATOM_PPLL_INVALID;17771791 } else if (ASIC_IS_DCE4(rdev)) {17781792 /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock,17791793 * depending on the asic:···18151801 if (pll != ATOM_PPLL_INVALID)18161802 return pll;18171803 }18181818- } else if (!ASIC_IS_DCE41(rdev)) { /* Don't share PLLs on DCE4.1 chips */18041804+ } else {18191805 /* use the same PPLL for all monitors with the same clock */18201806 pll = radeon_get_shared_nondp_ppll(crtc);18211807 if (pll != ATOM_PPLL_INVALID)
···538538539539 g->base = job->gather_addr_phys[i];540540541541- for (j = 0; j < job->num_gathers; j++)541541+ for (j = i + 1; j < job->num_gathers; j++)542542 if (job->gathers[j].bo == g->bo)543543 job->gathers[j].handled = true;544544
+1-1
drivers/iio/gyro/Kconfig
···7070 select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)7171 help7272 Say yes here to build support for STMicroelectronics gyroscopes:7373- L3G4200D, LSM330DL, L3GD20, L3GD20H, LSM330DLC, L3G4IS, LSM330.7373+ L3G4200D, LSM330DL, L3GD20, LSM330DLC, L3G4IS, LSM330.74747575 This driver can also be built as a module. If so, these modules7676 will be created:
···103103/**104104 * cm32181_read_als_it() - Get sensor integration time (ms)105105 * @cm32181: pointer of struct cm32181106106- * @val: pointer of int to load the als_it value.106106+ * @val2: pointer of int to load the als_it value.107107 *108108 * Report the current integartion time by millisecond.109109 *110110- * Return: IIO_VAL_INT for success, otherwise -EINVAL.110110+ * Return: IIO_VAL_INT_PLUS_MICRO for success, otherwise -EINVAL.111111 */112112-static int cm32181_read_als_it(struct cm32181_chip *cm32181, int *val)112112+static int cm32181_read_als_it(struct cm32181_chip *cm32181, int *val2)113113{114114 u16 als_it;115115 int i;···119119 als_it >>= CM32181_CMD_ALS_IT_SHIFT;120120 for (i = 0; i < ARRAY_SIZE(als_it_bits); i++) {121121 if (als_it == als_it_bits[i]) {122122- *val = als_it_value[i];123123- return IIO_VAL_INT;122122+ *val2 = als_it_value[i];123123+ return IIO_VAL_INT_PLUS_MICRO;124124 }125125 }126126···221221 *val = cm32181->calibscale;222222 return IIO_VAL_INT;223223 case IIO_CHAN_INFO_INT_TIME:224224- ret = cm32181_read_als_it(cm32181, val);224224+ ret = cm32181_read_als_it(cm32181, val2);225225 return ret;226226 }227227···240240 cm32181->calibscale = val;241241 return val;242242 case IIO_CHAN_INFO_INT_TIME:243243- ret = cm32181_write_als_it(cm32181, val);243243+ ret = cm32181_write_als_it(cm32181, val2);244244 return ret;245245 }246246···264264265265 n = ARRAY_SIZE(als_it_value);266266 for (i = 0, len = 0; i < n; i++)267267- len += sprintf(buf + len, "%d ", als_it_value[i]);267267+ len += sprintf(buf + len, "0.%06u ", als_it_value[i]);268268 return len + sprintf(buf + len, "\n");269269}270270
+23-22
drivers/iio/light/cm36651.c
···5050#define CM36651_CS_CONF2_DEFAULT_BIT 0x0851515252/* CS_CONF3 channel integration time */5353-#define CM36651_CS_IT1 0x00 /* Integration time 80000 usec */5454-#define CM36651_CS_IT2 0x40 /* Integration time 160000 usec */5555-#define CM36651_CS_IT3 0x80 /* Integration time 320000 usec */5656-#define CM36651_CS_IT4 0xC0 /* Integration time 640000 usec */5353+#define CM36651_CS_IT1 0x00 /* Integration time 80 msec */5454+#define CM36651_CS_IT2 0x40 /* Integration time 160 msec */5555+#define CM36651_CS_IT3 0x80 /* Integration time 320 msec */5656+#define CM36651_CS_IT4 0xC0 /* Integration time 640 msec */57575858/* PS_CONF1 command code */5959#define CM36651_PS_ENABLE 0x00···6464#define CM36651_PS_PERS4 0x0C65656666/* PS_CONF1 command code: integration time */6767-#define CM36651_PS_IT1 0x00 /* Integration time 320 usec */6868-#define CM36651_PS_IT2 0x10 /* Integration time 420 usec */6969-#define CM36651_PS_IT3 0x20 /* Integration time 520 usec */7070-#define CM36651_PS_IT4 0x30 /* Integration time 640 usec */6767+#define CM36651_PS_IT1 0x00 /* Integration time 0.32 msec */6868+#define CM36651_PS_IT2 0x10 /* Integration time 0.42 msec */6969+#define CM36651_PS_IT3 0x20 /* Integration time 0.52 msec */7070+#define CM36651_PS_IT4 0x30 /* Integration time 0.64 msec */71717272/* PS_CONF1 command code: duty ratio */7373#define CM36651_PS_DR1 0x00 /* Duty ratio 1/80 */···9393#define CM36651_CLOSE_PROXIMITY 0x329494#define CM36651_FAR_PROXIMITY 0x3395959696-#define CM36651_CS_INT_TIME_AVAIL "80000 160000 320000 640000"9797-#define CM36651_PS_INT_TIME_AVAIL "320 420 520 640"9696+#define CM36651_CS_INT_TIME_AVAIL "0.08 0.16 0.32 0.64"9797+#define CM36651_PS_INT_TIME_AVAIL "0.000320 0.000420 0.000520 0.000640"98989999enum cm36651_operation_mode {100100 CM36651_LIGHT_EN,···356356}357357358358static int cm36651_read_int_time(struct cm36651_data *cm36651,359359- struct iio_chan_spec const *chan, int *val)359359+ struct iio_chan_spec const *chan, int *val2)360360{361361 switch (chan->type) {362362 case IIO_LIGHT:363363 if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT1)364364- *val = 80000;364364+ *val2 = 80000;365365 else if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT2)366366- *val = 160000;366366+ *val2 = 160000;367367 else if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT3)368368- *val = 320000;368368+ *val2 = 320000;369369 else if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT4)370370- *val = 640000;370370+ *val2 = 640000;371371 else372372 return -EINVAL;373373 break;374374 case IIO_PROXIMITY:375375 if (cm36651->ps_int_time == CM36651_PS_IT1)376376- *val = 320;376376+ *val2 = 320;377377 else if (cm36651->ps_int_time == CM36651_PS_IT2)378378- *val = 420;378378+ *val2 = 420;379379 else if (cm36651->ps_int_time == CM36651_PS_IT3)380380- *val = 520;380380+ *val2 = 520;381381 else if (cm36651->ps_int_time == CM36651_PS_IT4)382382- *val = 640;382382+ *val2 = 640;383383 else384384 return -EINVAL;385385 break;···387387 return -EINVAL;388388 }389389390390- return IIO_VAL_INT;390390+ return IIO_VAL_INT_PLUS_MICRO;391391}392392393393static int cm36651_write_int_time(struct cm36651_data *cm36651,···459459 ret = cm36651_read_channel(cm36651, chan, val);460460 break;461461 case IIO_CHAN_INFO_INT_TIME:462462- ret = cm36651_read_int_time(cm36651, chan, val);462462+ *val = 0;463463+ ret = cm36651_read_int_time(cm36651, chan, val2);463464 break;464465 default:465466 ret = -EINVAL;···480479 int ret = -EINVAL;481480482481 if (mask == IIO_CHAN_INFO_INT_TIME) {483483- ret = cm36651_write_int_time(cm36651, chan, val);482482+ ret = cm36651_write_int_time(cm36651, chan, val2);484483 if (ret < 0)485484 dev_err(&client->dev, "Integration time write failed\n");486485 }
-19
drivers/input/misc/arizona-haptics.c
···3737 struct arizona_haptics,3838 work);3939 struct arizona *arizona = haptics->arizona;4040- struct mutex *dapm_mutex = &arizona->dapm->card->dapm_mutex;4140 int ret;42414342 if (!haptics->arizona->dapm) {···6667 return;6768 }68696969- mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);7070-7170 ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS");7271 if (ret != 0) {7372 dev_err(arizona->dev, "Failed to start HAPTICS: %d\n",7473 ret);7575- mutex_unlock(dapm_mutex);7674 return;7775 }7876···7781 if (ret != 0) {7882 dev_err(arizona->dev, "Failed to sync DAPM: %d\n",7983 ret);8080- mutex_unlock(dapm_mutex);8184 return;8285 }8383-8484- mutex_unlock(dapm_mutex);8585-8686 } else {8787 /* This disable sequence will be a noop if already enabled */8888- mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);8989-9088 ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS");9189 if (ret != 0) {9290 dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n",9391 ret);9494- mutex_unlock(dapm_mutex);9592 return;9693 }9794···92103 if (ret != 0) {93104 dev_err(arizona->dev, "Failed to sync DAPM: %d\n",94105 ret);9595- mutex_unlock(dapm_mutex);96106 return;97107 }9898-9999- mutex_unlock(dapm_mutex);100108101109 ret = regmap_update_bits(arizona->regmap,102110 ARIZONA_HAPTICS_CONTROL_1,···141155static void arizona_haptics_close(struct input_dev *input)142156{143157 struct arizona_haptics *haptics = input_get_drvdata(input);144144- struct mutex *dapm_mutex = &haptics->arizona->dapm->card->dapm_mutex;145158146159 cancel_work_sync(&haptics->work);147160148148- mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);149149-150161 if (haptics->arizona->dapm)151162 snd_soc_dapm_disable_pin(haptics->arizona->dapm, "HAPTICS");152152-153153- mutex_unlock(dapm_mutex);154163}155164156165static int arizona_haptics_probe(struct platform_device *pdev)
···515515 * one cpu (the interrupt code doesn't support it), so we just516516 * pick the first cpu we find in 'cpumask'.517517 */518518- cpu = cpumask_any(cpumask);518518+ cpu = cpumask_any_and(cpumask, cpu_online_mask);519519 thread = cpu_2_hwthread_id[cpu];520520521521 metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR2(thread)), vec_addr);
+1-1
drivers/irqchip/irq-metag.c
···201201 * one cpu (the interrupt code doesn't support it), so we just202202 * pick the first cpu we find in 'cpumask'.203203 */204204- cpu = cpumask_any(cpumask);204204+ cpu = cpumask_any_and(cpumask, cpu_online_mask);205205 thread = cpu_2_hwthread_id[cpu];206206207207 metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR1(thread)),
···16261626 /*16271627 * Only pass ioctls through if the device sizes match exactly.16281628 */16291629- if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT)16301630- r = scsi_verify_blk_ioctl(NULL, cmd);16291629+ if (!bdev || ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) {16301630+ int err = scsi_verify_blk_ioctl(NULL, cmd);16311631+ if (err)16321632+ r = err;16331633+ }1631163416321635 if (r == -ENOTCONN && !fatal_signal_pending(current))16331636 queue_work(kmultipathd, &m->process_queued_ios);
···991010#include "persistent-data/dm-block-manager.h"1111#include "persistent-data/dm-space-map.h"1212+#include "persistent-data/dm-space-map-metadata.h"12131313-#define THIN_METADATA_BLOCK_SIZE 40961414+#define THIN_METADATA_BLOCK_SIZE DM_SM_METADATA_BLOCK_SIZE14151516/*1617 * The metadata device is currently limited in size.1717- *1818- * We have one block of index, which can hold 255 index entries. Each1919- * index entry contains allocation info about 16k metadata blocks.2018 */2121-#define THIN_METADATA_MAX_SECTORS (255 * (1 << 14) * (THIN_METADATA_BLOCK_SIZE / (1 << SECTOR_SHIFT)))1919+#define THIN_METADATA_MAX_SECTORS DM_SM_METADATA_MAX_SECTORS22202321/*2422 * A metadata device larger than 16GB triggers a warning.···158160 * Queries.159161 */160162bool dm_thin_changed_this_transaction(struct dm_thin_device *td);163163+164164+bool dm_pool_changed_this_transaction(struct dm_pool_metadata *pmd);161165162166bool dm_thin_aborted_changes(struct dm_thin_device *td);163167
+25-14
drivers/md/dm-thin.c
···13571357 bio_list_init(&pool->deferred_flush_bios);13581358 spin_unlock_irqrestore(&pool->lock, flags);1359135913601360- if (bio_list_empty(&bios) && !need_commit_due_to_time(pool))13601360+ if (bio_list_empty(&bios) &&13611361+ !(dm_pool_changed_this_transaction(pool->pmd) && need_commit_due_to_time(pool)))13611362 return;1362136313631364 if (commit(pool)) {···20001999 dm_table_event(pool->ti->table);20012000}2002200120032003-static sector_t get_metadata_dev_size(struct block_device *bdev)20022002+static sector_t get_dev_size(struct block_device *bdev)20042003{20052005- sector_t metadata_dev_size = i_size_read(bdev->bd_inode) >> SECTOR_SHIFT;20042004+ return i_size_read(bdev->bd_inode) >> SECTOR_SHIFT;20052005+}20062006+20072007+static void warn_if_metadata_device_too_big(struct block_device *bdev)20082008+{20092009+ sector_t metadata_dev_size = get_dev_size(bdev);20062010 char buffer[BDEVNAME_SIZE];2007201120082008- if (metadata_dev_size > THIN_METADATA_MAX_SECTORS_WARNING) {20122012+ if (metadata_dev_size > THIN_METADATA_MAX_SECTORS_WARNING)20092013 DMWARN("Metadata device %s is larger than %u sectors: excess space will not be used.",20102014 bdevname(bdev, buffer), THIN_METADATA_MAX_SECTORS);20112011- metadata_dev_size = THIN_METADATA_MAX_SECTORS_WARNING;20122012- }20152015+}20162016+20172017+static sector_t get_metadata_dev_size(struct block_device *bdev)20182018+{20192019+ sector_t metadata_dev_size = get_dev_size(bdev);20202020+20212021+ if (metadata_dev_size > THIN_METADATA_MAX_SECTORS)20222022+ metadata_dev_size = THIN_METADATA_MAX_SECTORS;2013202320142024 return metadata_dev_size;20152025}···20292017{20302018 sector_t metadata_dev_size = get_metadata_dev_size(bdev);2031201920322032- sector_div(metadata_dev_size, THIN_METADATA_BLOCK_SIZE >> SECTOR_SHIFT);20202020+ sector_div(metadata_dev_size, THIN_METADATA_BLOCK_SIZE);2033202120342022 return metadata_dev_size;20352023}···21072095 ti->error = "Error opening metadata block device";21082096 goto out_unlock;21092097 }21102110-21112111- /*21122112- * Run for the side-effect of possibly issuing a warning if the21132113- * device is too big.21142114- */21152115- (void) get_metadata_dev_size(metadata_dev->bdev);20982098+ warn_if_metadata_device_too_big(metadata_dev->bdev);2116209921172100 r = dm_get_device(ti, argv[1], FMODE_READ | FMODE_WRITE, &data_dev);21182101 if (r) {···22942287 return -EINVAL;2295228822962289 } else if (metadata_dev_size > sb_metadata_dev_size) {22902290+ warn_if_metadata_device_too_big(pool->md_dev);22972291 DMINFO("%s: growing the metadata device from %llu to %llu blocks",22982292 dm_device_name(pool->pool_md),22992293 sb_metadata_dev_size, metadata_dev_size);···2902289429032895 if (get_pool_mode(tc->pool) == PM_FAIL) {29042896 ti->error = "Couldn't open thin device, Pool is in fail mode";28972897+ r = -EINVAL;29052898 goto bad_thin_open;29062899 }29072900···2914290529152906 r = dm_set_target_max_io_len(ti, tc->pool->sectors_per_block);29162907 if (r)29172917- goto bad_thin_open;29082908+ goto bad_target_max_io_len;2918290929192910 ti->num_flush_bios = 1;29202911 ti->flush_supported = true;···2935292629362927 return 0;2937292829292929+bad_target_max_io_len:29302930+ dm_pool_close_thin_device(tc->td);29382931bad_thin_open:29392932 __pool_dec(tc->pool);29402933bad_pool_lookup:
···680680 if (r)681681 return r;682682683683+ if (nr_blocks > DM_SM_METADATA_MAX_BLOCKS)684684+ nr_blocks = DM_SM_METADATA_MAX_BLOCKS;683685 r = sm_ll_extend(&smm->ll, nr_blocks);684686 if (r)685687 return r;
···991010#include "dm-transaction-manager.h"11111212+#define DM_SM_METADATA_BLOCK_SIZE (4096 >> SECTOR_SHIFT)1313+1414+/*1515+ * The metadata device is currently limited in size.1616+ *1717+ * We have one block of index, which can hold 255 index entries. Each1818+ * index entry contains allocation info about ~16k metadata blocks.1919+ */2020+#define DM_SM_METADATA_MAX_BLOCKS (255 * ((1 << 14) - 64))2121+#define DM_SM_METADATA_MAX_SECTORS (DM_SM_METADATA_MAX_BLOCKS * DM_SM_METADATA_BLOCK_SIZE)2222+1223/*1324 * Unfortunately we have to use two-phase construction due to the cycle1425 * between the tm and sm.
+1-1
drivers/mtd/nand/nand_base.c
···15841584 }1585158515861586 if (mtd->ecc_stats.failed - ecc_failures) {15871587- if (retry_mode + 1 <= chip->read_retries) {15871587+ if (retry_mode + 1 < chip->read_retries) {15881588 retry_mode++;15891589 ret = nand_setup_read_retry(mtd,15901590 retry_mode);
+40-21
drivers/mtd/nand/omap2.c
···16331633 int i;16341634 dma_cap_mask_t mask;16351635 unsigned sig;16361636+ unsigned oob_index;16361637 struct resource *res;16371638 struct mtd_part_parser_data ppdata = {};16381639···18271826 (mtd->writesize /18281827 nand_chip->ecc.size);18291828 if (nand_chip->options & NAND_BUSWIDTH_16)18301830- ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH;18291829+ oob_index = BADBLOCK_MARKER_LENGTH;18311830 else18321832- ecclayout->eccpos[0] = 1;18331833- ecclayout->oobfree->offset = ecclayout->eccpos[0] +18341834- ecclayout->eccbytes;18311831+ oob_index = 1;18321832+ for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)18331833+ ecclayout->eccpos[i] = oob_index;18341834+ /* no reserved-marker in ecclayout for this ecc-scheme */18351835+ ecclayout->oobfree->offset =18361836+ ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;18351837 break;1836183818371839 case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:···18511847 ecclayout->eccbytes = nand_chip->ecc.bytes *18521848 (mtd->writesize /18531849 nand_chip->ecc.size);18541854- ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH;18551855- ecclayout->oobfree->offset = ecclayout->eccpos[0] +18561856- ecclayout->eccbytes;18501850+ oob_index = BADBLOCK_MARKER_LENGTH;18511851+ for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) {18521852+ ecclayout->eccpos[i] = oob_index;18531853+ if (((i + 1) % nand_chip->ecc.bytes) == 0)18541854+ oob_index++;18551855+ }18561856+ /* include reserved-marker in ecclayout->oobfree calculation */18571857+ ecclayout->oobfree->offset = 1 +18581858+ ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;18571859 /* software bch library is used for locating errors */18581860 nand_chip->ecc.priv = nand_bch_init(mtd,18591861 nand_chip->ecc.size,···18931883 ecclayout->eccbytes = nand_chip->ecc.bytes *18941884 (mtd->writesize /18951885 nand_chip->ecc.size);18961896- ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH;18971897- ecclayout->oobfree->offset = ecclayout->eccpos[0] +18981898- ecclayout->eccbytes;18861886+ oob_index = BADBLOCK_MARKER_LENGTH;18871887+ for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)18881888+ ecclayout->eccpos[i] = oob_index;18891889+ /* reserved marker already included in ecclayout->eccbytes */18901890+ ecclayout->oobfree->offset =18911891+ ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;18991892 /* This ECC scheme requires ELM H/W block */19001893 if (is_elm_present(info, pdata->elm_of_node, BCH4_ECC) < 0) {19011894 pr_err("nand: error: could not initialize ELM\n");···19261913 ecclayout->eccbytes = nand_chip->ecc.bytes *19271914 (mtd->writesize /19281915 nand_chip->ecc.size);19291929- ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH;19301930- ecclayout->oobfree->offset = ecclayout->eccpos[0] +19311931- ecclayout->eccbytes;19161916+ oob_index = BADBLOCK_MARKER_LENGTH;19171917+ for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) {19181918+ ecclayout->eccpos[i] = oob_index;19191919+ if (((i + 1) % nand_chip->ecc.bytes) == 0)19201920+ oob_index++;19211921+ }19221922+ /* include reserved-marker in ecclayout->oobfree calculation */19231923+ ecclayout->oobfree->offset = 1 +19241924+ ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;19321925 /* software bch library is used for locating errors */19331926 nand_chip->ecc.priv = nand_bch_init(mtd,19341927 nand_chip->ecc.size,···19751956 ecclayout->eccbytes = nand_chip->ecc.bytes *19761957 (mtd->writesize /19771958 nand_chip->ecc.size);19781978- ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH;19791979- ecclayout->oobfree->offset = ecclayout->eccpos[0] +19801980- ecclayout->eccbytes;19591959+ oob_index = BADBLOCK_MARKER_LENGTH;19601960+ for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)19611961+ ecclayout->eccpos[i] = oob_index;19621962+ /* reserved marker already included in ecclayout->eccbytes */19631963+ ecclayout->oobfree->offset =19641964+ ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;19811965 break;19821966#else19831967 pr_err("nand: error: CONFIG_MTD_NAND_OMAP_BCH not enabled\n");···19941972 goto return_error;19951973 }1996197419971997- /* populate remaining ECC layout data */19981998- ecclayout->oobfree->length = mtd->oobsize - (BADBLOCK_MARKER_LENGTH +19991999- ecclayout->eccbytes);20002000- for (i = 1; i < ecclayout->eccbytes; i++)20012001- ecclayout->eccpos[i] = ecclayout->eccpos[0] + i;19751975+ /* all OOB bytes from oobfree->offset till end off OOB are free */19761976+ ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset;20021977 /* check if NAND device's OOB is enough to store ECC signatures */20031978 if (mtd->oobsize < (ecclayout->eccbytes + BADBLOCK_MARKER_LENGTH)) {20041979 pr_err("not enough OOB bytes required = %d, available=%d\n",
···5252 offset = pwm_map->output[i];53535454 /* Return an error if the pin is already assigned */5555- if (test_and_set_bit(offset, &lp3943->pin_used))5555+ if (test_and_set_bit(offset, &lp3943->pin_used)) {5656+ kfree(pwm_map);5657 return ERR_PTR(-EBUSY);5858+ }5759 }58605961 return pwm_map;
···44#define TCM_QLA2XXX_VERSION "v0.1"55/* length of ASCII WWPNs including pad */66#define TCM_QLA2XXX_NAMELEN 3277-/* lenth of ASCII NPIV 'WWPN+WWNN' including pad */88-#define TCM_QLA2XXX_NPIV_NAMELEN 6697108#include "qla_target.h"119···4143 struct tcm_qla2xxx_tpg_attrib tpg_attrib;4244 /* Returned by tcm_qla2xxx_make_tpg() */4345 struct se_portal_group se_tpg;4646+ /* Items for dealing with configfs_depend_item */4747+ struct completion tpg_base_comp;4848+ struct work_struct tpg_base_work;4449};45504651struct tcm_qla2xxx_fc_loopid {···6362 char lport_name[TCM_QLA2XXX_NAMELEN];6463 /* ASCII formatted naa WWPN for VPD page 83 etc */6564 char lport_naa_name[TCM_QLA2XXX_NAMELEN];6666- /* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */6767- char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN];6865 /* map for fc_port pointers in 24-bit FC Port ID space */6966 struct btree_head32 lport_fcport_map;7067 /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
+1
drivers/staging/iio/adc/mxs-lradc.c
···757757 }758758759759 /* if it is released, wait for the next touch via IRQ */760760+ lradc->cur_plate = LRADC_TOUCH;760761 mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ, LRADC_CTRL1);761762 mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1);762763}
···16011601 case TCM_CHECK_CONDITION_ABORT_CMD:16021602 case TCM_CHECK_CONDITION_UNIT_ATTENTION:16031603 case TCM_CHECK_CONDITION_NOT_READY:16041604+ case TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED:16051605+ case TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED:16061606+ case TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED:16041607 break;16051608 case TCM_OUT_OF_RESOURCES:16061609 sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
+10-3
drivers/usb/host/ehci-hcd.c
···685685 struct ehci_hcd *ehci = hcd_to_ehci (hcd);686686 u32 status, masked_status, pcd_status = 0, cmd;687687 int bh;688688+ unsigned long flags;688689689689- spin_lock (&ehci->lock);690690+ /*691691+ * For threadirqs option we use spin_lock_irqsave() variant to prevent692692+ * deadlock with ehci hrtimer callback, because hrtimer callbacks run693693+ * in interrupt context even when threadirqs is specified. We can go694694+ * back to spin_lock() variant when hrtimer callbacks become threaded.695695+ */696696+ spin_lock_irqsave(&ehci->lock, flags);690697691698 status = ehci_readl(ehci, &ehci->regs->status);692699···711704712705 /* Shared IRQ? */713706 if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) {714714- spin_unlock(&ehci->lock);707707+ spin_unlock_irqrestore(&ehci->lock, flags);715708 return IRQ_NONE;716709 }717710···822815823816 if (bh)824817 ehci_work (ehci);825825- spin_unlock (&ehci->lock);818818+ spin_unlock_irqrestore(&ehci->lock, flags);826819 if (pcd_status)827820 usb_hcd_poll_rh_status(hcd);828821 return IRQ_HANDLED;
···10011001 break;10021002 }1003100310041004+ /* virtio-scsi spec requires byte 0 of the lun to be 1 */10051005+ if (unlikely(v_req.lun[0] != 1)) {10061006+ vhost_scsi_send_bad_target(vs, vq, head, out);10071007+ continue;10081008+ }10091009+10041010 /* Extract the tpgt */10051011 target = v_req.lun[1];10061012 tpg = ACCESS_ONCE(vs_tpg[target]);
+11-22
fs/fs-writeback.c
···4040struct wb_writeback_work {4141 long nr_pages;4242 struct super_block *sb;4343- /*4444- * Write only inodes dirtied before this time. Don't forget to set4545- * older_than_this_is_set when you set this.4646- */4747- unsigned long older_than_this;4343+ unsigned long *older_than_this;4844 enum writeback_sync_modes sync_mode;4945 unsigned int tagged_writepages:1;5046 unsigned int for_kupdate:1;5147 unsigned int range_cyclic:1;5248 unsigned int for_background:1;5349 unsigned int for_sync:1; /* sync(2) WB_SYNC_ALL writeback */5454- unsigned int older_than_this_is_set:1;5550 enum wb_reason reason; /* why was writeback initiated? */56515752 struct list_head list; /* pending work list */···247252 int do_sb_sort = 0;248253 int moved = 0;249254250250- WARN_ON_ONCE(!work->older_than_this_is_set);251255 while (!list_empty(delaying_queue)) {252256 inode = wb_inode(delaying_queue->prev);253253- if (inode_dirtied_after(inode, work->older_than_this))257257+ if (work->older_than_this &&258258+ inode_dirtied_after(inode, *work->older_than_this))254259 break;255260 list_move(&inode->i_wb_list, &tmp);256261 moved++;···737742 .sync_mode = WB_SYNC_NONE,738743 .range_cyclic = 1,739744 .reason = reason,740740- .older_than_this = jiffies,741741- .older_than_this_is_set = 1,742745 };743746744747 spin_lock(&wb->list_lock);···795802{796803 unsigned long wb_start = jiffies;797804 long nr_pages = work->nr_pages;805805+ unsigned long oldest_jif;798806 struct inode *inode;799807 long progress;800808801801- if (!work->older_than_this_is_set) {802802- work->older_than_this = jiffies;803803- work->older_than_this_is_set = 1;804804- }809809+ oldest_jif = jiffies;810810+ work->older_than_this = &oldest_jif;805811806812 spin_lock(&wb->list_lock);807813 for (;;) {···834842 * safe.835843 */836844 if (work->for_kupdate) {837837- work->older_than_this = jiffies -845845+ oldest_jif = jiffies -838846 msecs_to_jiffies(dirty_expire_interval * 10);839847 } else if (work->for_background)840840- work->older_than_this = jiffies;848848+ oldest_jif = jiffies;841849842850 trace_writeback_start(wb->bdi, work);843851 if (list_empty(&wb->b_io))···1349135713501358/**13511359 * sync_inodes_sb - sync sb inode pages13521352- * @sb: the superblock13531353- * @older_than_this: timestamp13601360+ * @sb: the superblock13541361 *13551362 * This function writes and waits on any dirty inode belonging to this13561356- * superblock that has been dirtied before given timestamp.13631363+ * super_block.13571364 */13581358-void sync_inodes_sb(struct super_block *sb, unsigned long older_than_this)13651365+void sync_inodes_sb(struct super_block *sb)13591366{13601367 DECLARE_COMPLETION_ONSTACK(done);13611368 struct wb_writeback_work work = {13621369 .sb = sb,13631370 .sync_mode = WB_SYNC_ALL,13641371 .nr_pages = LONG_MAX,13651365- .older_than_this = older_than_this,13661366- .older_than_this_is_set = 1,13671372 .range_cyclic = 0,13681373 .done = &done,13691374 .reason = WB_REASON_SYNC,
+7-1
fs/kernfs/mount.c
···9494 * @fs_type: file_system_type of the fs being mounted9595 * @flags: mount flags specified for the mount9696 * @root: kernfs_root of the hierarchy being mounted9797+ * @new_sb_created: tell the caller if we allocated a new superblock9798 * @ns: optional namespace tag of the mount9899 *99100 * This is to be called from each kernfs user's file_system_type->mount()···105104 * The return value can be passed to the vfs layer verbatim.106105 */107106struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,108108- struct kernfs_root *root, const void *ns)107107+ struct kernfs_root *root, bool *new_sb_created,108108+ const void *ns)109109{110110 struct super_block *sb;111111 struct kernfs_super_info *info;···124122 kfree(info);125123 if (IS_ERR(sb))126124 return ERR_CAST(sb);125125+126126+ if (new_sb_created)127127+ *new_sb_created = !sb->s_root;128128+127129 if (!sb->s_root) {128130 error = kernfs_fill_super(sb);129131 if (error) {
···495495496496 /* Queue ignore event for the watch */497497 inotify_handle_event(group, NULL, fsn_mark, NULL, FS_IN_IGNORED,498498- NULL, FSNOTIFY_EVENT_NONE, NULL);498498+ NULL, FSNOTIFY_EVENT_NONE, NULL, 0);499499500500 i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark);501501 /* remove this mark from the idr */···633633static struct fsnotify_group *inotify_new_group(unsigned int max_events)634634{635635 struct fsnotify_group *group;636636+ struct inotify_event_info *oevent;636637637638 group = fsnotify_alloc_group(&inotify_fsnotify_ops);638639 if (IS_ERR(group))639640 return group;641641+642642+ oevent = kmalloc(sizeof(struct inotify_event_info), GFP_KERNEL);643643+ if (unlikely(!oevent)) {644644+ fsnotify_destroy_group(group);645645+ return ERR_PTR(-ENOMEM);646646+ }647647+ group->overflow_event = &oevent->fse;648648+ fsnotify_init_event(group->overflow_event, NULL, FS_Q_OVERFLOW);649649+ oevent->wd = -1;650650+ oevent->sync_cookie = 0;651651+ oevent->name_len = 0;640652641653 group->max_events = max_events;642654
+15-5
fs/notify/notification.c
···8080/*8181 * Add an event to the group notification queue. The group can later pull this8282 * event off the queue to deal with. The function returns 0 if the event was8383- * added to the queue, 1 if the event was merged with some other queued event.8383+ * added to the queue, 1 if the event was merged with some other queued event,8484+ * 2 if the queue of events has overflown.8485 */8586int fsnotify_add_notify_event(struct fsnotify_group *group,8687 struct fsnotify_event *event,···9695 mutex_lock(&group->notification_mutex);97969897 if (group->q_len >= group->max_events) {9898+ ret = 2;9999 /* Queue overflow event only if it isn't already queued */100100- if (list_empty(&group->overflow_event.list))101101- event = &group->overflow_event;102102- ret = 1;100100+ if (!list_empty(&group->overflow_event->list)) {101101+ mutex_unlock(&group->notification_mutex);102102+ return ret;103103+ }104104+ event = group->overflow_event;105105+ goto queue;103106 }104107105108 if (!list_empty(list) && merge) {···114109 }115110 }116111112112+queue:117113 group->q_len++;118114 list_add_tail(&event->list, list);119115 mutex_unlock(&group->notification_mutex);···138132139133 event = list_first_entry(&group->notification_list,140134 struct fsnotify_event, list);141141- list_del(&event->list);135135+ /*136136+ * We need to init list head for the case of overflow event so that137137+ * check in fsnotify_add_notify_events() works138138+ */139139+ list_del_init(&event->list);142140 group->q_len--;143141144142 return event;
+11-3
fs/quota/dquot.c
···581581 dqstats_inc(DQST_LOOKUPS);582582 dqput(old_dquot);583583 old_dquot = dquot;584584- ret = fn(dquot, priv);585585- if (ret < 0)586586- goto out;584584+ /*585585+ * ->release_dquot() can be racing with us. Our reference586586+ * protects us from new calls to it so just wait for any587587+ * outstanding call and recheck the DQ_ACTIVE_B after that.588588+ */589589+ wait_on_dquot(dquot);590590+ if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {591591+ ret = fn(dquot, priv);592592+ if (ret < 0)593593+ goto out;594594+ }587595 spin_lock(&dq_list_lock);588596 /* We are safe to continue now because our dquot could not589597 * be moved out of the inuse list while we hold the reference */
+6-9
fs/sync.c
···2727 * wait == 1 case since in that case write_inode() functions do2828 * sync_dirty_buffer() and thus effectively write one block at a time.2929 */3030-static int __sync_filesystem(struct super_block *sb, int wait,3131- unsigned long start)3030+static int __sync_filesystem(struct super_block *sb, int wait)3231{3332 if (wait)3434- sync_inodes_sb(sb, start);3333+ sync_inodes_sb(sb);3534 else3635 writeback_inodes_sb(sb, WB_REASON_SYNC);3736···4748int sync_filesystem(struct super_block *sb)4849{4950 int ret;5050- unsigned long start = jiffies;51515252 /*5353 * We need to be protected against the filesystem going from···6062 if (sb->s_flags & MS_RDONLY)6163 return 0;62646363- ret = __sync_filesystem(sb, 0, start);6565+ ret = __sync_filesystem(sb, 0);6466 if (ret < 0)6567 return ret;6666- return __sync_filesystem(sb, 1, start);6868+ return __sync_filesystem(sb, 1);6769}6870EXPORT_SYMBOL_GPL(sync_filesystem);69717072static void sync_inodes_one_sb(struct super_block *sb, void *arg)7173{7274 if (!(sb->s_flags & MS_RDONLY))7373- sync_inodes_sb(sb, *((unsigned long *)arg));7575+ sync_inodes_sb(sb);7476}75777678static void sync_fs_one_sb(struct super_block *sb, void *arg)···102104SYSCALL_DEFINE0(sync)103105{104106 int nowait = 0, wait = 1;105105- unsigned long start = jiffies;106107107108 wakeup_flusher_threads(0, WB_REASON_SYNC);108108- iterate_supers(sync_inodes_one_sb, &start);109109+ iterate_supers(sync_inodes_one_sb, NULL);109110 iterate_supers(sync_fs_one_sb, &nowait);110111 iterate_supers(sync_fs_one_sb, &wait);111112 iterate_bdevs(fdatawrite_one_bdev, NULL);
···9999 struct fsnotify_mark *inode_mark,100100 struct fsnotify_mark *vfsmount_mark,101101 u32 mask, void *data, int data_type,102102- const unsigned char *file_name);102102+ const unsigned char *file_name, u32 cookie);103103 void (*free_group_priv)(struct fsnotify_group *group);104104 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group);105105 void (*free_event)(struct fsnotify_event *event);···160160161161 struct fasync_struct *fsn_fa; /* async notification */162162163163- struct fsnotify_event overflow_event; /* Event we queue when the163163+ struct fsnotify_event *overflow_event; /* Event we queue when the164164 * notification list is too165165 * full */166166
-2
include/linux/ipc_namespace.h
···118118 * the new maximum will handle anyone else. I may have to revisit this119119 * in the future.120120 */121121-#define MIN_QUEUESMAX 1122121#define DFLT_QUEUESMAX 256123123-#define HARD_QUEUESMAX 1024124122#define MIN_MSGMAX 1125123#define DFLT_MSG 10U126124#define DFLT_MSGMAX 10
···12181218 ret = regulator_allow_bypass(w->regulator, false);12191219 if (ret != 0)12201220 dev_warn(w->dapm->dev,12211221- "ASoC: Failed to bypass %s: %d\n",12211221+ "ASoC: Failed to unbypass %s: %d\n",12221222 w->name, ret);12231223 }12241224···12281228 ret = regulator_allow_bypass(w->regulator, true);12291229 if (ret != 0)12301230 dev_warn(w->dapm->dev,12311231- "ASoC: Failed to unbypass %s: %d\n",12311231+ "ASoC: Failed to bypass %s: %d\n",12321232 w->name, ret);12331233 }12341234···32103210 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);32113211 const char *pin = (const char *)kcontrol->private_value;3212321232133213- mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);32143214-32153213 if (ucontrol->value.integer.value[0])32163214 snd_soc_dapm_enable_pin(&card->dapm, pin);32173215 else32183216 snd_soc_dapm_disable_pin(&card->dapm, pin);32193219-32203220- mutex_unlock(&card->dapm_mutex);3221321732223218 snd_soc_dapm_sync(&card->dapm);32233219 return 0;···32443248 ret = regulator_allow_bypass(w->regulator, true);32453249 if (ret != 0)32463250 dev_warn(w->dapm->dev,32473247- "ASoC: Failed to unbypass %s: %d\n",32513251+ "ASoC: Failed to bypass %s: %d\n",32483252 w->name, ret);32493253 }32503254 break;···37633767}3764376837653769/**37703770+ * snd_soc_dapm_enable_pin_unlocked - enable pin.37713771+ * @dapm: DAPM context37723772+ * @pin: pin name37733773+ *37743774+ * Enables input/output pin and its parents or children widgets iff there is37753775+ * a valid audio route and active audio stream.37763776+ *37773777+ * Requires external locking.37783778+ *37793779+ * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to37803780+ * do any widget power switching.37813781+ */37823782+int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,37833783+ const char *pin)37843784+{37853785+ return snd_soc_dapm_set_pin(dapm, pin, 1);37863786+}37873787+EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_unlocked);37883788+37893789+/**37663790 * snd_soc_dapm_enable_pin - enable pin.37673791 * @dapm: DAPM context37683792 * @pin: pin name37693793 *37703794 * Enables input/output pin and its parents or children widgets iff there is37713795 * a valid audio route and active audio stream.37963796+ *37723797 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to37733798 * do any widget power switching.37743799 */37753800int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin)37763801{37773777- return snd_soc_dapm_set_pin(dapm, pin, 1);38023802+ int ret;38033803+38043804+ mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);38053805+38063806+ ret = snd_soc_dapm_set_pin(dapm, pin, 1);38073807+38083808+ mutex_unlock(&dapm->card->dapm_mutex);38093809+38103810+ return ret;37783811}37793812EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin);38133813+38143814+/**38153815+ * snd_soc_dapm_force_enable_pin_unlocked - force a pin to be enabled38163816+ * @dapm: DAPM context38173817+ * @pin: pin name38183818+ *38193819+ * Enables input/output pin regardless of any other state. This is38203820+ * intended for use with microphone bias supplies used in microphone38213821+ * jack detection.38223822+ *38233823+ * Requires external locking.38243824+ *38253825+ * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to38263826+ * do any widget power switching.38273827+ */38283828+int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,38293829+ const char *pin)38303830+{38313831+ struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);38323832+38333833+ if (!w) {38343834+ dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin);38353835+ return -EINVAL;38363836+ }38373837+38383838+ dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin);38393839+ w->connected = 1;38403840+ w->force = 1;38413841+ dapm_mark_dirty(w, "force enable");38423842+38433843+ return 0;38443844+}38453845+EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin_unlocked);3780384637813847/**37823848 * snd_soc_dapm_force_enable_pin - force a pin to be enabled···38553797int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,38563798 const char *pin)38573799{38583858- struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);38003800+ int ret;3859380138603860- if (!w) {38613861- dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin);38623862- return -EINVAL;38633863- }38023802+ mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);3864380338653865- dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin);38663866- w->connected = 1;38673867- w->force = 1;38683868- dapm_mark_dirty(w, "force enable");38043804+ ret = snd_soc_dapm_force_enable_pin_unlocked(dapm, pin);3869380538703870- return 0;38063806+ mutex_unlock(&dapm->card->dapm_mutex);38073807+38083808+ return ret;38713809}38723810EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin);38113811+38123812+/**38133813+ * snd_soc_dapm_disable_pin_unlocked - disable pin.38143814+ * @dapm: DAPM context38153815+ * @pin: pin name38163816+ *38173817+ * Disables input/output pin and its parents or children widgets.38183818+ *38193819+ * Requires external locking.38203820+ *38213821+ * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to38223822+ * do any widget power switching.38233823+ */38243824+int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm,38253825+ const char *pin)38263826+{38273827+ return snd_soc_dapm_set_pin(dapm, pin, 0);38283828+}38293829+EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin_unlocked);3873383038743831/**38753832 * snd_soc_dapm_disable_pin - disable pin.···38923819 * @pin: pin name38933820 *38943821 * Disables input/output pin and its parents or children widgets.38223822+ *38953823 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to38963824 * do any widget power switching.38973825 */38983826int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,38993827 const char *pin)39003828{39013901- return snd_soc_dapm_set_pin(dapm, pin, 0);38293829+ int ret;38303830+38313831+ mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);38323832+38333833+ ret = snd_soc_dapm_set_pin(dapm, pin, 0);38343834+38353835+ mutex_unlock(&dapm->card->dapm_mutex);38363836+38373837+ return ret;39023838}39033839EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin);38403840+38413841+/**38423842+ * snd_soc_dapm_nc_pin_unlocked - permanently disable pin.38433843+ * @dapm: DAPM context38443844+ * @pin: pin name38453845+ *38463846+ * Marks the specified pin as being not connected, disabling it along38473847+ * any parent or child widgets. At present this is identical to38483848+ * snd_soc_dapm_disable_pin() but in future it will be extended to do38493849+ * additional things such as disabling controls which only affect38503850+ * paths through the pin.38513851+ *38523852+ * Requires external locking.38533853+ *38543854+ * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to38553855+ * do any widget power switching.38563856+ */38573857+int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm,38583858+ const char *pin)38593859+{38603860+ return snd_soc_dapm_set_pin(dapm, pin, 0);38613861+}38623862+EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin_unlocked);3904386339053864/**39063865 * snd_soc_dapm_nc_pin - permanently disable pin.···39503845 */39513846int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin)39523847{39533953- return snd_soc_dapm_set_pin(dapm, pin, 0);38483848+ int ret;38493849+38503850+ mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);38513851+38523852+ ret = snd_soc_dapm_set_pin(dapm, pin, 0);38533853+38543854+ mutex_unlock(&dapm->card->dapm_mutex);38553855+38563856+ return ret;39543857}39553858EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin);39563859
+23-15
tools/perf/builtin-report.c
···113113 if (!he)114114 return -ENOMEM;115115116116- err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);117117- if (err)118118- goto out;116116+ if (ui__has_annotation()) {117117+ err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);118118+ if (err)119119+ goto out;119120120120- mx = he->mem_info;121121- err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx);122122- if (err)123123- goto out;121121+ mx = he->mem_info;122122+ err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx);123123+ if (err)124124+ goto out;125125+ }124126125127 evsel->hists.stats.total_period += cost;126128 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);···166164 he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL,167165 1, 1, 0);168166 if (he) {169169- bx = he->branch_info;170170- err = addr_map_symbol__inc_samples(&bx->from, evsel->idx);171171- if (err)172172- goto out;167167+ if (ui__has_annotation()) {168168+ bx = he->branch_info;169169+ err = addr_map_symbol__inc_samples(&bx->from,170170+ evsel->idx);171171+ if (err)172172+ goto out;173173174174- err = addr_map_symbol__inc_samples(&bx->to, evsel->idx);175175- if (err)176176- goto out;174174+ err = addr_map_symbol__inc_samples(&bx->to,175175+ evsel->idx);176176+ if (err)177177+ goto out;178178+ }177179178180 evsel->hists.stats.total_period += 1;179181 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);···211205 if (err)212206 goto out;213207214214- err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);208208+ if (ui__has_annotation())209209+ err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);210210+215211 evsel->hists.stats.total_period += sample->period;216212 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);217213out:
+4-2
tools/perf/builtin-top.c
···176176{177177 struct annotation *notes;178178 struct symbol *sym;179179- int err;179179+ int err = 0;180180181181 if (he == NULL || he->ms.sym == NULL ||182182 ((top->sym_filter_entry == NULL ||···190190 return;191191192192 ip = he->ms.map->map_ip(he->ms.map, ip);193193- err = hist_entry__inc_addr_samples(he, counter, ip);193193+194194+ if (ui__has_annotation())195195+ err = hist_entry__inc_addr_samples(he, counter, ip);194196195197 pthread_mutex_unlock(¬es->lock);196198
···151151void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);152152void disasm__purge(struct list_head *head);153153154154+bool ui__has_annotation(void);155155+154156int symbol__tty_annotate(struct symbol *sym, struct map *map,155157 struct perf_evsel *evsel, bool print_lines,156158 bool full_paths, int min_pcnt, int max_lines);
+3-1
tools/perf/util/include/linux/bitops.h
···8787 return num;8888}89899090+typedef const unsigned long __attribute__((__may_alias__)) long_alias_t;9191+9092/*9193 * Find the first set bit in a memory region.9294 */9395static inline unsigned long9496find_first_bit(const unsigned long *addr, unsigned long size)9597{9696- const unsigned long *p = addr;9898+ long_alias_t *p = (long_alias_t *) addr;9799 unsigned long result = 0;98100 unsigned long tmp;99101