/**************************************************************************** * * Driver for the IFX spi modem. * * Copyright (C) 2009, 2010 Intel Corp * Jim Stanley * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * * * *****************************************************************************/ #ifndef _IFX6X60_H #define _IFX6X60_H #define DRVNAME "ifx6x60" #define TTYNAME "ttyIFX" #define IFX_SPI_MAX_MINORS 1 #define IFX_SPI_TRANSFER_SIZE 2048 #define IFX_SPI_FIFO_SIZE 4096 #define IFX_SPI_HEADER_OVERHEAD 4 #define IFX_RESET_TIMEOUT msecs_to_jiffies(50) /* device flags bitfield definitions */ #define IFX_SPI_STATE_PRESENT 0 #define IFX_SPI_STATE_IO_IN_PROGRESS 1 #define IFX_SPI_STATE_IO_READY 2 #define IFX_SPI_STATE_TIMER_PENDING 3 #define IFX_SPI_STATE_IO_AVAILABLE 4 /* flow control bitfields */ #define IFX_SPI_DCD 0 #define IFX_SPI_CTS 1 #define IFX_SPI_DSR 2 #define IFX_SPI_RI 3 #define IFX_SPI_DTR 4 #define IFX_SPI_RTS 5 #define IFX_SPI_TX_FC 6 #define IFX_SPI_RX_FC 7 #define IFX_SPI_UPDATE 8 #define IFX_SPI_PAYLOAD_SIZE (IFX_SPI_TRANSFER_SIZE - \ IFX_SPI_HEADER_OVERHEAD) #define IFX_SPI_IRQ_TYPE DETECT_EDGE_RISING #define IFX_SPI_GPIO_TARGET 0 #define IFX_SPI_GPIO0 0x105 #define IFX_SPI_STATUS_TIMEOUT (2000*HZ) /* values for bits in power status byte */ #define IFX_SPI_POWER_DATA_PENDING 1 #define IFX_SPI_POWER_SRDY 2 struct ifx_spi_device { /* Our SPI device */ struct spi_device *spi_dev; /* Port specific data */ struct kfifo tx_fifo; spinlock_t fifo_lock; unsigned long signal_state; /* TTY Layer logic */ struct tty_port tty_port; struct device *tty_dev; int minor; /* Low level I/O work */ struct tasklet_struct io_work_tasklet; unsigned long flags; dma_addr_t rx_dma; dma_addr_t tx_dma; int modem; /* Modem type */ int use_dma; /* provide dma-able addrs in SPI msg */ long max_hz; /* max SPI frequency */ spinlock_t write_lock; int write_pending; spinlock_t power_lock; unsigned char power_status; unsigned char *rx_buffer; unsigned char *tx_buffer; dma_addr_t rx_bus; dma_addr_t tx_bus; unsigned char spi_more; unsigned char spi_slave_cts; struct timer_list spi_timer; struct spi_message spi_msg; struct spi_transfer spi_xfer; struct { /* gpio lines */ unsigned short srdy; /* slave-ready gpio */ unsigned short mrdy; /* master-ready gpio */ unsigned short reset; /* modem-reset gpio */ unsigned short po; /* modem-on gpio */ unsigned short reset_out; /* modem-in-reset gpio */ /* state/stats */ int unack_srdy_int_nb; } gpio; /* modem reset */ unsigned long mdm_reset_state; #define MR_START 0 #define MR_INPROGRESS 1 #define MR_COMPLETE 2 wait_queue_head_t mdm_reset_wait; void (*swap_buf)(unsigned char *buf, int len, void *end); }; #endif /* _IFX6X60_H */ e='3' selected='selected'>3space:mode:
authorThomas Gleixner <tglx@linutronix.de>2017-01-31 23:58:38 +0100
committerIngo Molnar <mingo@kernel.org>2017-02-01 08:37:27 +0100
commitdd86e373e09fb16b83e8adf5c48c421a4ca76468 (patch)
tree55703c2ea8584e303e342090614e0aab3509ab21 /tools/objtool/arch
parent0b3589be9b98994ce3d5aeca52445d1f5627c4ba (diff)
perf/x86/intel/rapl: Make package handling more robust
The package management code in RAPL relies on package mapping being available before a CPU is started. This changed with: 9d85eb9119f4 ("x86/smpboot: Make logical package management more robust") because the ACPI/BIOS information turned out to be unreliable, but that left RAPL in broken state. This was not noticed because on a regular boot all CPUs are online before RAPL is initialized. A possible fix would be to reintroduce the mess which allocates a package data structure in CPU prepare and when it turns out to already exist in starting throw it away later in the CPU online callback. But that's a horrible hack and not required at all because RAPL becomes functional for perf only in the CPU online callback. That's correct because user space is not yet informed about the CPU being onlined, so nothing caan rely on RAPL being available on that particular CPU. Move the allocation to the CPU online callback and simplify the hotplug handling. At this point the package mapping is established and correct. This also adds a missing check for available package data in the event_init() function. Reported-by: Yasuaki Ishimatsu <yasu.isimatu@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Stephane Eranian <eranian@google.com> Cc: Vince Weaver <vincent.weaver@maine.edu> Fixes: 9d85eb9119f4 ("x86/smpboot: Make logical package management more robust") Link: http://lkml.kernel.org/r/20170131230141.212593966@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool/arch')