/* * Freescale QUICC Engine USB Host Controller Driver * * Copyright (c) Freescale Semicondutor, Inc. 2006. * Shlomi Gridish * Jerry Huang * Copyright (c) Logic Product Development, Inc. 2007 * Peter Barada * Copyright (c) MontaVista Software, Inc. 2008. * Anton Vorontsov * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include #include #include #include #include #include #include "fhci.h" void fhci_dbg_isr(struct fhci_hcd *fhci, int usb_er) { int i; if (usb_er == -1) { fhci->usb_irq_stat[12]++; return; } for (i = 0; i < 12; ++i) { if (usb_er & (1 << i)) fhci->usb_irq_stat[i]++; } } static int fhci_dfs_regs_show(struct seq_file *s, void *v) { struct fhci_hcd *fhci = s->private; struct qe_usb_ctlr __iomem *regs = fhci->regs; seq_printf(s, "mode: 0x%x\n" "addr: 0x%x\n" "command: 0x%x\n" "ep0: 0x%x\n" "event: 0x%x\n" "mask: 0x%x\n" "status: 0x%x\n" "SOF timer: %d\n" "frame number: %d\n" "lines status: 0x%x\n", in_8(®s->usb_usmod), in_8(®s->usb_usadr), in_8(®s->usb_uscom), in_be16(®s->usb_usep[0]), in_be16(®s->usb_usber), in_be16(®s->usb_usbmr), in_8(®s->usb_usbs), in_be16(®s->usb_ussft), in_be16(®s->usb_usfrn), fhci_ioports_check_bus_state(fhci)); return 0; } static int fhci_dfs_irq_stat_show(struct seq_file *s, void *v) { struct fhci_hcd *fhci = s->private; int *usb_irq_stat = fhci->usb_irq_stat; seq_printf(s, "RXB: %d\n" "TXB: %d\n" "BSY: %d\n" "SOF: %d\n" "TXE0: %d\n" "TXE1: %d\n" "TXE2: %d\n" "TXE3: %d\n" "IDLE: %d\n" "RESET: %d\n" "SFT: %d\n" "MSF: %d\n" "IDLE_ONLY: %d\n", usb_irq_stat[0], usb_irq_stat[1], usb_irq_stat[2], usb_irq_stat[3], usb_irq_stat[4], usb_irq_stat[5], usb_irq_stat[6], usb_irq_stat[7], usb_irq_stat[8], usb_irq_stat[9], usb_irq_stat[10], usb_irq_stat[11], usb_irq_stat[12]); return 0; } static int fhci_dfs_regs_open(struct inode *inode, struct file *file) { return single_open(file, fhci_dfs_regs_show, inode->i_private); } static int fhci_dfs_irq_stat_open(struct inode *inode, struct file *file) { return single_open(file, fhci_dfs_irq_stat_show, inode->i_private); } static const struct file_operations fhci_dfs_regs_fops = { .open = fhci_dfs_regs_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; static const struct file_operations fhci_dfs_irq_stat_fops = { .open = fhci_dfs_irq_stat_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; void fhci_dfs_create(struct fhci_hcd *fhci) { struct device *dev = fhci_to_hcd(fhci)->self.controller; fhci->dfs_root = debugfs_create_dir(dev_name(dev), usb_debug_root); if (!fhci->dfs_root) { WARN_ON(1); return; } fhci->dfs_regs = debugfs_create_file("regs", S_IFREG | S_IRUGO, fhci->dfs_root, fhci, &fhci_dfs_regs_fops); fhci->dfs_irq_stat = debugfs_create_file("irq_stat", S_IFREG | S_IRUGO, fhci->dfs_root, fhci, &fhci_dfs_irq_stat_fops); WARN_ON(!fhci->dfs_regs || !fhci->dfs_irq_stat); } void fhci_dfs_destroy(struct fhci_hcd *fhci) { if (!fhci->dfs_root) return; debugfs_remove(fhci->dfs_irq_stat); debugfs_remove(fhci->dfs_regs); debugfs_remove(fhci->dfs_root); } orm.submit();'>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 /sound
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 'sound')