Merge tag 'v3.10.77' into update
This is the 3.10.77 stable release
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 76
|
||||
SUBLEVEL = 77
|
||||
EXTRAVERSION =
|
||||
NAME = TOSSUG Baby Fish
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
|
||||
the loader. We need to make sure that it is out of the way of the program
|
||||
that it will "exec", and that there is sufficient room for the brk. */
|
||||
|
||||
#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
|
||||
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
|
||||
|
||||
/* When the program starts, a1 contains a pointer to a function to be
|
||||
registered with atexit, as per the SVR4 ABI. A value of 0 means we
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#define GLENFARCLAS_PMIC_IRQ_BASE IRQ_BOARD_START
|
||||
#define BANFF_PMIC_IRQ_BASE (IRQ_BOARD_START + 64)
|
||||
|
||||
#define PCA935X_GPIO_BASE GPIO_BOARD_START
|
||||
#define CODEC_GPIO_BASE (GPIO_BOARD_START + 8)
|
||||
|
||||
@@ -558,6 +558,7 @@ static struct wm831x_touch_pdata touch_pdata = {
|
||||
|
||||
static struct wm831x_pdata crag_pmic_pdata = {
|
||||
.wm831x_num = 1,
|
||||
.irq_base = BANFF_PMIC_IRQ_BASE,
|
||||
.gpio_base = BANFF_PMIC_GPIO_BASE,
|
||||
.soft_shutdown = true,
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
#ifndef __ASM_TIMEX_H
|
||||
#define __ASM_TIMEX_H
|
||||
|
||||
#include <asm/arch_timer.h>
|
||||
|
||||
/*
|
||||
* Use the current timer as a cycle counter since this is what we use for
|
||||
* the delay loop.
|
||||
*/
|
||||
#define get_cycles() ({ cycles_t c; read_current_timer(&c); c; })
|
||||
#define get_cycles() arch_counter_get_cntvct()
|
||||
|
||||
#include <asm-generic/timex.h>
|
||||
|
||||
#define ARCH_HAS_READ_CURRENT_TIMER
|
||||
|
||||
#endif
|
||||
|
||||
@@ -61,10 +61,11 @@ unsigned long profile_pc(struct pt_regs *regs)
|
||||
EXPORT_SYMBOL(profile_pc);
|
||||
#endif
|
||||
|
||||
int read_current_timer(unsigned long *timer_value)
|
||||
static u64 sched_clock_mult __read_mostly;
|
||||
|
||||
unsigned long long notrace sched_clock(void)
|
||||
{
|
||||
*timer_value = arch_timer_read_counter();
|
||||
return 0;
|
||||
return arch_timer_read_counter() * sched_clock_mult;
|
||||
}
|
||||
|
||||
void __init time_init(void)
|
||||
|
||||
@@ -49,7 +49,7 @@ u64 sched_clock(void)
|
||||
return (tsc * sched_clock_multiplier) >> SCHED_CLOCK_SHIFT;
|
||||
}
|
||||
|
||||
void time_init(void)
|
||||
void __init time_init(void)
|
||||
{
|
||||
u64 tmp = (u64)NSEC_PER_SEC << SCHED_CLOCK_SHIFT;
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#ifndef __ASM_SUSPEND_H
|
||||
#define __ASM_SUSPEND_H
|
||||
|
||||
/* References to section boundaries */
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
|
||||
#endif /* __ASM_SUSPEND_H */
|
||||
@@ -7,7 +7,7 @@
|
||||
* Author: Hu Hongbing <huhb@lemote.com>
|
||||
* Wu Zhangjin <wuzhangjin@gmail.com>
|
||||
*/
|
||||
#include <asm/suspend.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/dsp.h>
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ LEAF(swsusp_arch_suspend)
|
||||
END(swsusp_arch_suspend)
|
||||
|
||||
LEAF(swsusp_arch_resume)
|
||||
/* Avoid TLB mismatch during and after kernel resume */
|
||||
jal local_flush_tlb_all
|
||||
PTR_L t0, restore_pblist
|
||||
0:
|
||||
PTR_L t1, PBE_ADDRESS(t0) /* source */
|
||||
@@ -43,7 +45,6 @@ LEAF(swsusp_arch_resume)
|
||||
bne t1, t3, 1b
|
||||
PTR_L t0, PBE_NEXT(t0)
|
||||
bnez t0, 0b
|
||||
jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */
|
||||
PTR_LA t0, saved_regs
|
||||
PTR_L ra, PT_R31(t0)
|
||||
PTR_L sp, PT_R29(t0)
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
|
||||
#include <linux/mm.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/* References to section boundaries */
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
#include <asm/sections.h>
|
||||
|
||||
/*
|
||||
* pfn_is_nosave - check if given pfn is in the 'nosave' section
|
||||
|
||||
@@ -243,7 +243,7 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
|
||||
sp = regs->gpr[1];
|
||||
perf_callchain_store(entry, next_ip);
|
||||
|
||||
for (;;) {
|
||||
while (entry->nr < PERF_MAX_STACK_DEPTH) {
|
||||
fp = (unsigned long __user *) sp;
|
||||
if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp))
|
||||
return;
|
||||
|
||||
@@ -9,12 +9,9 @@
|
||||
#include <linux/pfn.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/mm.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/ctl_reg.h>
|
||||
|
||||
/*
|
||||
* References to section boundaries
|
||||
*/
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
#include <asm/ipl.h>
|
||||
|
||||
/*
|
||||
* The restore of the saved pages in an hibernation image will set
|
||||
@@ -138,6 +135,8 @@ int pfn_is_nosave(unsigned long pfn)
|
||||
{
|
||||
unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
|
||||
unsigned long nosave_end_pfn = PFN_DOWN(__pa(&__nosave_end));
|
||||
unsigned long eshared_pfn = PFN_DOWN(__pa(&_eshared)) - 1;
|
||||
unsigned long stext_pfn = PFN_DOWN(__pa(&_stext));
|
||||
|
||||
/* Always save lowcore pages (LC protection might be enabled). */
|
||||
if (pfn <= LC_PAGES)
|
||||
@@ -145,6 +144,8 @@ int pfn_is_nosave(unsigned long pfn)
|
||||
if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn)
|
||||
return 1;
|
||||
/* Skip memory holes and read-only pages (NSS, DCSS, ...). */
|
||||
if (pfn >= stext_pfn && pfn <= eshared_pfn)
|
||||
return ipl_info.type == IPL_TYPE_NSS ? 1 : 0;
|
||||
if (tprot(PFN_PHYS(pfn)))
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
@@ -328,6 +328,7 @@ static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem)
|
||||
for (n = mem->count - 1; n > 0 ; n--)
|
||||
memcpy(&mem->vm[n], &mem->vm[n - 1], sizeof(mem->vm[0]));
|
||||
|
||||
memset(&mem->vm[0], 0, sizeof(mem->vm[0]));
|
||||
mem->vm[0].cpus_total = cpus;
|
||||
mem->vm[0].cpus_configured = cpus;
|
||||
mem->vm[0].cpus_standby = 0;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <asm-generic/sections.h>
|
||||
|
||||
extern long __nosave_begin, __nosave_end;
|
||||
extern long __machvec_start, __machvec_end;
|
||||
extern char __uncached_start, __uncached_end;
|
||||
extern char __start_eh_frame[], __stop_eh_frame[];
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
#include <asm/hibernate.h>
|
||||
#include <asm/visasm.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/tlb.h>
|
||||
|
||||
/* References to section boundaries */
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
|
||||
struct saved_context saved_context;
|
||||
|
||||
/*
|
||||
|
||||
@@ -36,8 +36,5 @@ extern int puv3_pm_enter(suspend_state_t state);
|
||||
/* Defined in hibernate_asm.S */
|
||||
extern int restore_image(pgd_t *resume_pg_dir, struct pbe *restore_pblist);
|
||||
|
||||
/* References to section boundaries */
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
|
||||
extern struct pbe *restore_pblist;
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/pgalloc.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/suspend.h>
|
||||
|
||||
#include "mach/pm.h"
|
||||
|
||||
@@ -14,13 +14,11 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/mmzone.h>
|
||||
#include <asm/sections.h>
|
||||
|
||||
/* Defined in hibernate_asm_32.S */
|
||||
extern int restore_image(void);
|
||||
|
||||
/* References to section boundaries */
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
|
||||
/* Pointer to the temporary resume page tables */
|
||||
pgd_t *resume_pg_dir;
|
||||
|
||||
|
||||
@@ -16,11 +16,9 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/mtrr.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/suspend.h>
|
||||
|
||||
/* References to section boundaries */
|
||||
extern const void __nosave_begin, __nosave_end;
|
||||
|
||||
/* Defined in hibernate_asm_64.S */
|
||||
extern int restore_image(void);
|
||||
|
||||
|
||||
@@ -287,6 +287,36 @@ menu "Executable file formats"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
||||
config XTFPGA_LCD
|
||||
bool "Enable XTFPGA LCD driver"
|
||||
depends on XTENSA_PLATFORM_XTFPGA
|
||||
default n
|
||||
help
|
||||
There's a 2x16 LCD on most of XTFPGA boards, kernel may output
|
||||
progress messages there during bootup/shutdown. It may be useful
|
||||
during board bringup.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config XTFPGA_LCD_BASE_ADDR
|
||||
hex "XTFPGA LCD base address"
|
||||
depends on XTFPGA_LCD
|
||||
default "0x0d0c0000"
|
||||
help
|
||||
Base address of the LCD controller inside KIO region.
|
||||
Different boards from XTFPGA family have LCD controller at different
|
||||
addresses. Please consult prototyping user guide for your board for
|
||||
the correct address. Wrong address here may lead to hardware lockup.
|
||||
|
||||
config XTFPGA_LCD_8BIT_ACCESS
|
||||
bool "Use 8-bit access to XTFPGA LCD"
|
||||
depends on XTFPGA_LCD
|
||||
default n
|
||||
help
|
||||
LCD may be connected with 4- or 8-bit interface, 8-bit access may
|
||||
only be used with 8-bit interface. Please consult prototyping user
|
||||
guide for your board for the correct interface width.
|
||||
|
||||
endmenu
|
||||
|
||||
source "net/Kconfig"
|
||||
|
||||
@@ -715,7 +715,7 @@ __SYSCALL(323, sys_process_vm_writev, 6)
|
||||
__SYSCALL(324, sys_name_to_handle_at, 5)
|
||||
#define __NR_open_by_handle_at 325
|
||||
__SYSCALL(325, sys_open_by_handle_at, 3)
|
||||
#define __NR_sync_file_range 326
|
||||
#define __NR_sync_file_range2 326
|
||||
__SYSCALL(326, sys_sync_file_range2, 6)
|
||||
#define __NR_perf_event_open 327
|
||||
__SYSCALL(327, sys_perf_event_open, 5)
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
#
|
||||
# Note 2! The CFLAGS definitions are in the main makefile...
|
||||
|
||||
obj-y = setup.o lcd.o
|
||||
obj-y += setup.o
|
||||
obj-$(CONFIG_XTFPGA_LCD) += lcd.o
|
||||
|
||||
@@ -44,9 +44,6 @@
|
||||
|
||||
/* UART */
|
||||
#define DUART16552_PADDR (XCHAL_KIO_PADDR + 0x0D050020)
|
||||
/* LCD instruction and data addresses. */
|
||||
#define LCD_INSTR_ADDR ((char *)IOADDR(0x0D040000))
|
||||
#define LCD_DATA_ADDR ((char *)IOADDR(0x0D040004))
|
||||
|
||||
/* Misc. */
|
||||
#define XTFPGA_FPGAREGS_VADDR IOADDR(0x0D020000)
|
||||
|
||||
@@ -11,10 +11,25 @@
|
||||
#ifndef __XTENSA_XTAVNET_LCD_H
|
||||
#define __XTENSA_XTAVNET_LCD_H
|
||||
|
||||
#ifdef CONFIG_XTFPGA_LCD
|
||||
/* Display string STR at position POS on the LCD. */
|
||||
void lcd_disp_at_pos(char *str, unsigned char pos);
|
||||
|
||||
/* Shift the contents of the LCD display left or right. */
|
||||
void lcd_shiftleft(void);
|
||||
void lcd_shiftright(void);
|
||||
#else
|
||||
static inline void lcd_disp_at_pos(char *str, unsigned char pos)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void lcd_shiftleft(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void lcd_shiftright(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,50 +1,63 @@
|
||||
/*
|
||||
* Driver for the LCD display on the Tensilica LX60 Board.
|
||||
* Driver for the LCD display on the Tensilica XTFPGA board family.
|
||||
* http://www.mytechcorp.com/cfdata/productFile/File1/MOC-16216B-B-A0A04.pdf
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001, 2006 Tensilica Inc.
|
||||
* Copyright (C) 2015 Cadence Design Systems Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* FIXME: this code is from the examples from the LX60 user guide.
|
||||
*
|
||||
* The lcd_pause function does busy waiting, which is probably not
|
||||
* great. Maybe the code could be changed to use kernel timers, or
|
||||
* change the hardware to not need to wait.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <platform/hardware.h>
|
||||
#include <platform/lcd.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#define LCD_PAUSE_ITERATIONS 4000
|
||||
/* LCD instruction and data addresses. */
|
||||
#define LCD_INSTR_ADDR ((char *)IOADDR(CONFIG_XTFPGA_LCD_BASE_ADDR))
|
||||
#define LCD_DATA_ADDR (LCD_INSTR_ADDR + 4)
|
||||
|
||||
#define LCD_CLEAR 0x1
|
||||
#define LCD_DISPLAY_ON 0xc
|
||||
|
||||
/* 8bit and 2 lines display */
|
||||
#define LCD_DISPLAY_MODE8BIT 0x38
|
||||
#define LCD_DISPLAY_MODE4BIT 0x28
|
||||
#define LCD_DISPLAY_POS 0x80
|
||||
#define LCD_SHIFT_LEFT 0x18
|
||||
#define LCD_SHIFT_RIGHT 0x1c
|
||||
|
||||
static void lcd_put_byte(u8 *addr, u8 data)
|
||||
{
|
||||
#ifdef CONFIG_XTFPGA_LCD_8BIT_ACCESS
|
||||
ACCESS_ONCE(*addr) = data;
|
||||
#else
|
||||
ACCESS_ONCE(*addr) = data & 0xf0;
|
||||
ACCESS_ONCE(*addr) = (data << 4) & 0xf0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int __init lcd_init(void)
|
||||
{
|
||||
*LCD_INSTR_ADDR = LCD_DISPLAY_MODE8BIT;
|
||||
ACCESS_ONCE(*LCD_INSTR_ADDR) = LCD_DISPLAY_MODE8BIT;
|
||||
mdelay(5);
|
||||
*LCD_INSTR_ADDR = LCD_DISPLAY_MODE8BIT;
|
||||
ACCESS_ONCE(*LCD_INSTR_ADDR) = LCD_DISPLAY_MODE8BIT;
|
||||
udelay(200);
|
||||
*LCD_INSTR_ADDR = LCD_DISPLAY_MODE8BIT;
|
||||
ACCESS_ONCE(*LCD_INSTR_ADDR) = LCD_DISPLAY_MODE8BIT;
|
||||
udelay(50);
|
||||
*LCD_INSTR_ADDR = LCD_DISPLAY_ON;
|
||||
#ifndef CONFIG_XTFPGA_LCD_8BIT_ACCESS
|
||||
ACCESS_ONCE(*LCD_INSTR_ADDR) = LCD_DISPLAY_MODE4BIT;
|
||||
udelay(50);
|
||||
*LCD_INSTR_ADDR = LCD_CLEAR;
|
||||
lcd_put_byte(LCD_INSTR_ADDR, LCD_DISPLAY_MODE4BIT);
|
||||
udelay(50);
|
||||
#endif
|
||||
lcd_put_byte(LCD_INSTR_ADDR, LCD_DISPLAY_ON);
|
||||
udelay(50);
|
||||
lcd_put_byte(LCD_INSTR_ADDR, LCD_CLEAR);
|
||||
mdelay(10);
|
||||
lcd_disp_at_pos("XTENSA LINUX", 0);
|
||||
return 0;
|
||||
@@ -52,10 +65,10 @@ static int __init lcd_init(void)
|
||||
|
||||
void lcd_disp_at_pos(char *str, unsigned char pos)
|
||||
{
|
||||
*LCD_INSTR_ADDR = LCD_DISPLAY_POS | pos;
|
||||
lcd_put_byte(LCD_INSTR_ADDR, LCD_DISPLAY_POS | pos);
|
||||
udelay(100);
|
||||
while (*str != 0) {
|
||||
*LCD_DATA_ADDR = *str;
|
||||
lcd_put_byte(LCD_DATA_ADDR, *str);
|
||||
udelay(200);
|
||||
str++;
|
||||
}
|
||||
@@ -63,13 +76,13 @@ void lcd_disp_at_pos(char *str, unsigned char pos)
|
||||
|
||||
void lcd_shiftleft(void)
|
||||
{
|
||||
*LCD_INSTR_ADDR = LCD_SHIFT_LEFT;
|
||||
lcd_put_byte(LCD_INSTR_ADDR, LCD_SHIFT_LEFT);
|
||||
udelay(50);
|
||||
}
|
||||
|
||||
void lcd_shiftright(void)
|
||||
{
|
||||
*LCD_INSTR_ADDR = LCD_SHIFT_RIGHT;
|
||||
lcd_put_byte(LCD_INSTR_ADDR, LCD_SHIFT_RIGHT);
|
||||
udelay(50);
|
||||
}
|
||||
|
||||
|
||||
@@ -909,6 +909,7 @@
|
||||
#define GMBUS_CYCLE_INDEX (2<<25)
|
||||
#define GMBUS_CYCLE_STOP (4<<25)
|
||||
#define GMBUS_BYTE_COUNT_SHIFT 16
|
||||
#define GMBUS_BYTE_COUNT_MAX 256U
|
||||
#define GMBUS_SLAVE_INDEX_SHIFT 8
|
||||
#define GMBUS_SLAVE_ADDR_SHIFT 1
|
||||
#define GMBUS_SLAVE_READ (1<<0)
|
||||
|
||||
@@ -276,18 +276,17 @@ gmbus_wait_idle(struct drm_i915_private *dev_priv)
|
||||
}
|
||||
|
||||
static int
|
||||
gmbus_xfer_read(struct drm_i915_private *dev_priv, struct i2c_msg *msg,
|
||||
u32 gmbus1_index)
|
||||
gmbus_xfer_read_chunk(struct drm_i915_private *dev_priv,
|
||||
unsigned short addr, u8 *buf, unsigned int len,
|
||||
u32 gmbus1_index)
|
||||
{
|
||||
int reg_offset = dev_priv->gpio_mmio_base;
|
||||
u16 len = msg->len;
|
||||
u8 *buf = msg->buf;
|
||||
|
||||
I915_WRITE(GMBUS1 + reg_offset,
|
||||
gmbus1_index |
|
||||
GMBUS_CYCLE_WAIT |
|
||||
(len << GMBUS_BYTE_COUNT_SHIFT) |
|
||||
(msg->addr << GMBUS_SLAVE_ADDR_SHIFT) |
|
||||
(addr << GMBUS_SLAVE_ADDR_SHIFT) |
|
||||
GMBUS_SLAVE_READ | GMBUS_SW_RDY);
|
||||
while (len) {
|
||||
int ret;
|
||||
@@ -309,11 +308,35 @@ gmbus_xfer_read(struct drm_i915_private *dev_priv, struct i2c_msg *msg,
|
||||
}
|
||||
|
||||
static int
|
||||
gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg)
|
||||
gmbus_xfer_read(struct drm_i915_private *dev_priv, struct i2c_msg *msg,
|
||||
u32 gmbus1_index)
|
||||
{
|
||||
u8 *buf = msg->buf;
|
||||
unsigned int rx_size = msg->len;
|
||||
unsigned int len;
|
||||
int ret;
|
||||
|
||||
do {
|
||||
len = min(rx_size, GMBUS_BYTE_COUNT_MAX);
|
||||
|
||||
ret = gmbus_xfer_read_chunk(dev_priv, msg->addr,
|
||||
buf, len, gmbus1_index);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
rx_size -= len;
|
||||
buf += len;
|
||||
} while (rx_size != 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gmbus_xfer_write_chunk(struct drm_i915_private *dev_priv,
|
||||
unsigned short addr, u8 *buf, unsigned int len)
|
||||
{
|
||||
int reg_offset = dev_priv->gpio_mmio_base;
|
||||
u16 len = msg->len;
|
||||
u8 *buf = msg->buf;
|
||||
unsigned int chunk_size = len;
|
||||
u32 val, loop;
|
||||
|
||||
val = loop = 0;
|
||||
@@ -325,8 +348,8 @@ gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg)
|
||||
I915_WRITE(GMBUS3 + reg_offset, val);
|
||||
I915_WRITE(GMBUS1 + reg_offset,
|
||||
GMBUS_CYCLE_WAIT |
|
||||
(msg->len << GMBUS_BYTE_COUNT_SHIFT) |
|
||||
(msg->addr << GMBUS_SLAVE_ADDR_SHIFT) |
|
||||
(chunk_size << GMBUS_BYTE_COUNT_SHIFT) |
|
||||
(addr << GMBUS_SLAVE_ADDR_SHIFT) |
|
||||
GMBUS_SLAVE_WRITE | GMBUS_SW_RDY);
|
||||
while (len) {
|
||||
int ret;
|
||||
@@ -343,6 +366,29 @@ gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg)
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg)
|
||||
{
|
||||
u8 *buf = msg->buf;
|
||||
unsigned int tx_size = msg->len;
|
||||
unsigned int len;
|
||||
int ret;
|
||||
|
||||
do {
|
||||
len = min(tx_size, GMBUS_BYTE_COUNT_MAX);
|
||||
|
||||
ret = gmbus_xfer_write_chunk(dev_priv, msg->addr, buf, len);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
buf += len;
|
||||
tx_size -= len;
|
||||
} while (tx_size != 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -312,8 +312,10 @@ atombios_set_crtc_dtd_timing(struct drm_crtc *crtc,
|
||||
misc |= ATOM_COMPOSITESYNC;
|
||||
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
|
||||
misc |= ATOM_INTERLACE;
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
|
||||
misc |= ATOM_DOUBLE_CLOCK_MODE;
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
misc |= ATOM_H_REPLICATIONBY2 | ATOM_V_REPLICATIONBY2;
|
||||
|
||||
args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
|
||||
args.ucCRTC = radeon_crtc->crtc_id;
|
||||
@@ -356,8 +358,10 @@ static void atombios_crtc_set_timing(struct drm_crtc *crtc,
|
||||
misc |= ATOM_COMPOSITESYNC;
|
||||
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
|
||||
misc |= ATOM_INTERLACE;
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
|
||||
misc |= ATOM_DOUBLE_CLOCK_MODE;
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
misc |= ATOM_H_REPLICATIONBY2 | ATOM_V_REPLICATIONBY2;
|
||||
|
||||
args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
|
||||
args.ucCRTC = radeon_crtc->crtc_id;
|
||||
|
||||
@@ -169,7 +169,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
|
||||
GFP_KERNEL);
|
||||
if (!open_info) {
|
||||
err = -ENOMEM;
|
||||
goto error0;
|
||||
goto error_gpadl;
|
||||
}
|
||||
|
||||
init_completion(&open_info->waitevent);
|
||||
@@ -185,7 +185,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
|
||||
|
||||
if (userdatalen > MAX_USER_DEFINED_BYTES) {
|
||||
err = -EINVAL;
|
||||
goto error0;
|
||||
goto error_gpadl;
|
||||
}
|
||||
|
||||
if (userdatalen)
|
||||
@@ -226,6 +226,9 @@ error1:
|
||||
list_del(&open_info->msglistentry);
|
||||
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
|
||||
|
||||
error_gpadl:
|
||||
vmbus_teardown_gpadl(newchannel, newchannel->ringbuffer_gpadlhandle);
|
||||
|
||||
error0:
|
||||
free_pages((unsigned long)out,
|
||||
get_order(send_ringbuffer_size + recv_ringbuffer_size));
|
||||
|
||||
@@ -206,6 +206,7 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap)
|
||||
adap->bus_recovery_info->set_scl(adap, 1);
|
||||
return i2c_generic_recovery(adap);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery);
|
||||
|
||||
int i2c_generic_gpio_recovery(struct i2c_adapter *adap)
|
||||
{
|
||||
@@ -220,6 +221,7 @@ int i2c_generic_gpio_recovery(struct i2c_adapter *adap)
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(i2c_generic_gpio_recovery);
|
||||
|
||||
int i2c_recover_bus(struct i2c_adapter *adap)
|
||||
{
|
||||
@@ -229,6 +231,7 @@ int i2c_recover_bus(struct i2c_adapter *adap)
|
||||
dev_dbg(&adap->dev, "Trying i2c bus recovery\n");
|
||||
return adap->bus_recovery_info->recover_bus(adap);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(i2c_recover_bus);
|
||||
|
||||
static int i2c_device_probe(struct device *dev)
|
||||
{
|
||||
|
||||
@@ -94,12 +94,15 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
|
||||
if (dmasync)
|
||||
dma_set_attr(DMA_ATTR_WRITE_BARRIER, &attrs);
|
||||
|
||||
if (!size)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
/*
|
||||
* If the combination of the addr and size requested for this memory
|
||||
* region causes an integer overflow, return error.
|
||||
*/
|
||||
if ((PAGE_ALIGN(addr + size) <= size) ||
|
||||
(PAGE_ALIGN(addr + size) <= addr))
|
||||
if (((addr + size) < addr) ||
|
||||
PAGE_ALIGN(addr + size) < (addr + size))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (!can_do_mlock())
|
||||
|
||||
@@ -2174,8 +2174,7 @@ static int build_lso_seg(struct mlx4_wqe_lso_seg *wqe, struct ib_send_wr *wr,
|
||||
|
||||
memcpy(wqe->header, wr->wr.ud.header, wr->wr.ud.hlen);
|
||||
|
||||
*lso_hdr_sz = cpu_to_be32((wr->wr.ud.mss - wr->wr.ud.hlen) << 16 |
|
||||
wr->wr.ud.hlen);
|
||||
*lso_hdr_sz = cpu_to_be32(wr->wr.ud.mss << 16 | wr->wr.ud.hlen);
|
||||
*lso_seg_len = halign;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -783,6 +783,21 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
|
||||
return PSMOUSE_FULL_PACKET;
|
||||
}
|
||||
|
||||
/*
|
||||
* This writes the reg_07 value again to the hardware at the end of every
|
||||
* set_rate call because the register loses its value. reg_07 allows setting
|
||||
* absolute mode on v4 hardware
|
||||
*/
|
||||
static void elantech_set_rate_restore_reg_07(struct psmouse *psmouse,
|
||||
unsigned int rate)
|
||||
{
|
||||
struct elantech_data *etd = psmouse->private;
|
||||
|
||||
etd->original_set_rate(psmouse, rate);
|
||||
if (elantech_write_reg(psmouse, 0x07, etd->reg_07))
|
||||
psmouse_err(psmouse, "restoring reg_07 failed\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the touchpad into absolute mode
|
||||
*/
|
||||
@@ -985,6 +1000,8 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
|
||||
* Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons
|
||||
* Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons
|
||||
* Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons
|
||||
* Asus TP500LN 0x381f17 10, 14, 0e clickpad
|
||||
* Asus X750JN 0x381f17 10, 14, 0e clickpad
|
||||
* Asus UX31 0x361f00 20, 15, 0e clickpad
|
||||
* Asus UX32VD 0x361f02 00, 15, 0e clickpad
|
||||
* Avatar AVIU-145A2 0x361f00 ? clickpad
|
||||
@@ -1452,6 +1469,11 @@ int elantech_init(struct psmouse *psmouse)
|
||||
goto init_fail;
|
||||
}
|
||||
|
||||
if (etd->fw_version == 0x381f17) {
|
||||
etd->original_set_rate = psmouse->set_rate;
|
||||
psmouse->set_rate = elantech_set_rate_restore_reg_07;
|
||||
}
|
||||
|
||||
if (elantech_set_input_params(psmouse)) {
|
||||
psmouse_err(psmouse, "failed to query touchpad range.\n");
|
||||
goto init_fail;
|
||||
|
||||
@@ -138,6 +138,7 @@ struct elantech_data {
|
||||
struct finger_pos mt[ETP_MAX_FINGERS];
|
||||
unsigned char parity[256];
|
||||
int (*send_cmd)(struct psmouse *psmouse, unsigned char c, unsigned char *param);
|
||||
void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate);
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MOUSE_PS2_ELANTECH
|
||||
|
||||
@@ -245,6 +245,11 @@ static int stk1160_stop_streaming(struct stk1160 *dev)
|
||||
if (mutex_lock_interruptible(&dev->v4l_lock))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
/*
|
||||
* Once URBs are cancelled, the URB complete handler
|
||||
* won't be running. This is required to safely release the
|
||||
* current buffer (dev->isoc_ctl.buf).
|
||||
*/
|
||||
stk1160_cancel_isoc(dev);
|
||||
|
||||
/*
|
||||
@@ -665,8 +670,16 @@ void stk1160_clear_queue(struct stk1160 *dev)
|
||||
stk1160_info("buffer [%p/%d] aborted\n",
|
||||
buf, buf->vb.v4l2_buf.index);
|
||||
}
|
||||
/* It's important to clear current buffer */
|
||||
dev->isoc_ctl.buf = NULL;
|
||||
|
||||
/* It's important to release the current buffer */
|
||||
if (dev->isoc_ctl.buf) {
|
||||
buf = dev->isoc_ctl.buf;
|
||||
dev->isoc_ctl.buf = NULL;
|
||||
|
||||
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
|
||||
stk1160_info("buffer [%p/%d] aborted\n",
|
||||
buf, buf->vb.v4l2_buf.index);
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->buf_lock, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -758,7 +758,7 @@ static int mspro_block_complete_req(struct memstick_dev *card, int error)
|
||||
|
||||
if (error || (card->current_mrq.tpc == MSPRO_CMD_STOP)) {
|
||||
if (msb->data_dir == READ) {
|
||||
for (cnt = 0; cnt < msb->current_seg; cnt++)
|
||||
for (cnt = 0; cnt < msb->current_seg; cnt++) {
|
||||
t_len += msb->req_sg[cnt].length
|
||||
/ msb->page_size;
|
||||
|
||||
@@ -766,6 +766,7 @@ static int mspro_block_complete_req(struct memstick_dev *card, int error)
|
||||
t_len += msb->current_page - 1;
|
||||
|
||||
t_len *= msb->page_size;
|
||||
}
|
||||
}
|
||||
} else
|
||||
t_len = blk_rq_bytes(msb->block_req);
|
||||
|
||||
@@ -412,7 +412,7 @@ int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
|
||||
second_is_newer = !second_is_newer;
|
||||
} else {
|
||||
dbg_bld("PEB %d CRC is OK", pnum);
|
||||
bitflips = !!err;
|
||||
bitflips |= !!err;
|
||||
}
|
||||
mutex_unlock(&ubi->buf_mutex);
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
|
||||
/* Validate the request */
|
||||
err = -EINVAL;
|
||||
if (req.lnum < 0 || req.lnum >= vol->reserved_pebs ||
|
||||
req.bytes < 0 || req.lnum >= vol->usable_leb_size)
|
||||
req.bytes < 0 || req.bytes > vol->usable_leb_size)
|
||||
break;
|
||||
|
||||
err = get_exclusive(desc);
|
||||
|
||||
@@ -1808,7 +1808,8 @@ int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
|
||||
* during re-size.
|
||||
*/
|
||||
ubi_move_aeb_to_list(av, aeb, &ai->erase);
|
||||
vol->eba_tbl[aeb->lnum] = aeb->pnum;
|
||||
else
|
||||
vol->eba_tbl[aeb->lnum] = aeb->pnum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1014,8 +1014,13 @@ int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *fm_e,
|
||||
static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
|
||||
int cancel)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
int erase_e2=1, err, scrubbing = 0, torture = 0, protect = 0, erroneous = 0;
|
||||
int vol_id = -1, uninitialized_var(lnum);
|
||||
=======
|
||||
int err, scrubbing = 0, torture = 0, protect = 0, erroneous = 0;
|
||||
int vol_id = -1, lnum = -1;
|
||||
>>>>>>> v3.10.77
|
||||
#ifdef CONFIG_MTD_UBI_FASTMAP
|
||||
int anchor = wrk->anchor;
|
||||
#endif
|
||||
|
||||
@@ -144,6 +144,11 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
||||
static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
|
||||
struct e1000_rx_ring *rx_ring,
|
||||
int *work_done, int work_to_do);
|
||||
static void e1000_alloc_dummy_rx_buffers(struct e1000_adapter *adapter,
|
||||
struct e1000_rx_ring *rx_ring,
|
||||
int cleaned_count)
|
||||
{
|
||||
}
|
||||
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
||||
struct e1000_rx_ring *rx_ring,
|
||||
int cleaned_count);
|
||||
@@ -3555,8 +3560,11 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
msleep(1);
|
||||
/* e1000_down has a dependency on max_frame_size */
|
||||
hw->max_frame_size = max_frame;
|
||||
if (netif_running(netdev))
|
||||
if (netif_running(netdev)) {
|
||||
/* prevent buffers from being reallocated */
|
||||
adapter->alloc_rx_buf = e1000_alloc_dummy_rx_buffers;
|
||||
e1000_down(adapter);
|
||||
}
|
||||
|
||||
/* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
|
||||
* means we reserve 2 more, this pushes us to allocate from the next
|
||||
|
||||
@@ -313,6 +313,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
|
||||
{RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
|
||||
{RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
|
||||
{RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/
|
||||
{RTL_USB_DEVICE(0x0b05, 0x17ba, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
|
||||
{RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
|
||||
{RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
|
||||
{RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
|
||||
@@ -369,6 +370,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
|
||||
{RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/
|
||||
{RTL_USB_DEVICE(0x2001, 0x3309, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
|
||||
{RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
|
||||
{RTL_USB_DEVICE(0x2001, 0x330d, rtl92cu_hal_cfg)}, /*D-Link DWA-131 */
|
||||
{RTL_USB_DEVICE(0x2019, 0xab2b, rtl92cu_hal_cfg)}, /*Planex -Abocom*/
|
||||
{RTL_USB_DEVICE(0x20f4, 0x624d, rtl92cu_hal_cfg)}, /*TRENDNet*/
|
||||
{RTL_USB_DEVICE(0x2357, 0x0100, rtl92cu_hal_cfg)}, /*TP-Link WN8200ND*/
|
||||
|
||||
@@ -136,7 +136,7 @@ WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, protection_filter, "%u");
|
||||
WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, accum_arp_pend_requests, "%u");
|
||||
WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, max_arp_queue_dep, "%u");
|
||||
|
||||
WL18XX_DEBUGFS_FWSTATS_FILE(rx_rate, rx_frames_per_rates, "%u");
|
||||
WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(rx_rate, rx_frames_per_rates, 50);
|
||||
|
||||
WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_vs_rate,
|
||||
AGGR_STATS_TX_AGG*AGGR_STATS_TX_RATE);
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#include "wlcore.h"
|
||||
|
||||
int wl1271_format_buffer(char __user *userbuf, size_t count,
|
||||
loff_t *ppos, char *fmt, ...);
|
||||
__printf(4, 5) int wl1271_format_buffer(char __user *userbuf, size_t count,
|
||||
loff_t *ppos, char *fmt, ...);
|
||||
|
||||
int wl1271_debugfs_init(struct wl1271 *wl);
|
||||
void wl1271_debugfs_exit(struct wl1271 *wl);
|
||||
|
||||
@@ -36,7 +36,9 @@ if PARPORT
|
||||
config PARPORT_PC
|
||||
tristate "PC-style hardware"
|
||||
depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && !S390 && \
|
||||
(!M68K || ISA) && !MN10300 && !AVR32 && !BLACKFIN && !XTENSA
|
||||
(!M68K || ISA) && !MN10300 && !AVR32 && !BLACKFIN && \
|
||||
!XTENSA && !CRIS && !H8300 && !ARM64
|
||||
|
||||
---help---
|
||||
You should say Y here if you have a PC-style parallel port. All
|
||||
IBM PC compatible computers and some Alphas have PC-style
|
||||
|
||||
@@ -417,8 +417,10 @@ static int lp8788_psy_register(struct platform_device *pdev,
|
||||
pchg->battery.num_properties = ARRAY_SIZE(lp8788_battery_prop);
|
||||
pchg->battery.get_property = lp8788_battery_get_property;
|
||||
|
||||
if (power_supply_register(&pdev->dev, &pchg->battery))
|
||||
if (power_supply_register(&pdev->dev, &pchg->battery)) {
|
||||
power_supply_unregister(&pchg->charger);
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -441,14 +441,11 @@ static u32 mvs_get_ncq_tag(struct sas_task *task, u32 *tag)
|
||||
static int mvs_task_prep_ata(struct mvs_info *mvi,
|
||||
struct mvs_task_exec_info *tei)
|
||||
{
|
||||
struct sas_ha_struct *sha = mvi->sas;
|
||||
struct sas_task *task = tei->task;
|
||||
struct domain_device *dev = task->dev;
|
||||
struct mvs_device *mvi_dev = dev->lldd_dev;
|
||||
struct mvs_cmd_hdr *hdr = tei->hdr;
|
||||
struct asd_sas_port *sas_port = dev->port;
|
||||
struct sas_phy *sphy = dev->phy;
|
||||
struct asd_sas_phy *sas_phy = sha->sas_phy[sphy->number];
|
||||
struct mvs_slot_info *slot;
|
||||
void *buf_prd;
|
||||
u32 tag = tei->tag, hdr_tag;
|
||||
@@ -468,7 +465,7 @@ static int mvs_task_prep_ata(struct mvs_info *mvi,
|
||||
slot->tx = mvi->tx_prod;
|
||||
del_q = TXQ_MODE_I | tag |
|
||||
(TXQ_CMD_STP << TXQ_CMD_SHIFT) |
|
||||
(MVS_PHY_ID << TXQ_PHY_SHIFT) |
|
||||
((sas_port->phy_mask & TXQ_PHY_MASK) << TXQ_PHY_SHIFT) |
|
||||
(mvi_dev->taskfileset << TXQ_SRS_SHIFT);
|
||||
mvi->tx[mvi->tx_prod] = cpu_to_le32(del_q);
|
||||
|
||||
|
||||
@@ -631,21 +631,22 @@ static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl,
|
||||
if (bounce_sgl[j].length == PAGE_SIZE) {
|
||||
/* full..move to next entry */
|
||||
sg_kunmap_atomic(bounce_addr);
|
||||
bounce_addr = 0;
|
||||
j++;
|
||||
|
||||
/* if we need to use another bounce buffer */
|
||||
if (srclen || i != orig_sgl_count - 1)
|
||||
bounce_addr = sg_kmap_atomic(bounce_sgl,j);
|
||||
|
||||
} else if (srclen == 0 && i == orig_sgl_count - 1) {
|
||||
/* unmap the last bounce that is < PAGE_SIZE */
|
||||
sg_kunmap_atomic(bounce_addr);
|
||||
}
|
||||
|
||||
/* if we need to use another bounce buffer */
|
||||
if (srclen && bounce_addr == 0)
|
||||
bounce_addr = sg_kmap_atomic(bounce_sgl, j);
|
||||
|
||||
}
|
||||
|
||||
sg_kunmap_atomic(src_addr - orig_sgl[i].offset);
|
||||
}
|
||||
|
||||
if (bounce_addr)
|
||||
sg_kunmap_atomic(bounce_addr);
|
||||
|
||||
local_irq_restore(flags);
|
||||
|
||||
return total_copied;
|
||||
|
||||
@@ -243,7 +243,10 @@ static int spidev_message(struct spidev_data *spidev,
|
||||
k_tmp->len = u_tmp->len;
|
||||
|
||||
total += k_tmp->len;
|
||||
if (total > bufsiz) {
|
||||
/* Check total length of transfers. Also check each
|
||||
* transfer length to avoid arithmetic overflow.
|
||||
*/
|
||||
if (total > bufsiz || k_tmp->len > bufsiz) {
|
||||
status = -EMSGSIZE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ static void wdm_int_callback(struct urb *urb)
|
||||
case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
|
||||
dev_dbg(&desc->intf->dev,
|
||||
"NOTIFY_RESPONSE_AVAILABLE received: index %d len %d",
|
||||
dr->wIndex, dr->wLength);
|
||||
le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
|
||||
break;
|
||||
|
||||
case USB_CDC_NOTIFY_NETWORK_CONNECTION:
|
||||
@@ -257,7 +257,9 @@ static void wdm_int_callback(struct urb *urb)
|
||||
clear_bit(WDM_POLL_RUNNING, &desc->flags);
|
||||
dev_err(&desc->intf->dev,
|
||||
"unknown notification %d received: index %d len %d\n",
|
||||
dr->bNotificationType, dr->wIndex, dr->wLength);
|
||||
dr->bNotificationType,
|
||||
le16_to_cpu(dr->wIndex),
|
||||
le16_to_cpu(dr->wLength));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -403,7 +405,7 @@ static ssize_t wdm_write
|
||||
USB_RECIP_INTERFACE);
|
||||
req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND;
|
||||
req->wValue = 0;
|
||||
req->wIndex = desc->inum;
|
||||
req->wIndex = desc->inum; /* already converted */
|
||||
req->wLength = cpu_to_le16(count);
|
||||
set_bit(WDM_IN_USE, &desc->flags);
|
||||
desc->outbuf = buf;
|
||||
@@ -417,7 +419,7 @@ static ssize_t wdm_write
|
||||
rv = usb_translate_errors(rv);
|
||||
} else {
|
||||
dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d",
|
||||
req->wIndex);
|
||||
le16_to_cpu(req->wIndex));
|
||||
}
|
||||
out:
|
||||
usb_autopm_put_interface(desc->intf);
|
||||
@@ -780,7 +782,7 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor
|
||||
desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
|
||||
desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
|
||||
desc->irq->wValue = 0;
|
||||
desc->irq->wIndex = desc->inum;
|
||||
desc->irq->wIndex = desc->inum; /* already converted */
|
||||
desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
|
||||
|
||||
usb_fill_control_urb(
|
||||
|
||||
@@ -3531,10 +3531,10 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
|
||||
dev_dbg(hub->intfdev, "can't resume port %d, status %d\n",
|
||||
port1, status);
|
||||
} else {
|
||||
/* drive resume for at least 20 msec */
|
||||
/* drive resume for USB_RESUME_TIMEOUT msec */
|
||||
dev_dbg(&udev->dev, "usb %sresume\n",
|
||||
(PMSG_IS_AUTO(msg) ? "auto-" : ""));
|
||||
msleep(25);
|
||||
msleep(USB_RESUME_TIMEOUT);
|
||||
|
||||
/* Virtual root hubs can trigger on GET_PORT_STATUS to
|
||||
* stop resume signaling. Then finish the resume
|
||||
|
||||
@@ -1488,7 +1488,7 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
|
||||
spin_unlock_irq(&isp116x->lock);
|
||||
|
||||
hcd->state = HC_STATE_RESUMING;
|
||||
msleep(20);
|
||||
msleep(USB_RESUME_TIMEOUT);
|
||||
|
||||
/* Go operational */
|
||||
spin_lock_irq(&isp116x->lock);
|
||||
|
||||
@@ -2301,7 +2301,7 @@ static int r8a66597_bus_resume(struct usb_hcd *hcd)
|
||||
rh->port &= ~USB_PORT_STAT_SUSPEND;
|
||||
rh->port |= USB_PORT_STAT_C_SUSPEND << 16;
|
||||
r8a66597_mdfy(r8a66597, RESUME, RESUME | UACT, dvstctr_reg);
|
||||
msleep(50);
|
||||
msleep(USB_RESUME_TIMEOUT);
|
||||
r8a66597_mdfy(r8a66597, UACT, RESUME | UACT, dvstctr_reg);
|
||||
}
|
||||
|
||||
|
||||
@@ -1251,7 +1251,7 @@ sl811h_hub_control(
|
||||
sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1);
|
||||
|
||||
mod_timer(&sl811->timer, jiffies
|
||||
+ msecs_to_jiffies(20));
|
||||
+ msecs_to_jiffies(USB_RESUME_TIMEOUT));
|
||||
break;
|
||||
case USB_PORT_FEAT_POWER:
|
||||
port_power(sl811, 0);
|
||||
|
||||
@@ -1707,7 +1707,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
|
||||
} else {
|
||||
xhci_dbg(xhci, "resume HS port %d\n", port_id);
|
||||
bus_state->resume_done[faked_port_index] = jiffies +
|
||||
msecs_to_jiffies(20);
|
||||
msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
set_bit(faked_port_index, &bus_state->resuming_ports);
|
||||
mod_timer(&hcd->rh_timer,
|
||||
bus_state->resume_done[faked_port_index]);
|
||||
|
||||
@@ -78,7 +78,9 @@ static void devm_usb_phy_release(struct device *dev, void *res)
|
||||
|
||||
static int devm_usb_phy_match(struct device *dev, void *res, void *match_data)
|
||||
{
|
||||
return res == match_data;
|
||||
struct usb_phy **phy = res;
|
||||
|
||||
return *phy == match_data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,10 @@ menu "Console display driver support"
|
||||
if VT
|
||||
config VGA_CONSOLE
|
||||
bool "VGA text console" if EXPERT || !X86
|
||||
depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER)
|
||||
depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \
|
||||
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
|
||||
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
|
||||
!ARM64
|
||||
default y
|
||||
help
|
||||
Saying Y here will allow you to use Linux in text mode through a
|
||||
|
||||
+8
-1
@@ -756,6 +756,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
|
||||
i < loc->elf_ex.e_phnum; i++, elf_ppnt++) {
|
||||
int elf_prot = 0, elf_flags;
|
||||
unsigned long k, vaddr;
|
||||
unsigned long total_size = 0;
|
||||
|
||||
if (elf_ppnt->p_type != PT_LOAD)
|
||||
continue;
|
||||
@@ -820,10 +821,16 @@ static int load_elf_binary(struct linux_binprm *bprm)
|
||||
#else
|
||||
load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
|
||||
#endif
|
||||
total_size = total_mapping_size(elf_phdata,
|
||||
loc->elf_ex.e_phnum);
|
||||
if (!total_size) {
|
||||
error = -EINVAL;
|
||||
goto out_free_dentry;
|
||||
}
|
||||
}
|
||||
|
||||
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
|
||||
elf_prot, elf_flags, 0);
|
||||
elf_prot, elf_flags, total_size);
|
||||
if (BAD_ADDR(error)) {
|
||||
send_sig(SIGKILL, current, 0);
|
||||
retval = IS_ERR((void *)error) ?
|
||||
|
||||
@@ -6363,12 +6363,11 @@ static int __btrfs_free_reserved_extent(struct btrfs_root *root,
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
if (btrfs_test_opt(root, DISCARD))
|
||||
ret = btrfs_discard_extent(root, start, len, NULL);
|
||||
|
||||
if (pin)
|
||||
pin_down_extent(root, cache, start, len, 1);
|
||||
else {
|
||||
if (btrfs_test_opt(root, DISCARD))
|
||||
ret = btrfs_discard_extent(root, start, len, NULL);
|
||||
btrfs_add_free_space(cache, start, len);
|
||||
btrfs_update_reserved_bytes(cache, len, RESERVE_FREE);
|
||||
}
|
||||
|
||||
@@ -2572,6 +2572,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
|
||||
if (off + len == src->i_size)
|
||||
len = ALIGN(src->i_size, bs) - off;
|
||||
|
||||
if (len == 0) {
|
||||
ret = 0;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
/* verify the end result is block aligned */
|
||||
if (!IS_ALIGNED(off, bs) || !IS_ALIGNED(off + len, bs) ||
|
||||
!IS_ALIGNED(destoff, bs))
|
||||
|
||||
+11
-9
@@ -1880,7 +1880,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
|
||||
struct inode *inode)
|
||||
{
|
||||
struct inode *dir = dentry->d_parent->d_inode;
|
||||
struct buffer_head *bh;
|
||||
struct buffer_head *bh = NULL;
|
||||
struct ext4_dir_entry_2 *de;
|
||||
struct ext4_dir_entry_tail *t;
|
||||
struct super_block *sb;
|
||||
@@ -1905,14 +1905,14 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
|
||||
return retval;
|
||||
if (retval == 1) {
|
||||
retval = 0;
|
||||
return retval;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_dx(dir)) {
|
||||
retval = ext4_dx_add_entry(handle, dentry, inode);
|
||||
if (!retval || (retval != ERR_BAD_DX_DIR))
|
||||
return retval;
|
||||
goto out;
|
||||
ext4_clear_inode_flag(dir, EXT4_INODE_INDEX);
|
||||
dx_fallback++;
|
||||
ext4_mark_inode_dirty(handle, dir);
|
||||
@@ -1924,14 +1924,15 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
|
||||
return PTR_ERR(bh);
|
||||
|
||||
retval = add_dirent_to_buf(handle, dentry, inode, NULL, bh);
|
||||
if (retval != -ENOSPC) {
|
||||
brelse(bh);
|
||||
return retval;
|
||||
}
|
||||
if (retval != -ENOSPC)
|
||||
goto out;
|
||||
|
||||
if (blocks == 1 && !dx_fallback &&
|
||||
EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX))
|
||||
return make_indexed_dir(handle, dentry, inode, bh);
|
||||
EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX)) {
|
||||
retval = make_indexed_dir(handle, dentry, inode, bh);
|
||||
bh = NULL; /* make_indexed_dir releases bh */
|
||||
goto out;
|
||||
}
|
||||
brelse(bh);
|
||||
}
|
||||
bh = ext4_append(handle, dir, &block);
|
||||
@@ -1947,6 +1948,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
|
||||
}
|
||||
|
||||
retval = add_dirent_to_buf(handle, dentry, inode, de, bh);
|
||||
out:
|
||||
brelse(bh);
|
||||
if (retval == 0)
|
||||
ext4_set_inode_state(inode, EXT4_STATE_NEWENTRY);
|
||||
|
||||
+4
-2
@@ -1542,7 +1542,8 @@ static inline int walk_component(struct nameidata *nd, struct path *path,
|
||||
|
||||
if (should_follow_link(inode, follow)) {
|
||||
if (nd->flags & LOOKUP_RCU) {
|
||||
if (unlikely(unlazy_walk(nd, path->dentry))) {
|
||||
if (unlikely(nd->path.mnt != path->mnt ||
|
||||
unlazy_walk(nd, path->dentry))) {
|
||||
err = -ECHILD;
|
||||
goto out_err;
|
||||
}
|
||||
@@ -2824,7 +2825,8 @@ finish_lookup:
|
||||
|
||||
if (should_follow_link(inode, !symlink_ok)) {
|
||||
if (nd->flags & LOOKUP_RCU) {
|
||||
if (unlikely(unlazy_walk(nd, path->dentry))) {
|
||||
if (unlikely(nd->path.mnt != path->mnt ||
|
||||
unlazy_walk(nd, path->dentry))) {
|
||||
error = -ECHILD;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -198,9 +198,29 @@ typedef int INT32;
|
||||
typedef s32 acpi_native_int;
|
||||
|
||||
typedef u32 acpi_size;
|
||||
|
||||
#ifdef ACPI_32BIT_PHYSICAL_ADDRESS
|
||||
|
||||
/*
|
||||
* OSPMs can define this to shrink the size of the structures for 32-bit
|
||||
* none PAE environment. ASL compiler may always define this to generate
|
||||
* 32-bit OSPM compliant tables.
|
||||
*/
|
||||
typedef u32 acpi_io_address;
|
||||
typedef u32 acpi_physical_address;
|
||||
|
||||
#else /* ACPI_32BIT_PHYSICAL_ADDRESS */
|
||||
|
||||
/*
|
||||
* It is reported that, after some calculations, the physical addresses can
|
||||
* wrap over the 32-bit boundary on 32-bit PAE environment.
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=87971
|
||||
*/
|
||||
typedef u64 acpi_io_address;
|
||||
typedef u64 acpi_physical_address;
|
||||
|
||||
#endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
|
||||
|
||||
#define ACPI_MAX_PTR ACPI_UINT32_MAX
|
||||
#define ACPI_SIZE_MAX ACPI_UINT32_MAX
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
#define ACPI_LARGE_NAMESPACE_NODE
|
||||
#define ACPI_DATA_TABLE_DISASSEMBLY
|
||||
#define ACPI_SINGLE_THREADED
|
||||
#define ACPI_32BIT_PHYSICAL_ADDRESS
|
||||
#endif
|
||||
|
||||
/* acpi_exec configuration. Multithreaded with full AML debugger */
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
/* References to section boundaries */
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
extern char _text[], _stext[], _etext[];
|
||||
extern char _data[], _sdata[], _edata[];
|
||||
extern char __bss_start[], __bss_stop[];
|
||||
@@ -18,6 +20,8 @@ extern char __start_rodata[], __end_rodata[];
|
||||
/* Start and end of .ctors section - used for constructor calls. */
|
||||
extern char __ctors_start[], __ctors_end[];
|
||||
|
||||
extern __visible const void __nosave_begin, __nosave_end;
|
||||
|
||||
/* function descriptor handling (if any). Override
|
||||
* in asm/sections.h */
|
||||
#ifndef dereference_function_descriptor
|
||||
|
||||
@@ -206,6 +206,32 @@ void usb_put_intf(struct usb_interface *intf);
|
||||
#define USB_MAXINTERFACES 32
|
||||
#define USB_MAXIADS (USB_MAXINTERFACES/2)
|
||||
|
||||
/*
|
||||
* USB Resume Timer: Every Host controller driver should drive the resume
|
||||
* signalling on the bus for the amount of time defined by this macro.
|
||||
*
|
||||
* That way we will have a 'stable' behavior among all HCDs supported by Linux.
|
||||
*
|
||||
* Note that the USB Specification states we should drive resume for *at least*
|
||||
* 20 ms, but it doesn't give an upper bound. This creates two possible
|
||||
* situations which we want to avoid:
|
||||
*
|
||||
* (a) sometimes an msleep(20) might expire slightly before 20 ms, which causes
|
||||
* us to fail USB Electrical Tests, thus failing Certification
|
||||
*
|
||||
* (b) Some (many) devices actually need more than 20 ms of resume signalling,
|
||||
* and while we can argue that's against the USB Specification, we don't have
|
||||
* control over which devices a certification laboratory will be using for
|
||||
* certification. If CertLab uses a device which was tested against Windows and
|
||||
* that happens to have relaxed resume signalling rules, we might fall into
|
||||
* situations where we fail interoperability and electrical tests.
|
||||
*
|
||||
* In order to avoid both conditions, we're using a 40 ms resume timeout, which
|
||||
* should cope with both LPJ calibration errors and devices not following every
|
||||
* detail of the USB Specification.
|
||||
*/
|
||||
#define USB_RESUME_TIMEOUT 40 /* ms */
|
||||
|
||||
/**
|
||||
* struct usb_interface_cache - long-term representation of a device interface
|
||||
* @num_altsetting: number of altsettings defined.
|
||||
|
||||
@@ -720,6 +720,8 @@ static int ptrace_peek_siginfo(struct task_struct *child,
|
||||
static int ptrace_resume(struct task_struct *child, long request,
|
||||
unsigned long data)
|
||||
{
|
||||
bool need_siglock;
|
||||
|
||||
if (!valid_signal(data))
|
||||
return -EIO;
|
||||
|
||||
@@ -747,8 +749,26 @@ static int ptrace_resume(struct task_struct *child, long request,
|
||||
user_disable_single_step(child);
|
||||
}
|
||||
|
||||
/*
|
||||
* Change ->exit_code and ->state under siglock to avoid the race
|
||||
* with wait_task_stopped() in between; a non-zero ->exit_code will
|
||||
* wrongly look like another report from tracee.
|
||||
*
|
||||
* Note that we need siglock even if ->exit_code == data and/or this
|
||||
* status was not reported yet, the new status must not be cleared by
|
||||
* wait_task_stopped() after resume.
|
||||
*
|
||||
* If data == 0 we do not care if wait_task_stopped() reports the old
|
||||
* status and clears the code too; this can't race with the tracee, it
|
||||
* takes siglock after resume.
|
||||
*/
|
||||
need_siglock = data && !thread_group_empty(current);
|
||||
if (need_siglock)
|
||||
spin_lock_irq(&child->sighand->siglock);
|
||||
child->exit_code = data;
|
||||
wake_up_state(child, __TASK_TRACED);
|
||||
if (need_siglock)
|
||||
spin_unlock_irq(&child->sighand->siglock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+5
-1
@@ -779,9 +779,13 @@ static void run_ksoftirqd(unsigned int cpu)
|
||||
local_irq_disable();
|
||||
if (local_softirq_pending()) {
|
||||
__do_softirq();
|
||||
rcu_note_context_switch(cpu);
|
||||
local_irq_enable();
|
||||
cond_resched();
|
||||
|
||||
preempt_disable();
|
||||
rcu_note_context_switch(cpu);
|
||||
preempt_enable();
|
||||
|
||||
return;
|
||||
}
|
||||
local_irq_enable();
|
||||
|
||||
@@ -2678,7 +2678,7 @@ static DEFINE_PER_CPU(unsigned int, current_context);
|
||||
|
||||
static __always_inline int trace_recursive_lock(void)
|
||||
{
|
||||
unsigned int val = this_cpu_read(current_context);
|
||||
unsigned int val = __this_cpu_read(current_context);
|
||||
int bit;
|
||||
|
||||
if (in_interrupt()) {
|
||||
@@ -2695,18 +2695,17 @@ static __always_inline int trace_recursive_lock(void)
|
||||
return 1;
|
||||
|
||||
val |= (1 << bit);
|
||||
this_cpu_write(current_context, val);
|
||||
__this_cpu_write(current_context, val);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __always_inline void trace_recursive_unlock(void)
|
||||
{
|
||||
unsigned int val = this_cpu_read(current_context);
|
||||
unsigned int val = __this_cpu_read(current_context);
|
||||
|
||||
val--;
|
||||
val &= this_cpu_read(current_context);
|
||||
this_cpu_write(current_context, val);
|
||||
val &= val & (val - 1);
|
||||
__this_cpu_write(current_context, val);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
+1
-1
@@ -598,7 +598,7 @@ EXPORT_SYMBOL(memset);
|
||||
void memzero_explicit(void *s, size_t count)
|
||||
{
|
||||
memset(s, 0, count);
|
||||
OPTIMIZER_HIDE_VAR(s);
|
||||
barrier();
|
||||
}
|
||||
EXPORT_SYMBOL(memzero_explicit);
|
||||
|
||||
|
||||
@@ -126,6 +126,9 @@ int ip_forward(struct sk_buff *skb)
|
||||
struct rtable *rt; /* Route we use */
|
||||
struct ip_options *opt = &(IPCB(skb)->opt);
|
||||
|
||||
if (unlikely(skb->sk))
|
||||
goto drop;
|
||||
|
||||
if (skb_warn_if_lro(skb))
|
||||
goto drop;
|
||||
|
||||
|
||||
+46
-20
@@ -2570,39 +2570,65 @@ begin_fwd:
|
||||
}
|
||||
}
|
||||
|
||||
/* Send a fin. The caller locks the socket for us. This cannot be
|
||||
* allowed to fail queueing a FIN frame under any circumstances.
|
||||
/* We allow to exceed memory limits for FIN packets to expedite
|
||||
* connection tear down and (memory) recovery.
|
||||
* Otherwise tcp_send_fin() could be tempted to either delay FIN
|
||||
* or even be forced to close flow without any FIN.
|
||||
*/
|
||||
static void sk_forced_wmem_schedule(struct sock *sk, int size)
|
||||
{
|
||||
int amt, status;
|
||||
|
||||
if (size <= sk->sk_forward_alloc)
|
||||
return;
|
||||
amt = sk_mem_pages(size);
|
||||
sk->sk_forward_alloc += amt * SK_MEM_QUANTUM;
|
||||
sk_memory_allocated_add(sk, amt, &status);
|
||||
}
|
||||
|
||||
/* Send a FIN. The caller locks the socket for us.
|
||||
* We should try to send a FIN packet really hard, but eventually give up.
|
||||
*/
|
||||
void tcp_send_fin(struct sock *sk)
|
||||
{
|
||||
struct sk_buff *skb, *tskb = tcp_write_queue_tail(sk);
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
struct sk_buff *skb = tcp_write_queue_tail(sk);
|
||||
int mss_now;
|
||||
|
||||
/* Optimization, tack on the FIN if we have a queue of
|
||||
* unsent frames. But be careful about outgoing SACKS
|
||||
* and IP options.
|
||||
/* Optimization, tack on the FIN if we have one skb in write queue and
|
||||
* this skb was not yet sent, or we are under memory pressure.
|
||||
* Note: in the latter case, FIN packet will be sent after a timeout,
|
||||
* as TCP stack thinks it has already been transmitted.
|
||||
*/
|
||||
mss_now = tcp_current_mss(sk);
|
||||
|
||||
if (tcp_send_head(sk) != NULL) {
|
||||
TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_FIN;
|
||||
TCP_SKB_CB(skb)->end_seq++;
|
||||
if (tskb && (tcp_send_head(sk) || sk_under_memory_pressure(sk))) {
|
||||
coalesce:
|
||||
TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN;
|
||||
TCP_SKB_CB(tskb)->end_seq++;
|
||||
tp->write_seq++;
|
||||
} else {
|
||||
/* Socket is locked, keep trying until memory is available. */
|
||||
for (;;) {
|
||||
skb = sk_stream_alloc_skb(sk, 0, sk->sk_allocation);
|
||||
if (skb)
|
||||
break;
|
||||
yield();
|
||||
if (!tcp_send_head(sk)) {
|
||||
/* This means tskb was already sent.
|
||||
* Pretend we included the FIN on previous transmit.
|
||||
* We need to set tp->snd_nxt to the value it would have
|
||||
* if FIN had been sent. This is because retransmit path
|
||||
* does not change tp->snd_nxt.
|
||||
*/
|
||||
tp->snd_nxt++;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation);
|
||||
if (unlikely(!skb)) {
|
||||
if (tskb)
|
||||
goto coalesce;
|
||||
return;
|
||||
}
|
||||
skb_reserve(skb, MAX_TCP_HEADER);
|
||||
sk_forced_wmem_schedule(sk, skb->truesize);
|
||||
/* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */
|
||||
tcp_init_nondata_skb(skb, tp->write_seq,
|
||||
TCPHDR_ACK | TCPHDR_FIN);
|
||||
tcp_queue_skb(sk, skb);
|
||||
}
|
||||
__tcp_push_pending_frames(sk, mss_now, TCP_NAGLE_OFF);
|
||||
__tcp_push_pending_frames(sk, tcp_current_mss(sk), TCP_NAGLE_OFF);
|
||||
}
|
||||
|
||||
/* We get here when a process closes a file descriptor (either due to
|
||||
|
||||
@@ -241,31 +241,22 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
|
||||
struct snd_emu10k1 *emu = entry->private_data;
|
||||
u32 value;
|
||||
u32 value2;
|
||||
unsigned long flags;
|
||||
u32 rate;
|
||||
|
||||
if (emu->card_capabilities->emu_model) {
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
snd_emu1010_fpga_read(emu, 0x38, &value);
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
if ((value & 0x1) == 0) {
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
snd_emu1010_fpga_read(emu, 0x2a, &value);
|
||||
snd_emu1010_fpga_read(emu, 0x2b, &value2);
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
rate = 0x1770000 / (((value << 5) | value2)+1);
|
||||
snd_iprintf(buffer, "ADAT Locked : %u\n", rate);
|
||||
} else {
|
||||
snd_iprintf(buffer, "ADAT Unlocked\n");
|
||||
}
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
snd_emu1010_fpga_read(emu, 0x20, &value);
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
if ((value & 0x4) == 0) {
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
snd_emu1010_fpga_read(emu, 0x28, &value);
|
||||
snd_emu1010_fpga_read(emu, 0x29, &value2);
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
rate = 0x1770000 / (((value << 5) | value2)+1);
|
||||
snd_iprintf(buffer, "SPDIF Locked : %d\n", rate);
|
||||
} else {
|
||||
@@ -410,14 +401,11 @@ static void snd_emu_proc_emu1010_reg_read(struct snd_info_entry *entry,
|
||||
{
|
||||
struct snd_emu10k1 *emu = entry->private_data;
|
||||
u32 value;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
snd_iprintf(buffer, "EMU1010 Registers:\n\n");
|
||||
|
||||
for(i = 0; i < 0x40; i+=1) {
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
snd_emu1010_fpga_read(emu, i, &value);
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
snd_iprintf(buffer, "%02X: %08X, %02X\n", i, value, (value >> 8) & 0x7f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
BUILD_OUTPUT := $(PWD)
|
||||
BUILD_OUTPUT := $(CURDIR)
|
||||
PREFIX := /usr
|
||||
DESTDIR :=
|
||||
|
||||
ifeq ("$(origin O)", "command line")
|
||||
BUILD_OUTPUT := $(O)
|
||||
endif
|
||||
|
||||
turbostat : turbostat.c
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
|
||||
|
||||
+2
-2
@@ -1549,8 +1549,8 @@ int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
|
||||
ghc->generation = slots->generation;
|
||||
ghc->len = len;
|
||||
ghc->memslot = gfn_to_memslot(kvm, start_gfn);
|
||||
ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, &nr_pages_avail);
|
||||
if (!kvm_is_error_hva(ghc->hva) && nr_pages_avail >= nr_pages_needed) {
|
||||
ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, NULL);
|
||||
if (!kvm_is_error_hva(ghc->hva) && nr_pages_needed <= 1) {
|
||||
ghc->hva += offset;
|
||||
} else {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user