···270270extern int omap4_mpuss_init(void);271271extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);272272extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);273273+extern u32 omap4_get_cpu1_ns_pa_addr(void);273274#else274275static inline int omap4_enter_lowpower(unsigned int cpu,275276 unsigned int power_state)
···2121#include <linux/io.h>2222#include <linux/irqchip/arm-gic.h>23232424+#include <asm/sections.h>2425#include <asm/smp_scu.h>2526#include <asm/virt.h>2627···41404241#define OMAP5_CORE_COUNT 0x243424343+#define AUX_CORE_BOOT0_GP_RELEASE 0x0204444+#define AUX_CORE_BOOT0_HS_RELEASE 0x2004545+4446struct omap_smp_config {4547 unsigned long cpu1_rstctrl_pa;4648 void __iomem *cpu1_rstctrl_va;4749 void __iomem *scu_base;5050+ void __iomem *wakeupgen_base;4851 void *startup_addr;4952};5053···145140 static struct clockdomain *cpu1_clkdm;146141 static bool booted;147142 static struct powerdomain *cpu1_pwrdm;148148- void __iomem *base = omap_get_wakeupgen_base();149143150144 /*151145 * Set synchronisation state between this boot processor···159155 * A barrier is added to ensure that write buffer is drained160156 */161157 if (omap_secure_apis_support())162162- omap_modify_auxcoreboot0(0x200, 0xfffffdff);158158+ omap_modify_auxcoreboot0(AUX_CORE_BOOT0_HS_RELEASE,159159+ 0xfffffdff);163160 else164164- writel_relaxed(0x20, base + OMAP_AUX_CORE_BOOT_0);161161+ writel_relaxed(AUX_CORE_BOOT0_GP_RELEASE,162162+ cfg.wakeupgen_base + OMAP_AUX_CORE_BOOT_0);165163166164 if (!cpu1_clkdm && !cpu1_pwrdm) {167165 cpu1_clkdm = clkdm_lookup("mpu1_clkdm");···267261 set_cpu_possible(i, true);268262}269263264264+/*265265+ * For now, just make sure the start-up address is not within the booting266266+ * kernel space as that means we just overwrote whatever secondary_startup()267267+ * code there was.268268+ */269269+static bool __init omap4_smp_cpu1_startup_valid(unsigned long addr)270270+{271271+ if ((addr >= __pa(PAGE_OFFSET)) && (addr <= __pa(__bss_start)))272272+ return false;273273+274274+ return true;275275+}276276+277277+/*278278+ * We may need to reset CPU1 before configuring, otherwise kexec boot can end279279+ * up trying to use old kernel startup address or suspend-resume will280280+ * occasionally fail to bring up CPU1 on 4430 if CPU1 fails to enter deeper281281+ * idle states.282282+ */283283+static void __init omap4_smp_maybe_reset_cpu1(struct omap_smp_config *c)284284+{285285+ unsigned long cpu1_startup_pa, cpu1_ns_pa_addr;286286+ bool needs_reset = false;287287+ u32 released;288288+289289+ if (omap_secure_apis_support())290290+ released = omap_read_auxcoreboot0() & AUX_CORE_BOOT0_HS_RELEASE;291291+ else292292+ released = readl_relaxed(cfg.wakeupgen_base +293293+ OMAP_AUX_CORE_BOOT_0) &294294+ AUX_CORE_BOOT0_GP_RELEASE;295295+ if (released) {296296+ pr_warn("smp: CPU1 not parked?\n");297297+298298+ return;299299+ }300300+301301+ cpu1_startup_pa = readl_relaxed(cfg.wakeupgen_base +302302+ OMAP_AUX_CORE_BOOT_1);303303+ cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr();304304+305305+ /* Did the configured secondary_startup() get overwritten? */306306+ if (!omap4_smp_cpu1_startup_valid(cpu1_startup_pa))307307+ needs_reset = true;308308+309309+ /*310310+ * If omap4 or 5 has NS_PA_ADDR configured, CPU1 may be in a311311+ * deeper idle state in WFI and will wake to an invalid address.312312+ */313313+ if ((soc_is_omap44xx() || soc_is_omap54xx()) &&314314+ !omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr))315315+ needs_reset = true;316316+317317+ if (!needs_reset || !c->cpu1_rstctrl_va)318318+ return;319319+320320+ pr_info("smp: CPU1 parked within kernel, needs reset (0x%lx 0x%lx)\n",321321+ cpu1_startup_pa, cpu1_ns_pa_addr);322322+323323+ writel_relaxed(1, c->cpu1_rstctrl_va);324324+ readl_relaxed(c->cpu1_rstctrl_va);325325+ writel_relaxed(0, c->cpu1_rstctrl_va);326326+}327327+270328static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)271329{272272- void __iomem *base = omap_get_wakeupgen_base();273330 const struct omap_smp_config *c = NULL;274331275332 if (soc_is_omap443x())···350281 /* Must preserve cfg.scu_base set earlier */351282 cfg.cpu1_rstctrl_pa = c->cpu1_rstctrl_pa;352283 cfg.startup_addr = c->startup_addr;284284+ cfg.wakeupgen_base = omap_get_wakeupgen_base();353285354286 if (soc_is_dra74x() || soc_is_omap54xx()) {355287 if ((__boot_cpu_mode & MODE_MASK) == HYP_MODE)···369299 if (cfg.scu_base)370300 scu_enable(cfg.scu_base);371301372372- /*373373- * Reset CPU1 before configuring, otherwise kexec will374374- * end up trying to use old kernel startup address.375375- */376376- if (cfg.cpu1_rstctrl_va) {377377- writel_relaxed(1, cfg.cpu1_rstctrl_va);378378- readl_relaxed(cfg.cpu1_rstctrl_va);379379- writel_relaxed(0, cfg.cpu1_rstctrl_va);380380- }302302+ omap4_smp_maybe_reset_cpu1(&cfg);381303382304 /*383305 * Write the address of secondary startup routine into the···381319 omap_auxcoreboot_addr(__pa_symbol(cfg.startup_addr));382320 else383321 writel_relaxed(__pa_symbol(cfg.startup_addr),384384- base + OMAP_AUX_CORE_BOOT_1);322322+ cfg.wakeupgen_base + OMAP_AUX_CORE_BOOT_1);385323}386324387325const struct smp_operations omap4_smp_ops __initconst = {
+8
arch/arm/mach-omap2/omap_device.c
···222222 dev_err(dev, "failed to idle\n");223223 }224224 break;225225+ case BUS_NOTIFY_BIND_DRIVER:226226+ od = to_omap_device(pdev);227227+ if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) &&228228+ pm_runtime_status_suspended(dev)) {229229+ od->_driver_status = BUS_NOTIFY_BIND_DRIVER;230230+ pm_runtime_set_active(dev);231231+ }232232+ break;225233 case BUS_NOTIFY_ADD_DEVICE:226234 if (pdev->dev.of_node)227235 omap_device_build_from_dt(pdev);
+1
arch/arm/mach-orion5x/Kconfig
···66 select GPIOLIB77 select MVEBU_MBUS88 select PCI99+ select PHYLIB if NETDEVICES910 select PLAT_ORION_LEGACY1011 help1112 Support for the following Marvell Orion 5x series SoCs:
+5
arch/arm/plat-orion/common.c
···468468 eth_data, &orion_ge11);469469}470470471471+#ifdef CONFIG_ARCH_ORION5X471472/*****************************************************************************472473 * Ethernet switch473474 ****************************************************************************/···480479{481480 struct mdio_board_info *bd;482481 unsigned int i;482482+483483+ if (!IS_BUILTIN(CONFIG_PHYLIB))484484+ return;483485484486 for (i = 0; i < ARRAY_SIZE(d->port_names); i++)485487 if (!strcmp(d->port_names[i], "cpu"))···497493498494 mdiobus_register_board_info(&orion_ge00_switch_board_info, 1);499495}496496+#endif500497501498/*****************************************************************************502499 * I2C
···201201 add dst,len,end202202203203 /* short copy with less than 16 bytes? */204204- cmpib,>>=,n 15,len,.Lbyte_loop204204+ cmpib,COND(>>=),n 15,len,.Lbyte_loop205205206206 /* same alignment? */207207 xor src,dst,t0···216216 /* loop until we are 64-bit aligned */217217.Lalign_loop64:218218 extru dst,31,3,t1219219- cmpib,=,n 0,t1,.Lcopy_loop_16219219+ cmpib,=,n 0,t1,.Lcopy_loop_16_start22022020: ldb,ma 1(srcspc,src),t122122121: stb,ma t1,1(dstspc,dst)222222 b .Lalign_loop64···225225 ASM_EXCEPTIONTABLE_ENTRY(20b,.Lcopy_done)226226 ASM_EXCEPTIONTABLE_ENTRY(21b,.Lcopy_done)227227228228+.Lcopy_loop_16_start:228229 ldi 31,t0229230.Lcopy_loop_16:230231 cmpb,COND(>>=),n t0,len,.Lword_loop···268267 /* loop until we are 32-bit aligned */269268.Lalign_loop32:270269 extru dst,31,2,t1271271- cmpib,=,n 0,t1,.Lcopy_loop_4270270+ cmpib,=,n 0,t1,.Lcopy_loop_827227120: ldb,ma 1(srcspc,src),t127327221: stb,ma t1,1(dstspc,dst)274273 b .Lalign_loop32···278277 ASM_EXCEPTIONTABLE_ENTRY(21b,.Lcopy_done)279278280279281281-.Lcopy_loop_4:280280+.Lcopy_loop_8:282281 cmpib,COND(>>=),n 15,len,.Lbyte_loop28328228428310: ldw 0(srcspc,src),t1···300299 ASM_EXCEPTIONTABLE_ENTRY(16b,.Lcopy_done)301300 ASM_EXCEPTIONTABLE_ENTRY(17b,.Lcopy_done)302301303303- b .Lcopy_loop_4302302+ b .Lcopy_loop_8304303 ldo -16(len),len305304306305.Lbyte_loop:···325324.Lunaligned_copy:326325 /* align until dst is 32bit-word-aligned */327326 extru dst,31,2,t1328328- cmpib,COND(=),n 0,t1,.Lcopy_dstaligned327327+ cmpib,=,n 0,t1,.Lcopy_dstaligned32932820: ldb 0(srcspc,src),t1330329 ldo 1(src),src33133021: stb,ma t1,1(dstspc,dst)···363362 cmpiclr,<> 1,t0,%r0364363 b,n .Lcase1365364.Lcase0:366366- cmpb,= %r0,len,.Lcda_finish365365+ cmpb,COND(=) %r0,len,.Lcda_finish367366 nop3683673693681: ldw,ma 4(srcspc,src), a3···3773761: ldw,ma 4(srcspc,src), a3378377 ASM_EXCEPTIONTABLE_ENTRY(1b,.Lcda_rdfault)379378 ldo -1(len),len380380- cmpb,=,n %r0,len,.Ldo0379379+ cmpb,COND(=),n %r0,len,.Ldo0381380.Ldo4:3823811: ldw,ma 4(srcspc,src), a0383382 ASM_EXCEPTIONTABLE_ENTRY(1b,.Lcda_rdfault)···4034021: stw,ma t0, 4(dstspc,dst)404403 ASM_EXCEPTIONTABLE_ENTRY(1b,.Lcopy_done)405404 ldo -4(len),len406406- cmpb,<> %r0,len,.Ldo4405405+ cmpb,COND(<>) %r0,len,.Ldo4407406 nop408407.Ldo0:409408 shrpw a2, a3, %sar, t0···437436 /* fault exception fixup handlers: */438437#ifdef CONFIG_64BIT439438.Lcopy16_fault:440440-10: b .Lcopy_done441441- std,ma t1,8(dstspc,dst)439439+ b .Lcopy_done440440+10: std,ma t1,8(dstspc,dst)442441 ASM_EXCEPTIONTABLE_ENTRY(10b,.Lcopy_done)443442#endif444443445444.Lcopy8_fault:446446-10: b .Lcopy_done447447- stw,ma t1,4(dstspc,dst)445445+ b .Lcopy_done446446+10: stw,ma t1,4(dstspc,dst)448447 ASM_EXCEPTIONTABLE_ENTRY(10b,.Lcopy_done)449448450449 .exit
+1-1
arch/sparc/Kconfig
···4343 select ARCH_HAS_SG_CHAIN4444 select CPU_NO_EFFICIENT_FFS4545 select HAVE_ARCH_HARDENED_USERCOPY4646- select PROVE_LOCKING_SMALL if PROVE_LOCKING4646+ select LOCKDEP_SMALL if LOCKDEP4747 select ARCH_WANT_RELAX_ORDER48484949config SPARC32
+16
arch/sparc/mm/hugetlbpage.c
···461461 pgd_t *pgd;462462 unsigned long next;463463464464+ addr &= PMD_MASK;465465+ if (addr < floor) {466466+ addr += PMD_SIZE;467467+ if (!addr)468468+ return;469469+ }470470+ if (ceiling) {471471+ ceiling &= PMD_MASK;472472+ if (!ceiling)473473+ return;474474+ }475475+ if (end - 1 > ceiling - 1)476476+ end -= PMD_SIZE;477477+ if (addr > end - 1)478478+ return;479479+464480 pgd = pgd_offset(tlb->mm, addr);465481 do {466482 next = pgd_addr_end(addr, end);
+31-11
arch/x86/include/asm/pmem.h
···5555 * @size: number of bytes to write back5656 *5757 * Write back a cache range using the CLWB (cache line write back)5858- * instruction.5858+ * instruction. Note that @size is internally rounded up to be cache5959+ * line size aligned.5960 */6061static inline void arch_wb_cache_pmem(void *addr, size_t size)6162{···6867 for (p = (void *)((unsigned long)addr & ~clflush_mask);6968 p < vend; p += x86_clflush_size)7069 clwb(p);7171-}7272-7373-/*7474- * copy_from_iter_nocache() on x86 only uses non-temporal stores for iovec7575- * iterators, so for other types (bvec & kvec) we must do a cache write-back.7676- */7777-static inline bool __iter_needs_pmem_wb(struct iov_iter *i)7878-{7979- return iter_is_iovec(i) == false;8070}81718272/**···8694 /* TODO: skip the write-back by always using non-temporal stores */8795 len = copy_from_iter_nocache(addr, bytes, i);88968989- if (__iter_needs_pmem_wb(i))9797+ /*9898+ * In the iovec case on x86_64 copy_from_iter_nocache() uses9999+ * non-temporal stores for the bulk of the transfer, but we need100100+ * to manually flush if the transfer is unaligned. A cached101101+ * memory copy is used when destination or size is not naturally102102+ * aligned. That is:103103+ * - Require 8-byte alignment when size is 8 bytes or larger.104104+ * - Require 4-byte alignment when size is 4 bytes.105105+ *106106+ * In the non-iovec case the entire destination needs to be107107+ * flushed.108108+ */109109+ if (iter_is_iovec(i)) {110110+ unsigned long flushed, dest = (unsigned long) addr;111111+112112+ if (bytes < 8) {113113+ if (!IS_ALIGNED(dest, 4) || (bytes != 4))114114+ arch_wb_cache_pmem(addr, 1);115115+ } else {116116+ if (!IS_ALIGNED(dest, 8)) {117117+ dest = ALIGN(dest, boot_cpu_data.x86_clflush_size);118118+ arch_wb_cache_pmem(addr, 1);119119+ }120120+121121+ flushed = dest - (unsigned long) addr;122122+ if (bytes > flushed && !IS_ALIGNED(bytes - flushed, 8))123123+ arch_wb_cache_pmem(addr + bytes - 1, 1);124124+ }125125+ } else90126 arch_wb_cache_pmem(addr, bytes);9112792128 return len;
+51-30
crypto/ahash.c
···3232 crypto_completion_t complete;3333 void *data;3434 u8 *result;3535+ u32 flags;3536 void *ubuf[] CRYPTO_MINALIGN_ATTR;3637};3738···254253 priv->result = req->result;255254 priv->complete = req->base.complete;256255 priv->data = req->base.data;256256+ priv->flags = req->base.flags;257257+257258 /*258259 * WARNING: We do not backup req->priv here! The req->priv259260 * is for internal use of the Crypto API and the···270267 return 0;271268}272269273273-static void ahash_restore_req(struct ahash_request *req)270270+static void ahash_restore_req(struct ahash_request *req, int err)274271{275272 struct ahash_request_priv *priv = req->priv;276273274274+ if (!err)275275+ memcpy(priv->result, req->result,276276+ crypto_ahash_digestsize(crypto_ahash_reqtfm(req)));277277+277278 /* Restore the original crypto request. */278279 req->result = priv->result;279279- req->base.complete = priv->complete;280280- req->base.data = priv->data;280280+281281+ ahash_request_set_callback(req, priv->flags,282282+ priv->complete, priv->data);281283 req->priv = NULL;282284283285 /* Free the req->priv.priv from the ADJUSTED request. */284286 kzfree(priv);285287}286288287287-static void ahash_op_unaligned_finish(struct ahash_request *req, int err)289289+static void ahash_notify_einprogress(struct ahash_request *req)288290{289291 struct ahash_request_priv *priv = req->priv;292292+ struct crypto_async_request oreq;290293291291- if (err == -EINPROGRESS)292292- return;294294+ oreq.data = priv->data;293295294294- if (!err)295295- memcpy(priv->result, req->result,296296- crypto_ahash_digestsize(crypto_ahash_reqtfm(req)));297297-298298- ahash_restore_req(req);296296+ priv->complete(&oreq, -EINPROGRESS);299297}300298301299static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)302300{303301 struct ahash_request *areq = req->data;302302+303303+ if (err == -EINPROGRESS) {304304+ ahash_notify_einprogress(areq);305305+ return;306306+ }304307305308 /*306309 * Restore the original request, see ahash_op_unaligned() for what···318309 */319310320311 /* First copy req->result into req->priv.result */321321- ahash_op_unaligned_finish(areq, err);312312+ ahash_restore_req(areq, err);322313323314 /* Complete the ORIGINAL request. */324315 areq->base.complete(&areq->base, err);···334325 return err;335326336327 err = op(req);337337- ahash_op_unaligned_finish(req, err);328328+ if (err == -EINPROGRESS ||329329+ (err == -EBUSY && (ahash_request_flags(req) &330330+ CRYPTO_TFM_REQ_MAY_BACKLOG)))331331+ return err;332332+333333+ ahash_restore_req(req, err);338334339335 return err;340336}···374360}375361EXPORT_SYMBOL_GPL(crypto_ahash_digest);376362377377-static void ahash_def_finup_finish2(struct ahash_request *req, int err)378378-{379379- struct ahash_request_priv *priv = req->priv;380380-381381- if (err == -EINPROGRESS)382382- return;383383-384384- if (!err)385385- memcpy(priv->result, req->result,386386- crypto_ahash_digestsize(crypto_ahash_reqtfm(req)));387387-388388- ahash_restore_req(req);389389-}390390-391363static void ahash_def_finup_done2(struct crypto_async_request *req, int err)392364{393365 struct ahash_request *areq = req->data;394366395395- ahash_def_finup_finish2(areq, err);367367+ if (err == -EINPROGRESS)368368+ return;369369+370370+ ahash_restore_req(areq, err);396371397372 areq->base.complete(&areq->base, err);398373}···392389 goto out;393390394391 req->base.complete = ahash_def_finup_done2;395395- req->base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;392392+396393 err = crypto_ahash_reqtfm(req)->final(req);394394+ if (err == -EINPROGRESS ||395395+ (err == -EBUSY && (ahash_request_flags(req) &396396+ CRYPTO_TFM_REQ_MAY_BACKLOG)))397397+ return err;397398398399out:399399- ahash_def_finup_finish2(req, err);400400+ ahash_restore_req(req, err);400401 return err;401402}402403···408401{409402 struct ahash_request *areq = req->data;410403404404+ if (err == -EINPROGRESS) {405405+ ahash_notify_einprogress(areq);406406+ return;407407+ }408408+409409+ areq->base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;410410+411411 err = ahash_def_finup_finish1(areq, err);412412+ if (areq->priv)413413+ return;412414413415 areq->base.complete(&areq->base, err);414416}···432416 return err;433417434418 err = tfm->update(req);419419+ if (err == -EINPROGRESS ||420420+ (err == -EBUSY && (ahash_request_flags(req) &421421+ CRYPTO_TFM_REQ_MAY_BACKLOG)))422422+ return err;423423+435424 return ahash_def_finup_finish1(req, err);436425}437426
···16171617 const struct nfit_set_info_map *map0 = m0;16181618 const struct nfit_set_info_map *map1 = m1;1619161916201620- return map0->region_offset - map1->region_offset;16201620+ if (map0->region_offset < map1->region_offset)16211621+ return -1;16221622+ else if (map0->region_offset > map1->region_offset)16231623+ return 1;16241624+ return 0;16211625}1622162616231627/* Retrieve the nth entry referencing this spa */
+1
drivers/dax/Kconfig
···22 tristate "DAX: direct access to differentiated memory"33 default m if NVDIMM_DAX44 depends on TRANSPARENT_HUGEPAGE55+ select SRCU56 help67 Support raw access to differentiated (persistence, bandwidth,78 latency...) memory via an mmap(2) capable character
+7-6
drivers/dax/dax.c
···2525#include "dax.h"26262727static dev_t dax_devt;2828+DEFINE_STATIC_SRCU(dax_srcu);2829static struct class *dax_class;2930static DEFINE_IDA(dax_minor_ida);3031static int nr_dax = CONFIG_NR_DEV_DAX;···6160 * @region - parent region6261 * @dev - device backing the character device6362 * @cdev - core chardev data6464- * @alive - !alive + rcu grace period == no new mappings can be established6363+ * @alive - !alive + srcu grace period == no new mappings can be established6564 * @id - child id in the region6665 * @num_resources - number of physical address extents in this device6766 * @res - array of physical address ranges···570569static int dax_dev_huge_fault(struct vm_fault *vmf,571570 enum page_entry_size pe_size)572571{573573- int rc;572572+ int rc, id;574573 struct file *filp = vmf->vma->vm_file;575574 struct dax_dev *dax_dev = filp->private_data;576575···579578 ? "write" : "read",580579 vmf->vma->vm_start, vmf->vma->vm_end);581580582582- rcu_read_lock();581581+ id = srcu_read_lock(&dax_srcu);583582 switch (pe_size) {584583 case PE_SIZE_PTE:585584 rc = __dax_dev_pte_fault(dax_dev, vmf);···593592 default:594593 return VM_FAULT_FALLBACK;595594 }596596- rcu_read_unlock();595595+ srcu_read_unlock(&dax_srcu, id);597596598597 return rc;599598}···714713 * Note, rcu is not protecting the liveness of dax_dev, rcu is715714 * ensuring that any fault handlers that might have seen716715 * dax_dev->alive == true, have completed. Any fault handlers717717- * that start after synchronize_rcu() has started will abort716716+ * that start after synchronize_srcu() has started will abort718717 * upon seeing dax_dev->alive == false.719718 */720719 dax_dev->alive = false;721721- synchronize_rcu();720720+ synchronize_srcu(&dax_srcu);722721 unmap_mapping_range(dax_dev->inode->i_mapping, 0, 0, 1);723722 cdev_del(cdev);724723 device_unregister(dev);
+1
drivers/net/ethernet/cavium/thunder/thunder_bgx.c
···134134 pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &sdevid);135135 switch (sdevid) {136136 case PCI_SUBSYS_DEVID_81XX_BGX:137137+ case PCI_SUBSYS_DEVID_81XX_RGX:137138 max_bgx_per_node = MAX_BGX_PER_CN81XX;138139 break;139140 case PCI_SUBSYS_DEVID_83XX_BGX:
···410410 struct u64_stats_sync syncp;411411};412412413413-/* PDMA descriptor can point at 1-2 segments. This enum allows us to track how414414- * memory was allocated so that it can be freed properly415415- */416413enum mtk_tx_flags {414414+ /* PDMA descriptor can point at 1-2 segments. This enum allows us to415415+ * track how memory was allocated so that it can be freed properly.416416+ */417417 MTK_TX_FLAGS_SINGLE0 = 0x01,418418 MTK_TX_FLAGS_PAGE0 = 0x02,419419+420420+ /* MTK_TX_FLAGS_FPORTx allows tracking which port the transmitted421421+ * SKB out instead of looking up through hardware TX descriptor.422422+ */423423+ MTK_TX_FLAGS_FPORT0 = 0x04,424424+ MTK_TX_FLAGS_FPORT1 = 0x08,419425};420426421427/* This enum allows us to identify how the clock is defined on the array of the
+67-55
drivers/net/ethernet/renesas/sh_eth.c
···11271127 .get_mdio_data = sh_get_mdio,11281128};1129112911301130+/* free Tx skb function */11311131+static int sh_eth_tx_free(struct net_device *ndev, bool sent_only)11321132+{11331133+ struct sh_eth_private *mdp = netdev_priv(ndev);11341134+ struct sh_eth_txdesc *txdesc;11351135+ int free_num = 0;11361136+ int entry;11371137+ bool sent;11381138+11391139+ for (; mdp->cur_tx - mdp->dirty_tx > 0; mdp->dirty_tx++) {11401140+ entry = mdp->dirty_tx % mdp->num_tx_ring;11411141+ txdesc = &mdp->tx_ring[entry];11421142+ sent = !(txdesc->status & cpu_to_le32(TD_TACT));11431143+ if (sent_only && !sent)11441144+ break;11451145+ /* TACT bit must be checked before all the following reads */11461146+ dma_rmb();11471147+ netif_info(mdp, tx_done, ndev,11481148+ "tx entry %d status 0x%08x\n",11491149+ entry, le32_to_cpu(txdesc->status));11501150+ /* Free the original skb. */11511151+ if (mdp->tx_skbuff[entry]) {11521152+ dma_unmap_single(&ndev->dev, le32_to_cpu(txdesc->addr),11531153+ le32_to_cpu(txdesc->len) >> 16,11541154+ DMA_TO_DEVICE);11551155+ dev_kfree_skb_irq(mdp->tx_skbuff[entry]);11561156+ mdp->tx_skbuff[entry] = NULL;11571157+ free_num++;11581158+ }11591159+ txdesc->status = cpu_to_le32(TD_TFP);11601160+ if (entry >= mdp->num_tx_ring - 1)11611161+ txdesc->status |= cpu_to_le32(TD_TDLE);11621162+11631163+ if (sent) {11641164+ ndev->stats.tx_packets++;11651165+ ndev->stats.tx_bytes += le32_to_cpu(txdesc->len) >> 16;11661166+ }11671167+ }11681168+ return free_num;11691169+}11701170+11301171/* free skb and descriptor buffer */11311172static void sh_eth_ring_free(struct net_device *ndev)11321173{11331174 struct sh_eth_private *mdp = netdev_priv(ndev);11341175 int ringsize, i;11761176+11771177+ if (mdp->rx_ring) {11781178+ for (i = 0; i < mdp->num_rx_ring; i++) {11791179+ if (mdp->rx_skbuff[i]) {11801180+ struct sh_eth_rxdesc *rxdesc = &mdp->rx_ring[i];11811181+11821182+ dma_unmap_single(&ndev->dev,11831183+ le32_to_cpu(rxdesc->addr),11841184+ ALIGN(mdp->rx_buf_sz, 32),11851185+ DMA_FROM_DEVICE);11861186+ }11871187+ }11881188+ ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring;11891189+ dma_free_coherent(NULL, ringsize, mdp->rx_ring,11901190+ mdp->rx_desc_dma);11911191+ mdp->rx_ring = NULL;11921192+ }1135119311361194 /* Free Rx skb ringbuffer */11371195 if (mdp->rx_skbuff) {···11991141 kfree(mdp->rx_skbuff);12001142 mdp->rx_skbuff = NULL;1201114312021202- /* Free Tx skb ringbuffer */12031203- if (mdp->tx_skbuff) {12041204- for (i = 0; i < mdp->num_tx_ring; i++)12051205- dev_kfree_skb(mdp->tx_skbuff[i]);12061206- }12071207- kfree(mdp->tx_skbuff);12081208- mdp->tx_skbuff = NULL;12091209-12101210- if (mdp->rx_ring) {12111211- ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring;12121212- dma_free_coherent(NULL, ringsize, mdp->rx_ring,12131213- mdp->rx_desc_dma);12141214- mdp->rx_ring = NULL;12151215- }12161216-12171144 if (mdp->tx_ring) {11451145+ sh_eth_tx_free(ndev, false);11461146+12181147 ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring;12191148 dma_free_coherent(NULL, ringsize, mdp->tx_ring,12201149 mdp->tx_desc_dma);12211150 mdp->tx_ring = NULL;12221151 }11521152+11531153+ /* Free Tx skb ringbuffer */11541154+ kfree(mdp->tx_skbuff);11551155+ mdp->tx_skbuff = NULL;12231156}1224115712251158/* format skb and descriptor buffer */···14581409 update_mac_address(ndev);14591410}1460141114611461-/* free Tx skb function */14621462-static int sh_eth_txfree(struct net_device *ndev)14631463-{14641464- struct sh_eth_private *mdp = netdev_priv(ndev);14651465- struct sh_eth_txdesc *txdesc;14661466- int free_num = 0;14671467- int entry;14681468-14691469- for (; mdp->cur_tx - mdp->dirty_tx > 0; mdp->dirty_tx++) {14701470- entry = mdp->dirty_tx % mdp->num_tx_ring;14711471- txdesc = &mdp->tx_ring[entry];14721472- if (txdesc->status & cpu_to_le32(TD_TACT))14731473- break;14741474- /* TACT bit must be checked before all the following reads */14751475- dma_rmb();14761476- netif_info(mdp, tx_done, ndev,14771477- "tx entry %d status 0x%08x\n",14781478- entry, le32_to_cpu(txdesc->status));14791479- /* Free the original skb. */14801480- if (mdp->tx_skbuff[entry]) {14811481- dma_unmap_single(&ndev->dev, le32_to_cpu(txdesc->addr),14821482- le32_to_cpu(txdesc->len) >> 16,14831483- DMA_TO_DEVICE);14841484- dev_kfree_skb_irq(mdp->tx_skbuff[entry]);14851485- mdp->tx_skbuff[entry] = NULL;14861486- free_num++;14871487- }14881488- txdesc->status = cpu_to_le32(TD_TFP);14891489- if (entry >= mdp->num_tx_ring - 1)14901490- txdesc->status |= cpu_to_le32(TD_TDLE);14911491-14921492- ndev->stats.tx_packets++;14931493- ndev->stats.tx_bytes += le32_to_cpu(txdesc->len) >> 16;14941494- }14951495- return free_num;14961496-}14971497-14981412/* Packet receive function */14991413static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)15001414{···17021690 intr_status, mdp->cur_tx, mdp->dirty_tx,17031691 (u32)ndev->state, edtrr);17041692 /* dirty buffer free */17051705- sh_eth_txfree(ndev);16931693+ sh_eth_tx_free(ndev, true);1706169417071695 /* SH7712 BUG */17081696 if (edtrr ^ sh_eth_get_edtrr_trns(mdp)) {···17631751 /* Clear Tx interrupts */17641752 sh_eth_write(ndev, intr_status & cd->tx_check, EESR);1765175317661766- sh_eth_txfree(ndev);17541754+ sh_eth_tx_free(ndev, true);17671755 netif_wake_queue(ndev);17681756 }17691757···2424241224252413 spin_lock_irqsave(&mdp->lock, flags);24262414 if ((mdp->cur_tx - mdp->dirty_tx) >= (mdp->num_tx_ring - 4)) {24272427- if (!sh_eth_txfree(ndev)) {24152415+ if (!sh_eth_tx_free(ndev, true)) {24282416 netif_warn(mdp, tx_queued, ndev, "TxFD exhausted.\n");24292417 netif_stop_queue(ndev);24302418 spin_unlock_irqrestore(&mdp->lock, flags);
+7
drivers/net/ethernet/sfc/efx.c
···13711371 free_cpumask_var(thread_mask);13721372 }1373137313741374+ if (count > EFX_MAX_RX_QUEUES) {13751375+ netif_cond_dbg(efx, probe, efx->net_dev, !rss_cpus, warn,13761376+ "Reducing number of rx queues from %u to %u.\n",13771377+ count, EFX_MAX_RX_QUEUES);13781378+ count = EFX_MAX_RX_QUEUES;13791379+ }13801380+13741381 /* If RSS is requested for the PF *and* VFs then we can't write RSS13751382 * table entries that are inaccessible to VFs13761383 */
+7
drivers/net/ethernet/sfc/falcon/efx.c
···13541354 free_cpumask_var(thread_mask);13551355 }1356135613571357+ if (count > EF4_MAX_RX_QUEUES) {13581358+ netif_cond_dbg(efx, probe, efx->net_dev, !rss_cpus, warn,13591359+ "Reducing number of rx queues from %u to %u.\n",13601360+ count, EF4_MAX_RX_QUEUES);13611361+ count = EF4_MAX_RX_QUEUES;13621362+ }13631363+13571364 return count;13581365}13591366
···243243 }244244245245 if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {246246- if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {246246+ /*247247+ * FIXME: nsio_rw_bytes() may be called from atomic248248+ * context in the btt case and nvdimm_clear_poison()249249+ * takes a sleeping lock. Until the locking can be250250+ * reworked this capability requires that the namespace251251+ * is not claimed by btt.252252+ */253253+ if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)254254+ && (!ndns->claim || !is_nd_btt(ndns->claim))) {247255 long cleared;248256249257 cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
+11-66
drivers/nvdimm/dimm_devs.c
···395395396396int alias_dpa_busy(struct device *dev, void *data)397397{398398- resource_size_t map_end, blk_start, new, busy;398398+ resource_size_t map_end, blk_start, new;399399 struct blk_alloc_info *info = data;400400 struct nd_mapping *nd_mapping;401401 struct nd_region *nd_region;···436436 retry:437437 /*438438 * Find the free dpa from the end of the last pmem allocation to439439- * the end of the interleave-set mapping that is not already440440- * covered by a blk allocation.439439+ * the end of the interleave-set mapping.441440 */442442- busy = 0;443441 for_each_dpa_resource(ndd, res) {442442+ if (strncmp(res->name, "pmem", 4) != 0)443443+ continue;444444 if ((res->start >= blk_start && res->start < map_end)445445 || (res->end >= blk_start446446 && res->end <= map_end)) {447447- if (strncmp(res->name, "pmem", 4) == 0) {448448- new = max(blk_start, min(map_end + 1,449449- res->end + 1));450450- if (new != blk_start) {451451- blk_start = new;452452- goto retry;453453- }454454- } else455455- busy += min(map_end, res->end)456456- - max(nd_mapping->start, res->start) + 1;457457- } else if (nd_mapping->start > res->start458458- && map_end < res->end) {459459- /* total eclipse of the PMEM region mapping */460460- busy += nd_mapping->size;461461- break;447447+ new = max(blk_start, min(map_end + 1, res->end + 1));448448+ if (new != blk_start) {449449+ blk_start = new;450450+ goto retry;451451+ }462452 }463453 }464454···460470 return 1;461471 }462472463463- info->available -= blk_start - nd_mapping->start + busy;473473+ info->available -= blk_start - nd_mapping->start;464474465475 return 0;466466-}467467-468468-static int blk_dpa_busy(struct device *dev, void *data)469469-{470470- struct blk_alloc_info *info = data;471471- struct nd_mapping *nd_mapping;472472- struct nd_region *nd_region;473473- resource_size_t map_end;474474- int i;475475-476476- if (!is_nd_pmem(dev))477477- return 0;478478-479479- nd_region = to_nd_region(dev);480480- for (i = 0; i < nd_region->ndr_mappings; i++) {481481- nd_mapping = &nd_region->mapping[i];482482- if (nd_mapping->nvdimm == info->nd_mapping->nvdimm)483483- break;484484- }485485-486486- if (i >= nd_region->ndr_mappings)487487- return 0;488488-489489- map_end = nd_mapping->start + nd_mapping->size - 1;490490- if (info->res->start >= nd_mapping->start491491- && info->res->start < map_end) {492492- if (info->res->end <= map_end) {493493- info->busy = 0;494494- return 1;495495- } else {496496- info->busy -= info->res->end - map_end;497497- return 0;498498- }499499- } else if (info->res->end >= nd_mapping->start500500- && info->res->end <= map_end) {501501- info->busy -= nd_mapping->start - info->res->start;502502- return 0;503503- } else {504504- info->busy -= nd_mapping->size;505505- return 0;506506- }507476}508477509478/**···494545 for_each_dpa_resource(ndd, res) {495546 if (strncmp(res->name, "blk", 3) != 0)496547 continue;497497-498498- info.res = res;499499- info.busy = resource_size(res);500500- device_for_each_child(&nvdimm_bus->dev, &info, blk_dpa_busy);501501- info.available -= info.busy;548548+ info.available -= resource_size(res);502549 }503550504551 return info.available;
···18731873 spin_unlock_irqrestore(&aac->fib_lock, flagv);1874187418751875 if (BlinkLED < 0) {18761876- printk(KERN_ERR "%s: Host adapter dead %d\n", aac->name, BlinkLED);18761876+ printk(KERN_ERR "%s: Host adapter is dead (or got a PCI error) %d\n",18771877+ aac->name, BlinkLED);18771878 goto out;18781879 }18791880
+6-1
drivers/scsi/ipr.c
···62936293 break;62946294 case IPR_IOASC_MED_DO_NOT_REALLOC: /* prevent retries */62956295 case IPR_IOASA_IR_DUAL_IOA_DISABLED:62966296- scsi_cmd->result |= (DID_PASSTHROUGH << 16);62966296+ /*62976297+ * exception: do not set DID_PASSTHROUGH on CHECK CONDITION62986298+ * so SCSI mid-layer and upper layers handle it accordingly.62996299+ */63006300+ if (scsi_cmd->result != SAM_STAT_CHECK_CONDITION)63016301+ scsi_cmd->result |= (DID_PASSTHROUGH << 16);62976302 break;62986303 case IPR_IOASC_BUS_WAS_RESET:62996304 case IPR_IOASC_BUS_WAS_RESET_BY_OTHER:
+2-1
drivers/scsi/qedf/qedf_fip.c
···9999 qedf_set_vlan_id(qedf, vid);100100101101 /* Inform waiter that it's ok to call fcoe_ctlr_link up() */102102- complete(&qedf->fipvlan_compl);102102+ if (!completion_done(&qedf->fipvlan_compl))103103+ complete(&qedf->fipvlan_compl);103104 }104105}105106
···2102210221032103#define READ_CAPACITY_RETRIES_ON_RESET 102104210421052105+/*21062106+ * Ensure that we don't overflow sector_t when CONFIG_LBDAF is not set21072107+ * and the reported logical block size is bigger than 512 bytes. Note21082108+ * that last_sector is a u64 and therefore logical_to_sectors() is not21092109+ * applicable.21102110+ */21112111+static bool sd_addressable_capacity(u64 lba, unsigned int sector_size)21122112+{21132113+ u64 last_sector = (lba + 1ULL) << (ilog2(sector_size) - 9);21142114+21152115+ if (sizeof(sector_t) == 4 && last_sector > U32_MAX)21162116+ return false;21172117+21182118+ return true;21192119+}21202120+21052121static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,21062122 unsigned char *buffer)21072123{···21832167 return -ENODEV;21842168 }2185216921862186- if ((sizeof(sdkp->capacity) == 4) && (lba >= 0xffffffffULL)) {21702170+ if (!sd_addressable_capacity(lba, sector_size)) {21872171 sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a "21882172 "kernel compiled with support for large block "21892173 "devices.\n");···22722256 return sector_size;22732257 }2274225822752275- if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) {22592259+ if (!sd_addressable_capacity(lba, sector_size)) {22762260 sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a "22772261 "kernel compiled with support for large block "22782262 "devices.\n");···29722956 q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);29732957 rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);29742958 } else29752975- rw_max = BLK_DEF_MAX_SECTORS;29592959+ rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),29602960+ (sector_t)BLK_DEF_MAX_SECTORS);2976296129772962 /* Combine with controller limits */29782963 q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q));
···492492}493493494494/**495495+ * tty_ldisc_restore - helper for tty ldisc change496496+ * @tty: tty to recover497497+ * @old: previous ldisc498498+ *499499+ * Restore the previous line discipline or N_TTY when a line discipline500500+ * change fails due to an open error501501+ */502502+503503+static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old)504504+{505505+ struct tty_ldisc *new_ldisc;506506+ int r;507507+508508+ /* There is an outstanding reference here so this is safe */509509+ old = tty_ldisc_get(tty, old->ops->num);510510+ WARN_ON(IS_ERR(old));511511+ tty->ldisc = old;512512+ tty_set_termios_ldisc(tty, old->ops->num);513513+ if (tty_ldisc_open(tty, old) < 0) {514514+ tty_ldisc_put(old);515515+ /* This driver is always present */516516+ new_ldisc = tty_ldisc_get(tty, N_TTY);517517+ if (IS_ERR(new_ldisc))518518+ panic("n_tty: get");519519+ tty->ldisc = new_ldisc;520520+ tty_set_termios_ldisc(tty, N_TTY);521521+ r = tty_ldisc_open(tty, new_ldisc);522522+ if (r < 0)523523+ panic("Couldn't open N_TTY ldisc for "524524+ "%s --- error %d.",525525+ tty_name(tty), r);526526+ }527527+}528528+529529+/**495530 * tty_set_ldisc - set line discipline496531 * @tty: the terminal to set497532 * @ldisc: the line discipline···539504540505int tty_set_ldisc(struct tty_struct *tty, int disc)541506{542542- int retval, old_disc;507507+ int retval;508508+ struct tty_ldisc *old_ldisc, *new_ldisc;509509+510510+ new_ldisc = tty_ldisc_get(tty, disc);511511+ if (IS_ERR(new_ldisc))512512+ return PTR_ERR(new_ldisc);543513544514 tty_lock(tty);545515 retval = tty_ldisc_lock(tty, 5 * HZ);···557517 }558518559519 /* Check the no-op case */560560- old_disc = tty->ldisc->ops->num;561561- if (old_disc == disc)520520+ if (tty->ldisc->ops->num == disc)562521 goto out;563522564523 if (test_bit(TTY_HUPPED, &tty->flags)) {···566527 goto out;567528 }568529569569- retval = tty_ldisc_reinit(tty, disc);530530+ old_ldisc = tty->ldisc;531531+532532+ /* Shutdown the old discipline. */533533+ tty_ldisc_close(tty, old_ldisc);534534+535535+ /* Now set up the new line discipline. */536536+ tty->ldisc = new_ldisc;537537+ tty_set_termios_ldisc(tty, disc);538538+539539+ retval = tty_ldisc_open(tty, new_ldisc);570540 if (retval < 0) {571541 /* Back to the old one or N_TTY if we can't */572572- if (tty_ldisc_reinit(tty, old_disc) < 0) {573573- pr_err("tty: TIOCSETD failed, reinitializing N_TTY\n");574574- if (tty_ldisc_reinit(tty, N_TTY) < 0) {575575- /* At this point we have tty->ldisc == NULL. */576576- pr_err("tty: reinitializing N_TTY failed\n");577577- }578578- }542542+ tty_ldisc_put(new_ldisc);543543+ tty_ldisc_restore(tty, old_ldisc);579544 }580545581581- if (tty->ldisc && tty->ldisc->ops->num != old_disc &&582582- tty->ops->set_ldisc) {546546+ if (tty->ldisc->ops->num != old_ldisc->ops->num && tty->ops->set_ldisc) {583547 down_read(&tty->termios_rwsem);584548 tty->ops->set_ldisc(tty);585549 up_read(&tty->termios_rwsem);586550 }587551552552+ /* At this point we hold a reference to the new ldisc and a553553+ reference to the old ldisc, or we hold two references to554554+ the old ldisc (if it was restored as part of error cleanup555555+ above). In either case, releasing a single reference from556556+ the old ldisc is correct. */557557+ new_ldisc = old_ldisc;588558out:589559 tty_ldisc_unlock(tty);590560···601553 already running */602554 tty_buffer_restart_work(tty->port);603555err:556556+ tty_ldisc_put(new_ldisc); /* drop the extra reference */604557 tty_unlock(tty);605558 return retval;606559}···662613 int retval;663614664615 ld = tty_ldisc_get(tty, disc);665665- if (IS_ERR(ld))616616+ if (IS_ERR(ld)) {617617+ BUG_ON(disc == N_TTY);666618 return PTR_ERR(ld);619619+ }667620668621 if (tty->ldisc) {669622 tty_ldisc_close(tty, tty->ldisc);···677626 tty_set_termios_ldisc(tty, disc);678627 retval = tty_ldisc_open(tty, tty->ldisc);679628 if (retval) {680680- tty_ldisc_put(tty->ldisc);681681- tty->ldisc = NULL;629629+ if (!WARN_ON(disc == N_TTY)) {630630+ tty_ldisc_put(tty->ldisc);631631+ tty->ldisc = NULL;632632+ }682633 }683634 return retval;684635}
+3
fs/namei.c
···21452145 int retval = 0;21462146 const char *s = nd->name->name;2147214721482148+ if (!*s)21492149+ flags &= ~LOOKUP_RCU;21502150+21482151 nd->last_type = LAST_ROOT; /* if there are only slashes... */21492152 nd->flags = flags | LOOKUP_JUMPED | LOOKUP_PARENT;21502153 nd->depth = 0;
+7-2
fs/orangefs/devorangefs-req.c
···208208 continue;209209 /*210210 * Skip ops whose filesystem we don't know about unless211211- * it is being mounted.211211+ * it is being mounted or unmounted. It is possible for212212+ * a filesystem we don't know about to be unmounted if213213+ * it fails to mount in the kernel after userspace has214214+ * been sent the mount request.212215 */213216 /* XXX: is there a better way to detect this? */214217 } else if (ret == -1 &&215218 !(op->upcall.type ==216219 ORANGEFS_VFS_OP_FS_MOUNT ||217220 op->upcall.type ==218218- ORANGEFS_VFS_OP_GETATTR)) {221221+ ORANGEFS_VFS_OP_GETATTR ||222222+ op->upcall.type ==223223+ ORANGEFS_VFS_OP_FS_UMOUNT)) {219224 gossip_debug(GOSSIP_DEV_DEBUG,220225 "orangefs: skipping op tag %llu %s\n",221226 llu(op->tag), get_opname_string(op));
+1
fs/orangefs/orangefs-kernel.h
···249249 char devname[ORANGEFS_MAX_SERVER_ADDR_LEN];250250 struct super_block *sb;251251 int mount_pending;252252+ int no_list;252253 struct list_head list;253254};254255
+16-7
fs/orangefs/super.c
···493493494494 if (ret) {495495 d = ERR_PTR(ret);496496- goto free_op;496496+ goto free_sb_and_op;497497 }498498499499 /*···519519 spin_unlock(&orangefs_superblocks_lock);520520 op_release(new_op);521521522522+ /* Must be removed from the list now. */523523+ ORANGEFS_SB(sb)->no_list = 0;524524+522525 if (orangefs_userspace_version >= 20906) {523526 new_op = op_alloc(ORANGEFS_VFS_OP_FEATURES);524527 if (!new_op)···536533537534 return dget(sb->s_root);538535536536+free_sb_and_op:537537+ /* Will call orangefs_kill_sb with sb not in list. */538538+ ORANGEFS_SB(sb)->no_list = 1;539539+ deactivate_locked_super(sb);539540free_op:540541 gossip_err("orangefs_mount: mount request failed with %d\n", ret);541542 if (ret == -EINVAL) {···565558 */566559 orangefs_unmount_sb(sb);567560568568- /* remove the sb from our list of orangefs specific sb's */569569-570570- spin_lock(&orangefs_superblocks_lock);571571- __list_del_entry(&ORANGEFS_SB(sb)->list); /* not list_del_init */572572- ORANGEFS_SB(sb)->list.prev = NULL;573573- spin_unlock(&orangefs_superblocks_lock);561561+ if (!ORANGEFS_SB(sb)->no_list) {562562+ /* remove the sb from our list of orangefs specific sb's */563563+ spin_lock(&orangefs_superblocks_lock);564564+ /* not list_del_init */565565+ __list_del_entry(&ORANGEFS_SB(sb)->list);566566+ ORANGEFS_SB(sb)->list.prev = NULL;567567+ spin_unlock(&orangefs_superblocks_lock);568568+ }574569575570 /*576571 * make sure that ORANGEFS_DEV_REMOUNT_ALL loop that might've seen us
···16721672 return true;16731673}1674167416751675-static inline bool bio_will_gap(struct request_queue *q, struct bio *prev,16761676- struct bio *next)16751675+static inline bool bio_will_gap(struct request_queue *q,16761676+ struct request *prev_rq,16771677+ struct bio *prev,16781678+ struct bio *next)16771679{16781680 if (bio_has_data(prev) && queue_virt_boundary(q)) {16791681 struct bio_vec pb, nb;1680168216831683+ /*16841684+ * don't merge if the 1st bio starts with non-zero16851685+ * offset, otherwise it is quite difficult to respect16861686+ * sg gap limit. We work hard to merge a huge number of small16871687+ * single bios in case of mkfs.16881688+ */16891689+ if (prev_rq)16901690+ bio_get_first_bvec(prev_rq->bio, &pb);16911691+ else16921692+ bio_get_first_bvec(prev, &pb);16931693+ if (pb.bv_offset)16941694+ return true;16951695+16961696+ /*16971697+ * We don't need to worry about the situation that the16981698+ * merged segment ends in unaligned virt boundary:16991699+ *17001700+ * - if 'pb' ends aligned, the merged segment ends aligned17011701+ * - if 'pb' ends unaligned, the next bio must include17021702+ * one single bvec of 'nb', otherwise the 'nb' can't17031703+ * merge with 'pb'17041704+ */16811705 bio_get_last_bvec(prev, &pb);16821706 bio_get_first_bvec(next, &nb);16831707···1714169017151691static inline bool req_gap_back_merge(struct request *req, struct bio *bio)17161692{17171717- return bio_will_gap(req->q, req->biotail, bio);16931693+ return bio_will_gap(req->q, req, req->biotail, bio);17181694}1719169517201696static inline bool req_gap_front_merge(struct request *req, struct bio *bio)17211697{17221722- return bio_will_gap(req->q, bio, req->bio);16981698+ return bio_will_gap(req->q, NULL, bio, req->bio);17231699}1724170017251701int kblockd_schedule_work(struct work_struct *work);
···33493349 if (insn->imm == BPF_FUNC_xdp_adjust_head)33503350 prog->xdp_adjust_head = 1;33513351 if (insn->imm == BPF_FUNC_tail_call) {33523352+ /* If we tail call into other programs, we33533353+ * cannot make any assumptions since they can33543354+ * be replaced dynamically during runtime in33553355+ * the program array.33563356+ */33573357+ prog->cb_access = 1;33583358+ prog->xdp_adjust_head = 1;33593359+33523360 /* mark bpf_tail_call as different opcode to avoid33533361 * conditional branch in the interpeter for every normal33543362 * call and to prevent accidental JITing by JIT compiler
+1-1
kernel/cgroup/cgroup-v1.c
···11461146 * path is super cold. Let's just sleep a bit and retry.11471147 */11481148 pinned_sb = kernfs_pin_sb(root->kf_root, NULL);11491149- if (IS_ERR_OR_NULL(pinned_sb) ||11491149+ if (IS_ERR(pinned_sb) ||11501150 !percpu_ref_tryget_live(&root->cgrp.self.refcnt)) {11511151 mutex_unlock(&cgroup_mutex);11521152 if (!IS_ERR_OR_NULL(pinned_sb))
+3-3
kernel/locking/lockdep_internals.h
···4646 (LOCKF_USED_IN_HARDIRQ_READ | LOCKF_USED_IN_SOFTIRQ_READ)47474848/*4949- * CONFIG_PROVE_LOCKING_SMALL is defined for sparc. Sparc requires .text,4949+ * CONFIG_LOCKDEP_SMALL is defined for sparc. Sparc requires .text,5050 * .data and .bss to fit in required 32MB limit for the kernel. With5151- * PROVE_LOCKING we could go over this limit and cause system boot-up problems.5151+ * CONFIG_LOCKDEP we could go over this limit and cause system boot-up problems.5252 * So, reduce the static allocations for lockdeps related structures so that5353 * everything fits in current required size limit.5454 */5555-#ifdef CONFIG_PROVE_LOCKING_SMALL5555+#ifdef CONFIG_LOCKDEP_SMALL5656/*5757 * MAX_LOCKDEP_ENTRIES is the maximum number of lock dependencies5858 * we track.
+25-4
kernel/trace/ftrace.c
···37553755 ftrace_probe_registered = 1;37563756}3757375737583758-static void __disable_ftrace_function_probe(void)37583758+static bool __disable_ftrace_function_probe(void)37593759{37603760 int i;3761376137623762 if (!ftrace_probe_registered)37633763- return;37633763+ return false;3764376437653765 for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) {37663766 struct hlist_head *hhd = &ftrace_func_hash[i];37673767 if (hhd->first)37683768- return;37683768+ return false;37693769 }3770377037713771 /* no more funcs left */37723772 ftrace_shutdown(&trace_probe_ops, 0);3773377337743774 ftrace_probe_registered = 0;37753775+ return true;37753776}3776377737773778···39023901__unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,39033902 void *data, int flags)39043903{39043904+ struct ftrace_ops_hash old_hash_ops;39053905 struct ftrace_func_entry *rec_entry;39063906 struct ftrace_func_probe *entry;39073907 struct ftrace_func_probe *p;···39143912 struct hlist_node *tmp;39153913 char str[KSYM_SYMBOL_LEN];39163914 int i, ret;39153915+ bool disabled;3917391639183917 if (glob && (strcmp(glob, "*") == 0 || !strlen(glob)))39193918 func_g.search = NULL;···39323929 }3933393039343931 mutex_lock(&trace_probe_ops.func_hash->regex_lock);39323932+39333933+ old_hash_ops.filter_hash = old_hash;39343934+ /* Probes only have filters */39353935+ old_hash_ops.notrace_hash = NULL;3935393639363937 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash);39373938 if (!hash)···39743967 }39753968 }39763969 mutex_lock(&ftrace_lock);39773977- __disable_ftrace_function_probe();39703970+ disabled = __disable_ftrace_function_probe();39783971 /*39793972 * Remove after the disable is called. Otherwise, if the last39803973 * probe is removed, a null hash means *all enabled*.39813974 */39823975 ret = ftrace_hash_move(&trace_probe_ops, 1, orig_hash, hash);39763976+39773977+ /* still need to update the function call sites */39783978+ if (ftrace_enabled && !disabled)39793979+ ftrace_run_modify_code(&trace_probe_ops, FTRACE_UPDATE_CALLS,39803980+ &old_hash_ops);39833981 synchronize_sched();39843982 if (!ret)39853983 free_ftrace_hash_rcu(old_hash);···55645552 synchronize_sched();5565555355665554 trace_free_pid_list(pid_list);55555555+}55565556+55575557+void ftrace_clear_pids(struct trace_array *tr)55585558+{55595559+ mutex_lock(&ftrace_lock);55605560+55615561+ clear_ftrace_pids(tr);55625562+55635563+ mutex_unlock(&ftrace_lock);55675564}5568556555695566static void ftrace_pid_reset(struct trace_array *tr)
···488488 return false;489489490490 /* Support IP_PKTINFO on tstamp packets if requested, to correlate491491- * timestamp with egress dev. Not possible for packets without dev491491+ * timestamp with egress dev. Not possible for packets without iif492492 * or without payload (SOF_TIMESTAMPING_OPT_TSONLY).493493 */494494- if ((!(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_CMSG)) ||495495- (!skb->dev))494494+ info = PKTINFO_SKB_CB(skb);495495+ if (!(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_CMSG) ||496496+ !info->ipi_ifindex)496497 return false;497498498498- info = PKTINFO_SKB_CB(skb);499499 info->ipi_spec_dst.s_addr = ip_hdr(skb)->saddr;500500- info->ipi_ifindex = skb->dev->ifindex;501500 return true;502501}503502···590591 case MCAST_LEAVE_GROUP:591592 case MCAST_LEAVE_SOURCE_GROUP:592593 case MCAST_UNBLOCK_SOURCE:594594+ case IP_ROUTER_ALERT:593595 return true;594596 }595597 return false;
+2-9
net/ipv4/ipmr.c
···12781278 struct net *net = sock_net(sk);12791279 struct mr_table *mrt;1280128012811281- rtnl_lock();12811281+ ASSERT_RTNL();12821282 ipmr_for_each_table(mrt, net) {12831283 if (sk == rtnl_dereference(mrt->mroute_sk)) {12841284 IPV4_DEVCONF_ALL(net, MC_FORWARDING)--;···12901290 mroute_clean_tables(mrt, false);12911291 }12921292 }12931293- rtnl_unlock();12941293}1295129412961295/* Socket options and virtual interface manipulation. The whole···13541355 if (sk != rcu_access_pointer(mrt->mroute_sk)) {13551356 ret = -EACCES;13561357 } else {13571357- /* We need to unlock here because mrtsock_destruct takes13581358- * care of rtnl itself and we can't change that due to13591359- * the IP_ROUTER_ALERT setsockopt which runs without it.13601360- */13611361- rtnl_unlock();13621358 ret = ip_ra_control(sk, 0, NULL);13631363- goto out;13591359+ goto out_unlock;13641360 }13651361 break;13661362 case MRT_ADD_VIF:···14661472 }14671473out_unlock:14681474 rtnl_unlock();14691469-out:14701475 return ret;14711476}14721477
+2
net/ipv4/raw.c
···682682 /*683683 * Raw sockets may have direct kernel references. Kill them.684684 */685685+ rtnl_lock();685686 ip_ra_control(sk, 0, NULL);687687+ rtnl_unlock();686688687689 sk_common_release(sk);688690}
+1-9
net/ipv6/datagram.c
···405405 * At one point, excluding local errors was a quick test to identify icmp/icmp6406406 * errors. This is no longer true, but the test remained, so the v6 stack,407407 * unlike v4, also honors cmsg requests on all wifi and timestamp errors.408408- *409409- * Timestamp code paths do not initialize the fields expected by cmsg:410410- * the PKTINFO fields in skb->cb[]. Fill those in here.411408 */412409static bool ip6_datagram_support_cmsg(struct sk_buff *skb,413410 struct sock_exterr_skb *serr)···416419 if (serr->ee.ee_origin == SO_EE_ORIGIN_LOCAL)417420 return false;418421419419- if (!skb->dev)422422+ if (!IP6CB(skb)->iif)420423 return false;421421-422422- if (skb->protocol == htons(ETH_P_IPV6))423423- IP6CB(skb)->iif = skb->dev->ifindex;424424- else425425- PKTINFO_SKB_CB(skb)->ipi_ifindex = skb->dev->ifindex;426424427425 return true;428426}
+5-2
net/ipv6/ip6_input.c
···124124 max_t(unsigned short, 1, skb_shinfo(skb)->gso_segs));125125 /*126126 * RFC4291 2.5.3127127+ * The loopback address must not be used as the source address in IPv6128128+ * packets that are sent outside of a single node. [..]127129 * A packet received on an interface with a destination address128130 * of loopback must be dropped.129131 */130130- if (!(dev->flags & IFF_LOOPBACK) &&131131- ipv6_addr_loopback(&hdr->daddr))132132+ if ((ipv6_addr_loopback(&hdr->saddr) ||133133+ ipv6_addr_loopback(&hdr->daddr)) &&134134+ !(dev->flags & IFF_LOOPBACK))132135 goto err;133136134137 /* RFC4291 Errata ID: 3480