diff --git a/Makefile b/Makefile index 518e683..bd8682f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 2018 PATCHLEVEL = 09 -SUBLEVEL = 0 +SUBLEVEL = 1 EXTRAVERSION = NAME = None diff --git a/arch/arm/cpu/sections.c b/arch/arm/cpu/sections.c index 5874da2..ab08ebf 100644 --- a/arch/arm/cpu/sections.c +++ b/arch/arm/cpu/sections.c @@ -1,4 +1,5 @@ #include +#include char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start"))); char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end"))); @@ -9,3 +10,4 @@ char __bss_stop[0] __attribute__((section(".__bss_stop"))); char __image_start[0] __attribute__((section(".__image_start"))); char __image_end[0] __attribute__((section(".__image_end"))); +uint32_t __image_end_marker[1] __attribute__((section(".__image_end_marker"))) = { 0xdeadbeef }; diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c index b07087e..43b49b4 100644 --- a/arch/arm/cpu/uncompress.c +++ b/arch/arm/cpu/uncompress.c @@ -36,9 +36,6 @@ unsigned long free_mem_ptr; unsigned long free_mem_end_ptr; -static int __attribute__((__section__(".image_end"))) - image_end_marker = 0xdeadbeef; - void __noreturn barebox_multi_pbl_start(unsigned long membase, unsigned long memsize, void *boarddata) { @@ -50,7 +47,7 @@ void *pg_start; unsigned long pc = get_pc(); - image_end = (void *)&image_end_marker + global_variable_offset(); + image_end = (void *)__image_end_marker + global_variable_offset(); if (IS_ENABLED(CONFIG_PBL_RELOCATABLE)) { /* diff --git a/arch/arm/include/asm/sections.h b/arch/arm/include/asm/sections.h index 6933c70..b465925 100644 --- a/arch/arm/include/asm/sections.h +++ b/arch/arm/include/asm/sections.h @@ -3,6 +3,7 @@ #ifndef __ASSEMBLY__ #include +#include extern char __rel_dyn_start[]; extern char __rel_dyn_end[]; @@ -10,6 +11,7 @@ extern char __dynsym_end[]; extern char __exceptions_start[]; extern char __exceptions_stop[]; +extern uint32_t __image_end_marker[]; #endif diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S index 9df1800..ddc65bb 100644 --- a/arch/arm/lib/pbl.lds.S +++ b/arch/arm/lib/pbl.lds.S @@ -92,7 +92,7 @@ __piggydata_end = .; . = ALIGN(4); - .image_end : { *(.image_end) } + .image_end : { *(.__image_end_marker) } __image_end = .; _barebox_image_size = __image_end - BASE; diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index d8b1c9e..bb58825 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -236,6 +236,7 @@ char *file; char ip4_str[sizeof("255.255.255.255")]; struct eth_device *edev; + struct dhcp_result *dhcp_res; am33xx_register_ethaddr(0, 0); @@ -248,12 +249,14 @@ return NULL; } - err = dhcp(edev, &dhcp_param); + err = dhcp_request(edev, &dhcp_param, &dhcp_res); if (err) { printf("dhcp failed\n"); return NULL; } + dhcp_set_result(edev, dhcp_res); + /* * Older tftp server don't send the file size. * Then tftpfs needs temporary place to store the file. @@ -276,7 +279,7 @@ return NULL; } - bootfile = getenv("bootfile"); + bootfile = dhcp_res->bootfile; if (!bootfile) { printf("bootfile not found.\n"); return NULL; diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S index 660d4be..c4026bb 100644 --- a/arch/mips/lib/barebox.lds.S +++ b/arch/mips/lib/barebox.lds.S @@ -75,6 +75,17 @@ __usymtab : { BAREBOX_SYMS } __usymtab_end = .; +#ifdef CONFIG_PCI + __start_pci_fixups_early = .; + .pci_fixup_early : { KEEP(*(.pci_fixup_early)) } + __end_pci_fixups_early = .; + __start_pci_fixups_header = .; + .pci_fixup_header : { KEEP(*(.pci_fixup_header)) } + __end_pci_fixups_header = .; + __start_pci_fixups_enable = .; + .pci_fixup_enable : { KEEP(*(.pci_fixup_enable)) } + __end_pci_fixups_enable = .; +#endif .oftables : { BAREBOX_CLK_TABLE() } .dtb : { BAREBOX_DTB() } diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index ffe03c8..dd17a74 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c @@ -152,6 +152,7 @@ clkdev_add_physbase(clks[fec], IMX_FEC0_BASE, NULL); clkdev_add_physbase(clks[xbus], IMX_DBGUART_BASE, NULL); clkdev_add_physbase(clks[hbus], IMX_OCOTP_BASE, NULL); + clkdev_add_physbase(clks[hbus], MXS_APBH_BASE, NULL); clkdev_add_physbase(clks[uart], IMX_UART0_BASE, NULL); clkdev_add_physbase(clks[uart], IMX_UART1_BASE, NULL); clkdev_add_physbase(clks[uart], IMX_UART2_BASE, NULL); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d206c53..7abc7a3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -339,7 +339,7 @@ struct device_node *np; u32 reg; - if (!IS_ENABLED(CONFIG_OFTREE) || !parent->device_node) + if (!IS_ENABLED(CONFIG_OFTREE) || !parent || !parent->device_node) return NULL; for_each_child_of_node(parent->device_node, np) { diff --git a/fs/devfs.c b/fs/devfs.c index 5d0bb2c..717e66c 100644 --- a/fs/devfs.c +++ b/fs/devfs.c @@ -212,6 +212,32 @@ static const struct inode_operations devfs_dir_inode_operations; static const struct file_operations devfs_file_operations; +static int devfs_lookup_revalidate(struct dentry *dentry, unsigned int flags) +{ + struct devfs_inode *dinode; + struct inode *inode; + struct cdev *cdev; + + cdev = cdev_by_name(dentry->name); + if (!cdev) + return -ENOENT; + + inode = d_inode(dentry); + if (!inode) + return 0; + + dinode = container_of(inode, struct devfs_inode, inode); + + if (dinode->cdev != cdev) + return 0; + + return 1; +} + +static const struct dentry_operations devfs_dentry_operations = { + .d_revalidate = devfs_lookup_revalidate, +}; + static struct inode *devfs_get_inode(struct super_block *sb, const struct inode *dir, umode_t mode) { @@ -226,7 +252,7 @@ switch (mode & S_IFMT) { default: return NULL; - case S_IFREG: + case S_IFCHR: inode->i_op = &devfs_file_inode_operations; inode->i_fop = &devfs_file_operations; break; @@ -251,10 +277,15 @@ if (!cdev) return ERR_PTR(-ENOENT); - inode = devfs_get_inode(dir->i_sb, dir, S_IFREG | S_IRWXUGO); + inode = devfs_get_inode(dir->i_sb, dir, S_IFCHR); if (!inode) return ERR_PTR(-ENOMEM); + if (cdev->ops->write) + inode->i_mode |= S_IWUSR; + if (cdev->ops->read) + inode->i_mode |= S_IRUSR; + dinode = container_of(inode, struct devfs_inode, inode); inode->i_size = cdev->size; @@ -285,6 +316,7 @@ struct super_block *sb = &fsdev->sb; sb->s_op = &devfs_ops; + sb->s_d_op = &devfs_dentry_operations; inode = devfs_get_inode(sb, NULL, S_IFDIR); sb->s_root = d_make_root(inode); diff --git a/fs/fs.c b/fs/fs.c index 41818ea..a86279d 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -1101,6 +1101,12 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op) { dentry->d_op = op; + + if (!op) + return; + + if (op->d_revalidate) + dentry->d_flags |= DCACHE_OP_REVALIDATE; } /** @@ -1245,6 +1251,35 @@ { } +static inline int d_revalidate(struct dentry *dentry, unsigned int flags) +{ + if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) + return dentry->d_op->d_revalidate(dentry, flags); + else + return 1; +} + +/* + * This looks up the name in dcache and possibly revalidates the found dentry. + * NULL is returned if the dentry does not exist in the cache. + */ +static struct dentry *lookup_dcache(const struct qstr *name, + struct dentry *dir, + unsigned int flags) +{ + struct dentry *dentry = d_lookup(dir, name); + if (dentry) { + int error = d_revalidate(dentry, flags); + if (unlikely(error <= 0)) { + if (!error) + d_invalidate(dentry); + dput(dentry); + return ERR_PTR(error); + } + } + return dentry; +} + static inline void __d_clear_type_and_inode(struct dentry *dentry) { dentry->d_flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU); @@ -1456,7 +1491,7 @@ if (!base) return ERR_PTR(-ENOENT); - dentry = d_lookup(base, name); + dentry = lookup_dcache(name, base, flags); if (dentry) return dentry; @@ -2237,7 +2272,7 @@ putname(nd.name); if (error) - return error; + goto out1; if (d_is_negative(dentry)) { if (flags & O_CREAT) { @@ -2535,6 +2570,9 @@ out_put: path_put(&path); out: + if (ret) + errno = -ret; + return ret; } diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index abf8ef6..977c723 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2590,6 +2590,5 @@ return 0; out: kfree(c); - kfree(sb); return err; } diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 1624412..1581ddc 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -82,6 +82,7 @@ }; struct dentry_operations { + int (*d_revalidate)(struct dentry *, unsigned int); }; struct dentry * d_make_root(struct inode *); @@ -93,6 +94,8 @@ struct dentry *dget(struct dentry *); void dput(struct dentry *); +#define DCACHE_OP_REVALIDATE 0x00000004 + #define DCACHE_ENTRY_TYPE 0x00700000 #define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry (maybe fallthru to nowhere) */ #define DCACHE_WHITEOUT_TYPE 0x00100000 /* Whiteout dentry (stop pathwalk) */