MFhead@r321960
This commit is contained in:
commit
86cc58dc96
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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 .
|
||||
|
@ -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.
|
||||
|
@ -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 @@ __<bsd.opts.mk>__:
|
||||
#
|
||||
|
||||
# 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 \
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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 },
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <arm/allwinner/clkng/ccu_a64.h>
|
||||
#endif
|
||||
|
||||
#if defined(SOC_ALLWINNER_H3)
|
||||
#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5)
|
||||
#include <arm/allwinner/clkng/ccu_h3.h>
|
||||
#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;
|
||||
|
@ -138,7 +138,7 @@ get_freq(void)
|
||||
return (get_el0(cntfrq));
|
||||
}
|
||||
|
||||
static long
|
||||
static uint64_t
|
||||
get_cntxct(bool physical)
|
||||
{
|
||||
uint64_t val;
|
||||
|
@ -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
|
||||
|
@ -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[] = {
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -33,9 +33,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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 <bsd.kmod.mk>
|
||||
|
@ -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 <bsd.kmod.mk>
|
||||
|
@ -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 <bsd.kmod.mk>
|
||||
|
@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x)
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
||||
|
@ -374,6 +374,7 @@
|
||||
10/26 Philip M. Gollucci <pgollucci@FreeBSD.org> born in Silver Spring, Maryland, United States, 1979
|
||||
10/27 Takanori Watanabe <takawata@FreeBSD.org> born in Numazu, Shizuoka, Japan, 1972
|
||||
10/31 Taras Korenko <taras@FreeBSD.org> born in Cherkasy region, Ukraine, 1980
|
||||
11/03 Ryan Stone <rstone@FreeBSD.org> born in Ottawa, Ontario, Canada, 1985
|
||||
11/05 M. Warner Losh <imp@FreeBSD.org> born in Kansas City, Kansas, United States, 1966
|
||||
11/06 Michael Zhilin <mizhka@FreeBSD.org> born in Stary Oskol, USSR, 1985
|
||||
11/08 Joseph R. Mingrone <jrm@FreeBSD.org> born in Charlottetown, Prince Edward Island, Canada, 1976
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user