/* * Freescale SSI ALSA SoC Digital Audio Interface (DAI) debugging functions * * Copyright 2014 Markus Pargmann , Pengutronix * * Splitted from fsl_ssi.c * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ #include #include #include #include "fsl_ssi.h" void fsl_ssi_dbg_isr(struct fsl_ssi_dbg *dbg, u32 sisr) { if (sisr & CCSR_SSI_SISR_RFRC) dbg->stats.rfrc++; if (sisr & CCSR_SSI_SISR_TFRC) dbg->stats.tfrc++; if (sisr & CCSR_SSI_SISR_CMDAU) dbg->stats.cmdau++; if (sisr & CCSR_SSI_SISR_CMDDU) dbg->stats.cmddu++; if (sisr & CCSR_SSI_SISR_RXT) dbg->stats.rxt++; if (sisr & CCSR_SSI_SISR_RDR1) dbg->stats.rdr1++; if (sisr & CCSR_SSI_SISR_RDR0) dbg->stats.rdr0++; if (sisr & CCSR_SSI_SISR_TDE1) dbg->stats.tde1++; if (sisr & CCSR_SSI_SISR_TDE0) dbg->stats.tde0++; if (sisr & CCSR_SSI_SISR_ROE1) dbg->stats.roe1++; if (sisr & CCSR_SSI_SISR_ROE0) dbg->stats.roe0++; if (sisr & CCSR_SSI_SISR_TUE1) dbg->stats.tue1++; if (sisr & CCSR_SSI_SISR_TUE0) dbg->stats.tue0++; if (sisr & CCSR_SSI_SISR_TFS) dbg->stats.tfs++; if (sisr & CCSR_SSI_SISR_RFS) dbg->stats.rfs++; if (sisr & CCSR_SSI_SISR_TLS) dbg->stats.tls++; if (sisr & CCSR_SSI_SISR_RLS) dbg->stats.rls++; if (sisr & CCSR_SSI_SISR_RFF1) dbg->stats.rff1++; if (sisr & CCSR_SSI_SISR_RFF0) dbg->stats.rff0++; if (sisr & CCSR_SSI_SISR_TFE1) dbg->stats.tfe1++; if (sisr & CCSR_SSI_SISR_TFE0) dbg->stats.tfe0++; } /* Show the statistics of a flag only if its interrupt is enabled. The * compiler will optimze this code to a no-op if the interrupt is not * enabled. */ #define SIER_SHOW(flag, name) \ do { \ if (CCSR_SSI_SIER_##flag) \ seq_printf(s, #name "=%u\n", ssi_dbg->stats.name); \ } while (0) /** * fsl_sysfs_ssi_show: display SSI statistics * * Display the statistics for the current SSI device. To avoid confusion, * we only show those counts that are enabled. */ static int fsl_ssi_stats_show(struct seq_file *s, void *unused) { struct fsl_ssi_dbg *ssi_dbg = s->private; SIER_SHOW(RFRC_EN, rfrc); SIER_SHOW(TFRC_EN, tfrc); SIER_SHOW(CMDAU_EN, cmdau); SIER_SHOW(CMDDU_EN, cmddu); SIER_SHOW(RXT_EN, rxt); SIER_SHOW(RDR1_EN, rdr1); SIER_SHOW(RDR0_EN, rdr0); SIER_SHOW(TDE1_EN, tde1); SIER_SHOW(TDE0_EN, tde0); SIER_SHOW(ROE1_EN, roe1); SIER_SHOW(ROE0_EN, roe0); SIER_SHOW(TUE1_EN, tue1); SIER_SHOW(TUE0_EN, tue0); SIER_SHOW(TFS_EN, tfs); SIER_SHOW(RFS_EN, rfs); SIER_SHOW(TLS_EN, tls); SIER_SHOW(RLS_EN, rls); SIER_SHOW(RFF1_EN, rff1); SIER_SHOW(RFF0_EN, rff0); SIER_SHOW(TFE1_EN, tfe1); SIER_SHOW(TFE0_EN, tfe0); return 0; } static int fsl_ssi_stats_open(struct inode *inode, struct file *file) { return single_open(file, fsl_ssi_stats_show, inode->i_private); } static const struct file_operations fsl_ssi_stats_ops = { .open = fsl_ssi_stats_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) { ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL); if (!ssi_dbg->dbg_dir) return -ENOMEM; ssi_dbg->dbg_stats = debugfs_create_file("stats", S_IRUGO, ssi_dbg->dbg_dir, ssi_dbg, &fsl_ssi_stats_ops); if (!ssi_dbg->dbg_stats) { debugfs_remove(ssi_dbg->dbg_dir); return -ENOMEM; } return 0; } void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg) { debugfs_remove(ssi_dbg->dbg_stats); debugfs_remove(ssi_dbg->dbg_dir); } 13a50fbc746ed9b415c25e92'/>
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-02-01 17:45:02 +0000
committerIngo Molnar <mingo@kernel.org>2017-02-01 21:17:49 +0100
commitc8f325a59cfc718d13a50fbc746ed9b415c25e92 (patch)
treed53fbdac9d0781e39a13b2ac6b2bd258cf3b4140 /tools/testing/selftests/x86/.gitignore
parentbf29bddf0417a4783da3b24e8c9e017ac649326f (diff)
efi/fdt: Avoid FDT manipulation after ExitBootServices()
Some AArch64 UEFI implementations disable the MMU in ExitBootServices(), after which unaligned accesses to RAM are no longer supported. Commit: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") fixed an issue in the memory map handling of the stub FDT code, but inadvertently created an issue with such firmware, by moving some of the FDT manipulation to after the invocation of ExitBootServices(). Given that the stub's libfdt implementation uses the ordinary, accelerated string functions, which rely on hardware handling of unaligned accesses, manipulating the FDT with the MMU off may result in alignment faults. So fix the situation by moving the update_fdt_memmap() call into the callback function invoked by efi_exit_boot_services() right before it calls the ExitBootServices() UEFI service (which is arguably a better place for it anyway) Note that disabling the MMU in ExitBootServices() is not compliant with the UEFI spec, and carries great risk due to the fact that switching from cached to uncached memory accesses halfway through compiler generated code (i.e., involving a stack) can never be done in a way that is architecturally safe. Fixes: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Riku Voipio <riku.voipio@linaro.org> Cc: <stable@vger.kernel.org> Cc: mark.rutland@arm.com Cc: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk Cc: leif.lindholm@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/testing/selftests/x86/.gitignore')