diff --git a/bin/chmod/tests/chmod_test.sh b/bin/chmod/tests/chmod_test.sh index 4a6a6a3d21ef..0ac438d3c5a6 100755 --- a/bin/chmod/tests/chmod_test.sh +++ b/bin/chmod/tests/chmod_test.sh @@ -25,6 +25,13 @@ # # $FreeBSD$ +get_filesystem() +{ + local mountpoint=$1 + + df -T $mountpoint | tail -n 1 | cut -wf 2 +} + atf_test_case RH_flag RH_flag_head() { @@ -94,6 +101,11 @@ f_flag_body() { atf_check truncate -s 0 foo bar atf_check chmod 0750 foo bar + case "$(get_filesystem .)" in + zfs) + atf_expect_fail "ZFS doesn't support UF_IMMUTABLE; returns EPERM - bug 221189" + ;; + esac atf_check chflags uchg foo atf_check -e not-empty -s not-exit:0 chmod 0700 foo bar atf_check -o inline:'100750\n100700\n' stat -f '%p' foo bar @@ -140,6 +152,11 @@ v_flag_body() atf_check truncate -s 0 foo bar atf_check chmod 0600 foo atf_check chmod 0750 bar + case "$(get_filesystem .)" in + zfs) + atf_expect_fail "ZFS updates mode for foo unnecessarily - bug 221188" + ;; + esac atf_check -o 'inline:bar\n' chmod -v 0600 foo bar atf_check chmod -v 0600 foo bar for f in foo bar; do diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c index b9ecd9dccfa0..7545331b40b4 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_INLANES: + cflag = ZFS_CMD_COMPAT_INLANES; + break; case ZFS_IOCVER_RESUME: cflag = ZFS_CMD_COMPAT_RESUME; break; diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index a3361a1b2c74..ef81fca06ddd 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd July 5, 2017 +.Dd August 2, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1156,6 +1156,12 @@ and remove entries. .It Va WITHOUT_NLS Set to not build NLS catalogs. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_NLS_CATALOGS +.El .It Va WITHOUT_NLS_CATALOGS Set to not build NLS catalog support for .Xr csh 1 . diff --git a/share/misc/organization.dot b/share/misc/organization.dot index 16d89fa82485..5fa6c2773a4a 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -57,7 +57,7 @@ webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\ngjb, wblock, blackend,\ # Misc hats go here alphabetically sorted donations [label="Donations Team\ndonations@FreeBSD.org\nwilko, gahr, pgolluci,\nobrien, trhodes, ds,\nrwatson"] -marketing [label="Marketing Team\nmarketing@FreeBSD.org\nSteven Beedle, Denise Ebery, deb,\njkoshy, Dru Lavigne, mwlucas, imp,\nKris Moore, murray, mattt,\nJeremy C. Reed, rwatson"] +marketing [label="Marketing Team\nmarketing@FreeBSD.org\nSteven Beedle, Denise Ebery, deb,\njkoshy, dru, mwlucas, imp,\nKris Moore, murray, mattt,\nJeremy C. Reed, rwatson"] vendorrelations [label="Vendor Relations\nvendor-relations@FreeBSD.org\ncore, FreeBSD Foundation"] # Here are the team relationships. diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 5ecddeac957c..c69e4d532224 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -4,7 +4,7 @@ # # Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf # and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} -# with sensible (usually) defaults. +# with (usually) sensible defaults. # # Makefiles must include bsd.opts.mk after defining specific MK_FOO options that # are applicable for that Makefile (typically there are none, but sometimes there @@ -41,7 +41,7 @@ ____: # # Only these options are used by bsd.*.mk. KERBEROS and OPENSSH are -# unforutnately needed to support statically linking the entire +# unfortunately needed to support statically linking the entire # tree. su(1) wouldn't link since it depends on PAM which depends on # ssh libraries when building with OPENSSH, and likewise for KERBEROS. @@ -74,7 +74,6 @@ __DEFAULT_NO_OPTIONS = \ INSTALL_AS_USER \ STALE_STAGED -# meta mode related __DEFAULT_DEPENDENT_OPTIONS = \ MAKE_CHECK_USE_SANDBOX/TESTS \ STAGING_MAN/STAGING \ diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 73ec2aff0c3d..1c100af191ab 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -375,6 +375,10 @@ MK_ATM:= no MK_BLUETOOTH:= no .endif +.if ${MK_NLS} == "no" +MK_NLS_CATALOGS:= no +.endif + .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 7fef80d1ff30..122817bc67dc 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -370,7 +370,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); - break; + goto out; #endif /* DEV_ISA */ case T_OFLOW: /* integer overflow fault */ @@ -408,7 +408,7 @@ trap(struct trapframe *frame) if (dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - break; + goto userout; #endif } } else { @@ -935,6 +935,6 @@ amd64_syscall(struct thread *td, int traced) * not be safe. Instead, use the full return path which * catches the problem safely. */ - if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) + if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } diff --git a/sys/amd64/cloudabi64/cloudabi64_sysvec.c b/sys/amd64/cloudabi64/cloudabi64_sysvec.c index 679888bf52ad..90c10a558732 100644 --- a/sys/amd64/cloudabi64/cloudabi64_sysvec.c +++ b/sys/amd64/cloudabi64/cloudabi64_sysvec.c @@ -199,7 +199,8 @@ static struct sysentvec cloudabi64_elf_sysvec = { .sv_coredump = elf64_coredump, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = VM_MAXUSER_ADDRESS, + /* Keep top page reserved to work around AMD Ryzen stability issues. */ + .sv_maxuser = VM_MAXUSER_ADDRESS - PAGE_SIZE, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = cloudabi64_copyout_strings, .sv_setregs = cloudabi64_proc_setregs, diff --git a/sys/arm/allwinner/aw_ccu.c b/sys/arm/allwinner/aw_ccu.c index a99a4fa972b5..b202f6c72586 100644 --- a/sys/arm/allwinner/aw_ccu.c +++ b/sys/arm/allwinner/aw_ccu.c @@ -80,6 +80,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun6i-a31", CLOCK_CCU }, { "allwinner,sun6i-a31s", CLOCK_CCU }, { "allwinner,sun50i-a64", CLOCK_CCU }, + { "allwinner,sun50i-h5", CLOCK_CCU }, { "allwinner,sun8i-a33", CLOCK_CCU }, { "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL }, { "allwinner,sun8i-h2-plus", CLOCK_CCU|CLOCK_PRCM }, diff --git a/sys/arm/allwinner/clk/aw_modclk.c b/sys/arm/allwinner/clk/aw_modclk.c index 2e4586f47ec2..84363dd237f0 100644 --- a/sys/arm/allwinner/clk/aw_modclk.c +++ b/sys/arm/allwinner/clk/aw_modclk.c @@ -89,7 +89,10 @@ aw_modclk_init(struct clknode *clk, device_t dev) index = (val & CLK_SRC_SEL) >> CLK_SRC_SEL_SHIFT; - clknode_init_parent_idx(clk, index); + if (index <= clknode_get_parents_num(clk)) + clknode_init_parent_idx(clk, index); + else + clknode_init_parent_idx(clk, 0); return (0); } diff --git a/sys/arm/allwinner/clkng/aw_ccung.c b/sys/arm/allwinner/clkng/aw_ccung.c index 652d835aa8ce..5c7ec0a279a0 100644 --- a/sys/arm/allwinner/clkng/aw_ccung.c +++ b/sys/arm/allwinner/clkng/aw_ccung.c @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) #include #endif @@ -78,7 +78,7 @@ static struct resource_spec aw_ccung_spec[] = { { -1, 0 } }; -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) #define H3_CCU 1 #endif @@ -91,7 +91,7 @@ static struct resource_spec aw_ccung_spec[] = { #endif static struct ofw_compat_data compat_data[] = { -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) { "allwinner,sun8i-h3-ccu", H3_CCU }, #endif #if defined(SOC_ALLWINNER_A31) @@ -316,7 +316,7 @@ aw_ccung_attach(device_t dev) panic("Cannot create clkdom\n"); switch (sc->type) { -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) case H3_CCU: ccu_h3_register_clocks(sc); break; diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index f7ae7f1d5fe0..2f0457044f47 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -138,7 +138,7 @@ get_freq(void) return (get_el0(cntfrq)); } -static long +static uint64_t get_cntxct(bool physical) { uint64_t val; diff --git a/sys/arm/freescale/imx/files.imx6 b/sys/arm/freescale/imx/files.imx6 index 4f09d79ccdb7..9db6a6b87860 100644 --- a/sys/arm/freescale/imx/files.imx6 +++ b/sys/arm/freescale/imx/files.imx6 @@ -14,7 +14,7 @@ arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard -arm/freescale/imx/imx6_snvs.c standard +arm/freescale/imx/imx6_snvs.c optional imx6_snvs arm/freescale/imx/imx6_src.c standard arm/freescale/imx/imx_epit.c standard arm/freescale/imx/imx_iomux.c standard diff --git a/sys/arm/freescale/imx/imx_iomux.c b/sys/arm/freescale/imx/imx_iomux.c index e177185a620d..ad13c3d4dfc7 100644 --- a/sys/arm/freescale/imx/imx_iomux.c +++ b/sys/arm/freescale/imx/imx_iomux.c @@ -70,7 +70,7 @@ struct iomux_softc { device_t dev; struct resource *mem_res; - u_int last_gpreg; + u_int last_gpregaddr; }; static struct iomux_softc *iomux_sc; @@ -213,19 +213,19 @@ iomux_attach(device_t dev) switch (imx_soc_type()) { case IMXSOC_51: - sc->last_gpreg = 1; + sc->last_gpregaddr = 1 * sizeof(uint32_t); break; case IMXSOC_53: - sc->last_gpreg = 2; + sc->last_gpregaddr = 2 * sizeof(uint32_t); break; case IMXSOC_6DL: case IMXSOC_6S: case IMXSOC_6SL: case IMXSOC_6Q: - sc->last_gpreg = 13; + sc->last_gpregaddr = 13 * sizeof(uint32_t); break; case IMXSOC_6UL: - sc->last_gpreg = 14; + sc->last_gpregaddr = 14 * sizeof(uint32_t); break; default: device_printf(dev, "Unknown SoC type\n"); @@ -261,45 +261,48 @@ iomux_attach(device_t dev) } uint32_t -imx_iomux_gpr_get(u_int regnum) +imx_iomux_gpr_get(u_int regaddr) { struct iomux_softc * sc; sc = iomux_sc; KASSERT(sc != NULL, ("%s called before attach", __FUNCTION__)); - KASSERT(regnum >= 0 && regnum <= sc->last_gpreg, - ("%s bad regnum %u, max %u", __FUNCTION__, regnum, sc->last_gpreg)); + KASSERT(regaddr >= 0 && regaddr <= sc->last_gpregaddr, + ("%s bad regaddr %u, max %u", __FUNCTION__, regaddr, + sc->last_gpregaddr)); - return (RD4(iomux_sc, regnum * 4)); + return (RD4(iomux_sc, regaddr)); } void -imx_iomux_gpr_set(u_int regnum, uint32_t val) +imx_iomux_gpr_set(u_int regaddr, uint32_t val) { struct iomux_softc * sc; sc = iomux_sc; KASSERT(sc != NULL, ("%s called before attach", __FUNCTION__)); - KASSERT(regnum >= 0 && regnum <= sc->last_gpreg, - ("%s bad regnum %u, max %u", __FUNCTION__, regnum, sc->last_gpreg)); + KASSERT(regaddr >= 0 && regaddr <= sc->last_gpregaddr, + ("%s bad regaddr %u, max %u", __FUNCTION__, regaddr, + sc->last_gpregaddr)); - WR4(iomux_sc, regnum * 4, val); + WR4(iomux_sc, regaddr, val); } void -imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +imx_iomux_gpr_set_masked(u_int regaddr, uint32_t clrbits, uint32_t setbits) { struct iomux_softc * sc; uint32_t val; sc = iomux_sc; KASSERT(sc != NULL, ("%s called before attach", __FUNCTION__)); - KASSERT(regnum >= 0 && regnum <= sc->last_gpreg, - ("%s bad regnum %u, max %u", __FUNCTION__, regnum, sc->last_gpreg)); + KASSERT(regaddr >= 0 && regaddr <= sc->last_gpregaddr, + ("%s bad regaddr %u, max %u", __FUNCTION__, regaddr, + sc->last_gpregaddr)); - val = RD4(iomux_sc, regnum * 4); + val = RD4(iomux_sc, regaddr * 4); val = (val & ~clrbits) | setbits; - WR4(iomux_sc, regnum * 4, val); + WR4(iomux_sc, regaddr, val); } static device_method_t imx_iomux_methods[] = { diff --git a/sys/arm/freescale/imx/imx_iomuxvar.h b/sys/arm/freescale/imx/imx_iomuxvar.h index fdbaa1f87592..40fe7ef52e06 100644 --- a/sys/arm/freescale/imx/imx_iomuxvar.h +++ b/sys/arm/freescale/imx/imx_iomuxvar.h @@ -42,8 +42,8 @@ u_int iomux_get_pad_config(u_int pin); * with IO pin assignments or pad control. These functions let other soc level * code manipulate these values. */ -uint32_t imx_iomux_gpr_get(u_int regnum); -void imx_iomux_gpr_set(u_int regnum, uint32_t val); -void imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits); +uint32_t imx_iomux_gpr_get(u_int regaddr); +void imx_iomux_gpr_set(u_int regaddr, uint32_t val); +void imx_iomux_gpr_set_masked(u_int regaddr, uint32_t clrbits, uint32_t setbits); #endif diff --git a/sys/arm/freescale/imx/std.imx6 b/sys/arm/freescale/imx/std.imx6 index 5c6c39c2f6b7..7d9dc3ce82d2 100644 --- a/sys/arm/freescale/imx/std.imx6 +++ b/sys/arm/freescale/imx/std.imx6 @@ -9,7 +9,8 @@ makeoptions KERNVIRTADDR = 0xc2000000 options IPI_IRQ_START=0 options IPI_IRQ_END=15 -device fdt_pinctrl +device fdt_pinctrl +device imx6_snvs files "../freescale/imx/files.imx6" diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index a652bcbd9d9b..06c05b309fa7 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -89,6 +89,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # SoC support options SOC_ALLWINNER_A64 +options SOC_ALLWINNER_H5 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 options SOC_BRCM_BCM2837 diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h index 856307c1457b..3207d778035d 100644 --- a/sys/compat/linuxkpi/common/include/linux/cdev.h +++ b/sys/compat/linuxkpi/common/include/linux/cdev.h @@ -95,7 +95,6 @@ cdev_add(struct linux_cdev *cdev, dev_t dev, unsigned count) args.mda_gid = 0; args.mda_mode = 0700; args.mda_si_drv1 = cdev; - args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s", kobject_name(&cdev->kobj)); @@ -121,7 +120,6 @@ cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) args.mda_gid = gid; args.mda_mode = mode; args.mda_si_drv1 = cdev; - args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 4f3e378292ec..6b163f57d23c 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -229,12 +229,8 @@ nonseekable_open(struct inode *inode, struct file *filp) return 0; } -static inline dev_t -iminor(struct inode *inode) -{ - - return (minor(dev2unit(inode->v_rdev))); -} +extern unsigned int linux_iminor(struct inode *); +#define iminor(...) linux_iminor(__VA_ARGS__) static inline struct linux_file * get_file(struct linux_file *f) diff --git a/sys/compat/linuxkpi/common/include/linux/kdev_t.h b/sys/compat/linuxkpi/common/include/linux/kdev_t.h index 447d7af2f842..9477ba739e31 100644 --- a/sys/compat/linuxkpi/common/include/linux/kdev_t.h +++ b/sys/compat/linuxkpi/common/include/linux/kdev_t.h @@ -33,9 +33,9 @@ #include -#define MAJOR(dev) major((dev)) -#define MINOR(dev) minor((dev)) -#define MKDEV(ma, mi) makedev((ma), (mi)) +#define MAJOR(dev) major(dev) +#define MINOR(dev) minor(dev) +#define MKDEV(ma, mi) makedev(ma, mi) static inline uint16_t old_encode_dev(dev_t dev) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 408a547f4162..51fe27194810 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1417,6 +1417,21 @@ linux_file_fill_kinfo(struct file *fp, struct kinfo_file *kif, return (0); } +unsigned int +linux_iminor(struct inode *inode) +{ + struct linux_cdev *ldev; + + if (inode == NULL || inode->v_rdev == NULL || + inode->v_rdev->si_devsw != &linuxcdevsw) + return (-1U); + ldev = inode->v_rdev->si_drv1; + if (ldev == NULL) + return (-1U); + + return (minor(ldev->dev)); +} + struct fileops linuxfileops = { .fo_read = linux_file_read, .fo_write = invfo_rdwr, @@ -1975,13 +1990,13 @@ linux_in_atomic(void) struct linux_cdev * linux_find_cdev(const char *name, unsigned major, unsigned minor) { - int unit = MKDEV(major, minor); + dev_t dev = MKDEV(major, minor); struct cdev *cdev; dev_lock(); LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { struct linux_cdev *ldev = cdev->si_drv1; - if (dev2unit(cdev) == unit && + if (ldev->dev == dev && strcmp(kobject_name(&ldev->kobj), name) == 0) { break; } diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 84029a5af25e..1bb2e386ca7e 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -42,6 +42,7 @@ arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt arm/allwinner/clkng/ccu_a64.c optional aw_ccu fdt +arm/allwinner/clkng/ccu_h3.c optional aw_ccu fdt arm/allwinner/if_awg.c optional awg fdt arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt diff --git a/sys/conf/options.arm64 b/sys/conf/options.arm64 index 29a20c533fc4..944d99e33272 100644 --- a/sys/conf/options.arm64 +++ b/sys/conf/options.arm64 @@ -11,6 +11,7 @@ DEV_PSCI opt_platform.h # SoC Support SOC_ALLWINNER_A64 opt_soc.h +SOC_ALLWINNER_H5 opt_soc.h SOC_BRCM_BCM2837 opt_soc.h SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h diff --git a/sys/dev/mmc/bridge.h b/sys/dev/mmc/bridge.h index 53e61b48f327..42fabbb13967 100644 --- a/sys/dev/mmc/bridge.h +++ b/sys/dev/mmc/bridge.h @@ -65,12 +65,10 @@ * linux/mmc/host.h file. * * A mmc bridge is a chipset that can have one or more mmc and/or sd - * cards attached to it. mmc cards are attached on a bus topology, - * while sd and sdio cards are attached using a star topology (meaning - * in practice each sd card has its own, independent slot). Each - * mmcbr is assumed to be derived from the mmcbr. This is done to - * allow for easier addition of bridges (as each bridge does not need - * to be added to the mmcbus file). + * cards attached to it. mmc devices are attached on a bus topology, + * while sd and sdio cards usually are attached using a star topology + * (meaning in practice each sd card has its own, independent slot). + * Since SDHCI v3.00, buses for esd and esdio are possible, though. * * Attached to the mmc bridge is an mmcbus. The mmcbus is described * in dev/mmc/mmcbus_if.m. diff --git a/sys/dev/mmc/mmc_subr.c b/sys/dev/mmc/mmc_subr.c index af3881c102ec..7945342a8afc 100644 --- a/sys/dev/mmc/mmc_subr.c +++ b/sys/dev/mmc/mmc_subr.c @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define LOG_PPS 5 /* Log no more than 5 errors per second. */ int -mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, +mmc_wait_for_cmd(device_t busdev, device_t dev, struct mmc_command *cmd, int retries) { struct mmc_request mreq; @@ -87,14 +87,14 @@ mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, if (cmd->data != NULL) cmd->data->mrq = &mreq; mreq.cmd = cmd; - if (MMCBUS_WAIT_FOR_REQUEST(brdev, reqdev, &mreq) != 0) + if (MMCBUS_WAIT_FOR_REQUEST(busdev, dev, &mreq) != 0) err = MMC_ERR_FAILED; else err = cmd->error; } while (err != MMC_ERR_NONE && retries-- > 0); - if (err != MMC_ERR_NONE && brdev == reqdev) { - sc = device_get_softc(brdev); + if (err != MMC_ERR_NONE && busdev == dev) { + sc = device_get_softc(busdev); if (sc->squelched == 0 && ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { device_printf(sc->dev, "CMD%d failed, RESULT: %d\n", @@ -106,14 +106,14 @@ mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, } int -mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, +mmc_wait_for_app_cmd(device_t busdev, device_t dev, uint16_t rca, struct mmc_command *cmd, int retries) { struct mmc_command appcmd; struct mmc_softc *sc; int err; - sc = device_get_softc(brdev); + sc = device_get_softc(busdev); /* Squelch error reporting at lower levels, we report below. */ sc->squelched++; @@ -122,14 +122,14 @@ mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, appcmd.opcode = MMC_APP_CMD; appcmd.arg = (uint32_t)rca << 16; appcmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - if (mmc_wait_for_cmd(brdev, reqdev, &appcmd, 0) != 0) + if (mmc_wait_for_cmd(busdev, dev, &appcmd, 0) != 0) err = MMC_ERR_FAILED; else err = appcmd.error; if (err == MMC_ERR_NONE) { if (!(appcmd.resp[0] & R1_APP_CMD)) err = MMC_ERR_FAILED; - else if (mmc_wait_for_cmd(brdev, reqdev, cmd, 0) != 0) + else if (mmc_wait_for_cmd(busdev, dev, cmd, 0) != 0) err = MMC_ERR_FAILED; else err = cmd->error; @@ -137,7 +137,7 @@ mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, } while (err != MMC_ERR_NONE && retries-- > 0); sc->squelched--; - if (err != MMC_ERR_NONE && brdev == reqdev) { + if (err != MMC_ERR_NONE && busdev == dev) { if (sc->squelched == 0 && ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { device_printf(sc->dev, "ACMD%d failed, RESULT: %d\n", @@ -149,7 +149,7 @@ mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, } int -mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, +mmc_switch(device_t busdev, device_t dev, uint16_t rca, uint8_t set, uint8_t index, uint8_t value, u_int timeout, bool status) { struct mmc_command cmd; @@ -158,7 +158,7 @@ mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, KASSERT(timeout != 0, ("%s: no timeout", __func__)); - sc = device_get_softc(brdev); + sc = device_get_softc(busdev); memset(&cmd, 0, sizeof(cmd)); cmd.opcode = MMC_SWITCH_FUNC; @@ -169,8 +169,8 @@ mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, * exceeds the maximum host timeout, use a R1 instead of a R1B * response in order to keep the hardware from timing out. */ - if (mmcbr_get_caps(brdev) & MMC_CAP_WAIT_WHILE_BUSY && - timeout > mmcbr_get_max_busy_timeout(brdev)) + if (mmcbr_get_caps(busdev) & MMC_CAP_WAIT_WHILE_BUSY && + timeout > mmcbr_get_max_busy_timeout(busdev)) cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; else cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; @@ -180,17 +180,17 @@ mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, * than to a tuning command that may have snuck in between. */ sc->retune_paused++; - err = mmc_wait_for_cmd(brdev, reqdev, &cmd, CMD_RETRIES); + err = mmc_wait_for_cmd(busdev, dev, &cmd, CMD_RETRIES); if (err != MMC_ERR_NONE || status == false) goto out; - err = mmc_switch_status(brdev, reqdev, rca, timeout); + err = mmc_switch_status(busdev, dev, rca, timeout); out: sc->retune_paused--; return (err); } int -mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, u_int timeout) +mmc_switch_status(device_t busdev, device_t dev, uint16_t rca, u_int timeout) { struct timeval cur, end; int err; @@ -205,7 +205,7 @@ mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, u_int timeout) */ end.tv_sec = end.tv_usec = 0; for (;;) { - err = mmc_send_status(brdev, reqdev, rca, &status); + err = mmc_send_status(busdev, dev, rca, &status); if (err != MMC_ERR_NONE) break; if (R1_CURRENT_STATE(status) == R1_STATE_TRAN) @@ -226,7 +226,7 @@ mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, u_int timeout) } int -mmc_send_ext_csd(device_t brdev, device_t reqdev, uint8_t *rawextcsd) +mmc_send_ext_csd(device_t busdev, device_t dev, uint8_t *rawextcsd) { struct mmc_command cmd; struct mmc_data data; @@ -244,12 +244,12 @@ mmc_send_ext_csd(device_t brdev, device_t reqdev, uint8_t *rawextcsd) data.len = MMC_EXTCSD_SIZE; data.flags = MMC_DATA_READ; - err = mmc_wait_for_cmd(brdev, reqdev, &cmd, CMD_RETRIES); + err = mmc_wait_for_cmd(busdev, dev, &cmd, CMD_RETRIES); return (err); } int -mmc_send_status(device_t brdev, device_t reqdev, uint16_t rca, uint32_t *status) +mmc_send_status(device_t busdev, device_t dev, uint16_t rca, uint32_t *status) { struct mmc_command cmd; int err; @@ -258,7 +258,7 @@ mmc_send_status(device_t brdev, device_t reqdev, uint16_t rca, uint32_t *status) cmd.opcode = MMC_SEND_STATUS; cmd.arg = (uint32_t)rca << 16; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - err = mmc_wait_for_cmd(brdev, reqdev, &cmd, CMD_RETRIES); + err = mmc_wait_for_cmd(busdev, dev, &cmd, CMD_RETRIES); *status = cmd.resp[0]; return (err); } diff --git a/sys/dev/mmc/mmc_subr.h b/sys/dev/mmc/mmc_subr.h index 6e300d2fa268..33ea6760ec20 100644 --- a/sys/dev/mmc/mmc_subr.h +++ b/sys/dev/mmc/mmc_subr.h @@ -57,16 +57,16 @@ struct mmc_command; -int mmc_send_ext_csd(device_t brdev, device_t reqdev, uint8_t *rawextcsd); -int mmc_send_status(device_t brdev, device_t reqdev, uint16_t rca, +int mmc_send_ext_csd(device_t busdev, device_t dev, uint8_t *rawextcsd); +int mmc_send_status(device_t busdev, device_t dev, uint16_t rca, uint32_t *status); -int mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, +int mmc_switch(device_t busdev, device_t dev, uint16_t rca, uint8_t set, uint8_t index, uint8_t value, u_int timeout, bool send_status); -int mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, +int mmc_switch_status(device_t busdev, device_t dev, uint16_t rca, u_int timeout); -int mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, +int mmc_wait_for_app_cmd(device_t busdev, device_t dev, uint16_t rca, struct mmc_command *cmd, int retries); -int mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, +int mmc_wait_for_cmd(device_t busdev, device_t dev, struct mmc_command *cmd, int retries); #endif /* DEV_MMC_SUBR_H */ diff --git a/sys/dev/mmc/mmcbus_if.m b/sys/dev/mmc/mmcbus_if.m index d33510d507b5..b55f26486e5e 100644 --- a/sys/dev/mmc/mmcbus_if.m +++ b/sys/dev/mmc/mmcbus_if.m @@ -68,7 +68,7 @@ INTERFACE mmcbus; # the bus to be claimed. # METHOD void retune_pause { - device_t brdev; + device_t busdev; device_t reqdev; bool retune; }; @@ -77,7 +77,7 @@ METHOD void retune_pause { # Unpause re-tuning. Requires the bus to be claimed. # METHOD void retune_unpause { - device_t brdev; + device_t busdev; device_t reqdev; }; @@ -85,7 +85,7 @@ METHOD void retune_unpause { # Queue and wait for a request. Requires the bus to be claimed. # METHOD int wait_for_request { - device_t brdev; + device_t busdev; device_t reqdev; struct mmc_request *req; }; @@ -95,7 +95,7 @@ METHOD int wait_for_request { # longer busy. # METHOD int acquire_bus { - device_t brdev; + device_t busdev; device_t reqdev; }; @@ -103,6 +103,6 @@ METHOD int acquire_bus { # Release the current bus. # METHOD int release_bus { - device_t brdev; + device_t busdev; device_t reqdev; }; diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index ae8a50260328..b54f1a0a594f 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -117,7 +117,7 @@ struct mmcsd_part { struct mmcsd_softc { device_t dev; - device_t mmcbr; + device_t mmcbus; struct mmcsd_part *part[MMC_PART_MAX]; enum mmc_card_mode mode; u_int max_data; /* Maximum data size [blocks] */ @@ -215,7 +215,7 @@ mmcsd_probe(device_t dev) static int mmcsd_attach(device_t dev) { - device_t mmcbr; + device_t mmcbus; struct mmcsd_softc *sc; const uint8_t *ext_csd; off_t erase_size, sector_size, size, wp_size; @@ -227,8 +227,8 @@ mmcsd_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->mmcbr = mmcbr = device_get_parent(dev); - sc->mode = mmcbr_get_mode(mmcbr); + sc->mmcbus = mmcbus = device_get_parent(dev); + sc->mode = mmcbr_get_mode(mmcbus); /* * Note that in principle with an SDHCI-like re-tuning implementation, * the maximum data size can change at runtime due to a device removal/ @@ -245,9 +245,9 @@ mmcsd_attach(device_t dev) /* Only MMC >= 4.x devices support EXT_CSD. */ if (mmc_get_spec_vers(dev) >= 4) { - MMCBUS_ACQUIRE_BUS(mmcbr, dev); - err = mmc_send_ext_csd(mmcbr, dev, sc->ext_csd); - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd); + MMCBUS_RELEASE_BUS(mmcbus, dev); if (err != MMC_ERR_NONE) bzero(sc->ext_csd, sizeof(sc->ext_csd)); } @@ -330,7 +330,7 @@ mmcsd_attach(device_t dev) /* Add boot partitions, which are of a fixed multiple of 128 KB. */ size = ext_csd[EXT_CSD_BOOT_SIZE_MULT] * MMC_BOOT_RPMB_BLOCK_SIZE; - if (size > 0 && (mmcbr_get_caps(mmcbr) & MMC_CAP_BOOT_NOACC) == 0) { + if (size > 0 && (mmcbr_get_caps(mmcbus) & MMC_CAP_BOOT_NOACC) == 0) { mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_BOOT0, MMCSD_FMT_BOOT, 0, size, MMC_BOOT_RPMB_BLOCK_SIZE, ro | ((ext_csd[EXT_CSD_BOOT_WP_STATUS] & @@ -422,7 +422,7 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, const char *name, u_int cnt, off_t media_size, off_t erase_size, bool ro) { struct make_dev_args args; - device_t dev, mmcbr; + device_t dev, mmcbus; const char *ext; const uint8_t *ext_csd; struct mmcsd_part *part; @@ -435,7 +435,7 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, const char *name, u_int cnt, char unit[2]; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; part = sc->part[type] = malloc(sizeof(*part), M_DEVBUF, M_WAITOK | M_ZERO); part->sc = sc; @@ -502,10 +502,10 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, const char *name, u_int cnt, bytes = mmcsd_pretty_size(media_size, unit); if (type == EXT_CSD_PART_CONFIG_ACC_DEFAULT) { - speed = mmcbr_get_clock(mmcbr); + speed = mmcbr_get_clock(mmcbus); printf("%s%d: %ju%sB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", part->name, cnt, bytes, unit, mmc_get_card_id_string(dev), - ro ? " (read-only)" : "", device_get_nameunit(mmcbr), + ro ? " (read-only)" : "", device_get_nameunit(mmcbus), speed / 1000000, (speed / 100000) % 10, mmcsd_bus_bit_width(dev), sc->max_data); } else if (type == EXT_CSD_PART_CONFIG_ACC_RPMB) { @@ -802,7 +802,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) struct mmc_command cmd; struct mmc_data data; struct mmcsd_softc *sc; - device_t dev, mmcbr; + device_t dev, mmcbus; void *dp; u_long len; int err, retries; @@ -885,9 +885,9 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) } } dev = sc->dev; - mmcbr = sc->mmcbr; - MMCBUS_ACQUIRE_BUS(mmcbr, dev); - err = mmcsd_switch_part(mmcbr, dev, rca, part->type); + mmcbus = sc->mmcbus; + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmcsd_switch_part(mmcbus, dev, rca, part->type); if (err != MMC_ERR_NONE) goto release; if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) { @@ -897,9 +897,9 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) goto switch_back; } if (mic->is_acmd != 0) - (void)mmc_wait_for_app_cmd(mmcbr, dev, rca, &cmd, 0); + (void)mmc_wait_for_app_cmd(mmcbus, dev, rca, &cmd, 0); else - (void)mmc_wait_for_cmd(mmcbr, dev, &cmd, 0); + (void)mmc_wait_for_cmd(mmcbus, dev, &cmd, 0); if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) { /* * If the request went to the RPMB partition, try to ensure @@ -907,7 +907,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) */ retries = MMCSD_CMD_RETRIES; do { - err = mmc_send_status(mmcbr, dev, rca, &status); + err = mmc_send_status(mmcbus, dev, rca, &status); if (err != MMC_ERR_NONE) break; if (R1_STATUS(status) == 0 && @@ -918,7 +918,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) switch_back: /* ... and always switch back to the default partition. */ - err = mmcsd_switch_part(mmcbr, dev, rca, + err = mmcsd_switch_part(mmcbus, dev, rca, EXT_CSD_PART_CONFIG_ACC_DEFAULT); if (err != MMC_ERR_NONE) goto release; @@ -929,11 +929,11 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) * so retrieve EXT_CSD again. */ if (cmd.opcode == MMC_SWITCH_FUNC) { - err = mmc_send_ext_csd(mmcbr, dev, sc->ext_csd); + err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd); if (err != MMC_ERR_NONE) goto release; } - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); if (cmd.error != MMC_ERR_NONE) { switch (cmd.error) { case MMC_ERR_TIMEOUT: @@ -963,7 +963,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) goto out; release: - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); err = EIO; out: @@ -1009,7 +1009,7 @@ mmcsd_set_blockcount(struct mmcsd_softc *sc, u_int count, bool reliable) if (reliable) cmd.arg |= 1 << 31; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(sc->mmcbr, sc->dev, &req); + MMCBUS_WAIT_FOR_REQUEST(sc->mmcbus, sc->dev, &req); return (cmd.error); } @@ -1036,7 +1036,7 @@ mmcsd_switch_part(device_t bus, device_t dev, uint16_t rca, u_int part) * anew. */ if (part == EXT_CSD_PART_CONFIG_ACC_RPMB) - MMCBUS_RETUNE_PAUSE(sc->mmcbr, sc->dev, true); + MMCBUS_RETUNE_PAUSE(sc->mmcbus, sc->dev, true); if (sc->part_curr == part) return (MMC_ERR_NONE); @@ -1048,13 +1048,13 @@ mmcsd_switch_part(device_t bus, device_t dev, uint16_t rca, u_int part) EXT_CSD_PART_CONFIG, value, sc->part_time, true); if (err != MMC_ERR_NONE) { if (part == EXT_CSD_PART_CONFIG_ACC_RPMB) - MMCBUS_RETUNE_UNPAUSE(sc->mmcbr, sc->dev); + MMCBUS_RETUNE_UNPAUSE(sc->mmcbus, sc->dev); return (err); } sc->ext_csd[EXT_CSD_PART_CONFIG] = value; if (sc->part_curr == EXT_CSD_PART_CONFIG_ACC_RPMB) - MMCBUS_RETUNE_UNPAUSE(sc->mmcbr, sc->dev); + MMCBUS_RETUNE_UNPAUSE(sc->mmcbus, sc->dev); sc->part_curr = part; return (MMC_ERR_NONE); } @@ -1077,13 +1077,13 @@ mmcsd_rw(struct mmcsd_part *part, struct bio *bp) struct mmc_request req; struct mmc_data data; struct mmcsd_softc *sc; - device_t dev, mmcbr; + device_t dev, mmcbus; u_int numblocks, sz; char *vaddr; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; block = bp->bio_pblkno; sz = part->disk->d_sectorsize; @@ -1128,7 +1128,7 @@ mmcsd_rw(struct mmcsd_part *part, struct bio *bp) stop.mrq = &req; req.stop = &stop; } - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) @@ -1149,12 +1149,12 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) struct mmc_command cmd; struct mmc_request req; struct mmcsd_softc *sc; - device_t dev, mmcbr; + device_t dev, mmcbus; u_int erase_sector, sz; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; block = bp->bio_pblkno; sz = part->disk->d_sectorsize; @@ -1182,7 +1182,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) * commands. Note that these latter don't use the data lines, so * re-tuning shouldn't actually become necessary during erase. */ - MMCBUS_RETUNE_PAUSE(mmcbr, dev, false); + MMCBUS_RETUNE_PAUSE(mmcbus, dev, false); /* Set erase start position. */ memset(&req, 0, sizeof(req)); memset(&cmd, 0, sizeof(cmd)); @@ -1196,7 +1196,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) if (sc->high_cap == 0) cmd.arg <<= 9; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "Setting erase start position failed %d\n", req.cmd->error); @@ -1216,7 +1216,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) cmd.arg <<= 9; cmd.arg--; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "Setting erase stop position failed %d\n", req.cmd->error); @@ -1230,7 +1230,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) cmd.opcode = MMC_ERASE; cmd.arg = 0; cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "erase err3: %d\n", req.cmd->error); device_printf(dev, "Issuing erase command failed %d\n", @@ -1248,7 +1248,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) } block = end; unpause: - MMCBUS_RETUNE_UNPAUSE(mmcbr, dev); + MMCBUS_RETUNE_UNPAUSE(mmcbus, dev); return (block); } @@ -1261,7 +1261,7 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, struct disk *disk; struct mmcsd_softc *sc; struct mmcsd_part *part; - device_t dev, mmcbr; + device_t dev, mmcbus; int err; /* length zero is special and really means flush buffers to media */ @@ -1272,7 +1272,7 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, part = disk->d_drv1; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; g_reset_bio(&bp); bp.bio_disk = disk; @@ -1281,16 +1281,16 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, bp.bio_data = virtual; bp.bio_cmd = BIO_WRITE; end = bp.bio_pblkno + bp.bio_bcount / disk->d_sectorsize; - MMCBUS_ACQUIRE_BUS(mmcbr, dev); - err = mmcsd_switch_part(mmcbr, dev, sc->rca, part->type); + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmcsd_switch_part(mmcbus, dev, sc->rca, part->type); if (err != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) device_printf(dev, "Partition switch error\n"); - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); return (EIO); } block = mmcsd_rw(part, &bp); - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); return ((end < block) ? EIO : 0); } @@ -1301,13 +1301,13 @@ mmcsd_task(void *arg) struct mmcsd_part *part; struct mmcsd_softc *sc; struct bio *bp; - device_t dev, mmcbr; + device_t dev, mmcbus; int err, sz; part = arg; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; while (1) { MMCSD_DISK_LOCK(part); @@ -1327,11 +1327,11 @@ mmcsd_task(void *arg) biodone(bp); continue; } - MMCBUS_ACQUIRE_BUS(mmcbr, dev); + MMCBUS_ACQUIRE_BUS(mmcbus, dev); sz = part->disk->d_sectorsize; block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); - err = mmcsd_switch_part(mmcbr, dev, sc->rca, part->type); + err = mmcsd_switch_part(mmcbus, dev, sc->rca, part->type); if (err != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) @@ -1347,7 +1347,7 @@ mmcsd_task(void *arg) block = mmcsd_delete(part, bp); } release: - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); if (block < end) { bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index a49bb1784a69..372cde62b797 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -455,7 +455,7 @@ trap(struct trapframe *frame) goto userout; #else /* !POWERFAIL_NMI */ nmi_handle_intr(type, frame); - break; + goto out; #endif /* POWERFAIL_NMI */ #endif /* DEV_ISA */ @@ -499,7 +499,7 @@ trap(struct trapframe *frame) if (dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - break; + goto userout; #endif } } else { diff --git a/sys/modules/i2c/ds1307/Makefile b/sys/modules/i2c/ds1307/Makefile index 7a9270a7c0bb..32b80394f450 100644 --- a/sys/modules/i2c/ds1307/Makefile +++ b/sys/modules/i2c/ds1307/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = ds1307 -SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include diff --git a/sys/modules/i2c/ds3231/Makefile b/sys/modules/i2c/ds3231/Makefile index eddddc4ca053..e75c47c21c2e 100644 --- a/sys/modules/i2c/ds3231/Makefile +++ b/sys/modules/i2c/ds3231/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = ds3231 -SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include diff --git a/sys/modules/i2c/isl12xx/Makefile b/sys/modules/i2c/isl12xx/Makefile index 0d7d5b03b3f1..5f31317fc3b7 100644 --- a/sys/modules/i2c/isl12xx/Makefile +++ b/sys/modules/i2c/isl12xx/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = isl12xx -SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include diff --git a/sys/sys/types.h b/sys/sys/types.h index 8d0af5713b4c..30a087244437 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x) #include -/* - * minor() gives a cookie instead of an index since we don't want to - * change the meanings of bits 0-15 or waste time and space shifting - * bits 16-31 for devices that don't use them. - */ -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ /* * These declarations belong elsewhere, but are repeated here and in diff --git a/tests/sys/aio/lio_test.c b/tests/sys/aio/lio_test.c index a87933cccbac..f71a977631ab 100644 --- a/tests/sys/aio/lio_test.c +++ b/tests/sys/aio/lio_test.c @@ -99,7 +99,7 @@ ATF_TC_BODY(lio_listio_empty_nowait_signal, tc) struct sigevent sev; atf_tc_expect_timeout("Bug 220398 - lio_listio(2) never sends" - "asynchronous notification if nent==0"); + " asynchronous notification if nent==0"); ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); sev.sigev_notify = SIGEV_SIGNAL; sev.sigev_signo = SIGUSR1; @@ -120,7 +120,7 @@ ATF_TC_BODY(lio_listio_empty_nowait_thread, tc) struct sigevent sev; atf_tc_expect_timeout("Bug 220398 - lio_listio(2) never sends" - "asynchronous notification if nent==0"); + " asynchronous notification if nent==0"); ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); bzero(&sev, sizeof(sev)); sev.sigev_notify = SIGEV_THREAD; diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 408b9b1263ba..5097678ad357 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -1868,7 +1868,12 @@ mask_usr1_thread(void *arg) * Verify that the SIGKILL from PT_KILL takes priority over other signals * and prevents spurious stops due to those other signals. */ -ATF_TC_WITHOUT_HEAD(ptrace__PT_KILL_competing_signal); +ATF_TC(ptrace__PT_KILL_competing_signal); +ATF_TC_HEAD(ptrace__PT_KILL_competing_signal, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) { pid_t fpid, wpid; @@ -1962,7 +1967,12 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) * Verify that the SIGKILL from PT_KILL takes priority over other stop events * and prevents spurious stops caused by those events. */ -ATF_TC_WITHOUT_HEAD(ptrace__PT_KILL_competing_stop); +ATF_TC(ptrace__PT_KILL_competing_stop); +ATF_TC_HEAD(ptrace__PT_KILL_competing_stop, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) { pid_t fpid, wpid; @@ -2940,13 +2950,24 @@ terminate_with_pending_sigstop(bool sigstop_from_main_thread) * to the older thread (the second test). This behavior has changed in the * past, so make no assumption. */ -ATF_TC_WITHOUT_HEAD(ptrace__parent_terminate_with_pending_sigstop1); +ATF_TC(ptrace__parent_terminate_with_pending_sigstop1); +ATF_TC_HEAD(ptrace__parent_terminate_with_pending_sigstop1, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__parent_terminate_with_pending_sigstop1, tc) { terminate_with_pending_sigstop(true); } -ATF_TC_WITHOUT_HEAD(ptrace__parent_terminate_with_pending_sigstop2); + +ATF_TC(ptrace__parent_terminate_with_pending_sigstop2); +ATF_TC_HEAD(ptrace__parent_terminate_with_pending_sigstop2, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__parent_terminate_with_pending_sigstop2, tc) { diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index f3fe50aff335..e9d2d255b770 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -374,6 +374,7 @@ 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 10/31 Taras Korenko born in Cherkasy region, Ukraine, 1980 +11/03 Ryan Stone born in Ottawa, Ontario, Canada, 1985 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 11/08 Joseph R. Mingrone born in Charlottetown, Prince Edward Island, Canada, 1976 diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh index 6621990dd68e..8b4e33777f3b 100755 --- a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh +++ b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh @@ -277,6 +277,10 @@ o_flag_isolevel_3_cleanup() } atf_test_case o_flag_preparer +o_flag_preparer_head() +{ + atf_set "require.progs" "strings" +} o_flag_preparer_body() { create_test_dirs @@ -292,6 +296,10 @@ o_flag_preparer_body() } atf_test_case o_flag_publisher +o_flag_publisher_head() +{ + atf_set "require.progs" "strings" +} o_flag_publisher_body() { create_test_dirs