Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
Conflicts: drivers/usb/gadget/composite.c Change-Id: I1a332ec21da62aea98912df9a01cf0282ed50ee1
This commit is contained in:
commit
3f29a88349
325 changed files with 2917 additions and 1248 deletions
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 36
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = .2
|
||||
NAME = Flesh-Eating Bats with Fangs
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@
|
|||
@ Slightly optimised to avoid incrementing the pointer twice
|
||||
usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
|
||||
.if \rept == 2
|
||||
usraccoff \instr, \reg, \ptr, \inc, 4, \cond, \abort
|
||||
usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
|
||||
.endif
|
||||
|
||||
add\cond \ptr, #\rept * \inc
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ extern int kgdb_fault_expected;
|
|||
#define _GP_REGS 16
|
||||
#define _FP_REGS 8
|
||||
#define _EXTRA_REGS 2
|
||||
#define DBG_MAX_REG_NUM (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
|
||||
#define GDB_MAX_REGS (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
|
||||
#define DBG_MAX_REG_NUM (_GP_REGS + _FP_REGS + _EXTRA_REGS)
|
||||
|
||||
#define KGDB_MAX_NO_CPUS 1
|
||||
#define BUFMAX 400
|
||||
|
|
@ -93,7 +94,7 @@ extern int kgdb_fault_expected;
|
|||
#define _SPT 13
|
||||
#define _LR 14
|
||||
#define _PC 15
|
||||
#define _CPSR (DBG_MAX_REG_NUM - 1)
|
||||
#define _CPSR (GDB_MAX_REGS - 1)
|
||||
|
||||
/*
|
||||
* So that we can denote the end of a frame for tracing,
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
|
|||
return;
|
||||
|
||||
/* Initialize to zero */
|
||||
for (regno = 0; regno < DBG_MAX_REG_NUM; regno++)
|
||||
for (regno = 0; regno < GDB_MAX_REGS; regno++)
|
||||
gdb_regs[regno] = 0;
|
||||
|
||||
/* Otherwise, we have only some registers from switch_to() */
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ ENDPROC(_find_next_bit_be)
|
|||
*/
|
||||
.L_found:
|
||||
#if __LINUX_ARM_ARCH__ >= 5
|
||||
rsb r1, r3, #0
|
||||
and r3, r3, r1
|
||||
rsb r0, r3, #0
|
||||
and r3, r3, r0
|
||||
clz r3, r3
|
||||
rsb r3, r3, #31
|
||||
add r0, r2, r3
|
||||
|
|
@ -190,5 +190,7 @@ ENDPROC(_find_next_bit_be)
|
|||
addeq r2, r2, #1
|
||||
mov r0, r2
|
||||
#endif
|
||||
cmp r1, r0 @ Clamp to maxbit
|
||||
movlo r0, r1
|
||||
mov pc, lr
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
.macro addruart,rx
|
||||
.macro addruart,rx,rtmp
|
||||
mrc p15, 0, \rx, c1, c0
|
||||
tst \rx, #1 @ MMU enabled?
|
||||
moveq \rx, #0x10000000
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ static int __init cns3xxx_pcie_init(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS,
|
||||
hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0,
|
||||
"imprecise external abort");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,30 @@ static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address,
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if USE_SPLIT_PTLOCKS
|
||||
/*
|
||||
* If we are using split PTE locks, then we need to take the page
|
||||
* lock here. Otherwise we are using shared mm->page_table_lock
|
||||
* which is already locked, thus cannot take it.
|
||||
*/
|
||||
static inline void do_pte_lock(spinlock_t *ptl)
|
||||
{
|
||||
/*
|
||||
* Use nested version here to indicate that we are already
|
||||
* holding one similar spinlock.
|
||||
*/
|
||||
spin_lock_nested(ptl, SINGLE_DEPTH_NESTING);
|
||||
}
|
||||
|
||||
static inline void do_pte_unlock(spinlock_t *ptl)
|
||||
{
|
||||
spin_unlock(ptl);
|
||||
}
|
||||
#else /* !USE_SPLIT_PTLOCKS */
|
||||
static inline void do_pte_lock(spinlock_t *ptl) {}
|
||||
static inline void do_pte_unlock(spinlock_t *ptl) {}
|
||||
#endif /* USE_SPLIT_PTLOCKS */
|
||||
|
||||
static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
|
||||
unsigned long pfn)
|
||||
{
|
||||
|
|
@ -89,11 +113,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
|
|||
*/
|
||||
ptl = pte_lockptr(vma->vm_mm, pmd);
|
||||
pte = pte_offset_map_nested(pmd, address);
|
||||
spin_lock(ptl);
|
||||
do_pte_lock(ptl);
|
||||
|
||||
ret = do_adjust_pte(vma, address, pfn, pte);
|
||||
|
||||
spin_unlock(ptl);
|
||||
do_pte_unlock(ptl);
|
||||
pte_unmap_nested(pte);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <mach/hardware.h>
|
||||
|
|
@ -996,11 +997,17 @@ void omap_start_dma(int lch)
|
|||
l = dma_read(CCR(lch));
|
||||
|
||||
/*
|
||||
* Errata: On ES2.0 BUFFERING disable must be set.
|
||||
* This will always fail on ES1.0
|
||||
* Errata: Inter Frame DMA buffering issue (All OMAP2420 and
|
||||
* OMAP2430ES1.0): DMA will wrongly buffer elements if packing and
|
||||
* bursting is enabled. This might result in data gets stalled in
|
||||
* FIFO at the end of the block.
|
||||
* Workaround: DMA channels must have BUFFERING_DISABLED bit set to
|
||||
* guarantee no data will stay in the DMA FIFO in case inter frame
|
||||
* buffering occurs.
|
||||
*/
|
||||
if (cpu_is_omap24xx())
|
||||
l |= OMAP_DMA_CCR_EN;
|
||||
if (cpu_is_omap2420() ||
|
||||
(cpu_is_omap2430() && (omap_type() == OMAP2430_REV_ES1_0)))
|
||||
l |= OMAP_DMA_CCR_BUFFERING_DISABLE;
|
||||
|
||||
l |= OMAP_DMA_CCR_EN;
|
||||
dma_write(l, CCR(lch));
|
||||
|
|
@ -1018,8 +1025,39 @@ void omap_stop_dma(int lch)
|
|||
dma_write(0, CICR(lch));
|
||||
|
||||
l = dma_read(CCR(lch));
|
||||
l &= ~OMAP_DMA_CCR_EN;
|
||||
dma_write(l, CCR(lch));
|
||||
/* OMAP3 Errata i541: sDMA FIFO draining does not finish */
|
||||
if (cpu_is_omap34xx() && (l & OMAP_DMA_CCR_SEL_SRC_DST_SYNC)) {
|
||||
int i = 0;
|
||||
u32 sys_cf;
|
||||
|
||||
/* Configure No-Standby */
|
||||
l = dma_read(OCP_SYSCONFIG);
|
||||
sys_cf = l;
|
||||
l &= ~DMA_SYSCONFIG_MIDLEMODE_MASK;
|
||||
l |= DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_NO_IDLE);
|
||||
dma_write(l , OCP_SYSCONFIG);
|
||||
|
||||
l = dma_read(CCR(lch));
|
||||
l &= ~OMAP_DMA_CCR_EN;
|
||||
dma_write(l, CCR(lch));
|
||||
|
||||
/* Wait for sDMA FIFO drain */
|
||||
l = dma_read(CCR(lch));
|
||||
while (i < 100 && (l & (OMAP_DMA_CCR_RD_ACTIVE |
|
||||
OMAP_DMA_CCR_WR_ACTIVE))) {
|
||||
udelay(5);
|
||||
i++;
|
||||
l = dma_read(CCR(lch));
|
||||
}
|
||||
if (i >= 100)
|
||||
printk(KERN_ERR "DMA drain did not complete on "
|
||||
"lch %d\n", lch);
|
||||
/* Restore OCP_SYSCONFIG */
|
||||
dma_write(sys_cf, OCP_SYSCONFIG);
|
||||
} else {
|
||||
l &= ~OMAP_DMA_CCR_EN;
|
||||
dma_write(l, CCR(lch));
|
||||
}
|
||||
|
||||
if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
|
||||
int next_lch, cur_lch = lch;
|
||||
|
|
|
|||
|
|
@ -335,6 +335,10 @@
|
|||
#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
|
||||
|
||||
#define OMAP_DMA_CCR_EN (1 << 7)
|
||||
#define OMAP_DMA_CCR_RD_ACTIVE (1 << 9)
|
||||
#define OMAP_DMA_CCR_WR_ACTIVE (1 << 10)
|
||||
#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC (1 << 24)
|
||||
#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
|
||||
|
||||
#define OMAP_DMA_DATA_TYPE_S8 0x00
|
||||
#define OMAP_DMA_DATA_TYPE_S16 0x01
|
||||
|
|
|
|||
|
|
@ -72,12 +72,16 @@ export MMU DTB
|
|||
|
||||
all: linux.bin
|
||||
|
||||
BOOT_TARGETS = linux.bin linux.bin.gz simpleImage.%
|
||||
# With make 3.82 we cannot mix normal and wildcard targets
|
||||
BOOT_TARGETS1 = linux.bin linux.bin.gz
|
||||
BOOT_TARGETS2 = simpleImage.%
|
||||
|
||||
archclean:
|
||||
$(Q)$(MAKE) $(clean)=$(boot)
|
||||
|
||||
$(BOOT_TARGETS): vmlinux
|
||||
$(BOOT_TARGETS1): vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
$(BOOT_TARGETS2): vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
|
||||
define archhelp
|
||||
|
|
|
|||
|
|
@ -169,9 +169,11 @@ static int p970_marked_instr_event(u64 event)
|
|||
switch (unit) {
|
||||
case PM_VPU:
|
||||
mask = 0x4c; /* byte 0 bits 2,3,6 */
|
||||
break;
|
||||
case PM_LSU0:
|
||||
/* byte 2 bits 0,2,3,4,6; all of byte 1 */
|
||||
mask = 0x085dff00;
|
||||
break;
|
||||
case PM_LSU1L:
|
||||
mask = 0x50 << 24; /* byte 3 bits 4,6 */
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1122,7 +1122,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
|
|||
else
|
||||
#endif /* CONFIG_PPC_HAS_HASH_64K */
|
||||
rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
|
||||
subpage_protection(pgdir, ea));
|
||||
subpage_protection(mm, ea));
|
||||
|
||||
/* Dump some info in case of hash insertion failure, they should
|
||||
* never happen so it is really useful to know if/when they do
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ EXPORT_SYMBOL_GPL(s390_handle_mcck);
|
|||
static int notrace s390_revalidate_registers(struct mci *mci)
|
||||
{
|
||||
int kill_task;
|
||||
u64 tmpclock;
|
||||
u64 zero;
|
||||
void *fpt_save_area, *fpt_creg_save_area;
|
||||
|
||||
|
|
@ -214,11 +213,10 @@ static int notrace s390_revalidate_registers(struct mci *mci)
|
|||
: "0", "cc");
|
||||
#endif
|
||||
/* Revalidate clock comparator register */
|
||||
asm volatile(
|
||||
" stck 0(%1)\n"
|
||||
" sckc 0(%1)"
|
||||
: "=m" (tmpclock) : "a" (&(tmpclock)) : "cc", "memory");
|
||||
|
||||
if (S390_lowcore.clock_comparator == -1)
|
||||
set_clock_comparator(S390_lowcore.mcck_clock);
|
||||
else
|
||||
set_clock_comparator(S390_lowcore.clock_comparator);
|
||||
/* Check if old PSW is valid */
|
||||
if (!mci->wp)
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/kernel_stat.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/posix-timers.h>
|
||||
#include <linux/cpu.h>
|
||||
|
||||
#include <asm/s390_ext.h>
|
||||
#include <asm/timer.h>
|
||||
|
|
@ -565,6 +566,23 @@ void init_cpu_vtimer(void)
|
|||
__ctl_set_bit(0,10);
|
||||
}
|
||||
|
||||
static int __cpuinit s390_nohz_notify(struct notifier_block *self,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
struct s390_idle_data *idle;
|
||||
long cpu = (long) hcpu;
|
||||
|
||||
idle = &per_cpu(s390_idle, cpu);
|
||||
switch (action) {
|
||||
case CPU_DYING:
|
||||
case CPU_DYING_FROZEN:
|
||||
idle->nohz_delay = 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
void __init vtime_init(void)
|
||||
{
|
||||
/* request the cpu timer external interrupt */
|
||||
|
|
@ -573,5 +591,6 @@ void __init vtime_init(void)
|
|||
|
||||
/* Enable cpu timer interrupts on the boot cpu. */
|
||||
init_cpu_vtimer();
|
||||
cpu_notifier(s390_nohz_notify, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,17 +29,21 @@ static void __udelay_disabled(unsigned long long usecs)
|
|||
{
|
||||
unsigned long mask, cr0, cr0_saved;
|
||||
u64 clock_saved;
|
||||
u64 end;
|
||||
|
||||
mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT;
|
||||
end = get_clock() + (usecs << 12);
|
||||
clock_saved = local_tick_disable();
|
||||
set_clock_comparator(get_clock() + (usecs << 12));
|
||||
__ctl_store(cr0_saved, 0, 0);
|
||||
cr0 = (cr0_saved & 0xffff00e0) | 0x00000800;
|
||||
__ctl_load(cr0 , 0, 0);
|
||||
mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT;
|
||||
lockdep_off();
|
||||
trace_hardirqs_on();
|
||||
__load_psw_mask(mask);
|
||||
local_irq_disable();
|
||||
do {
|
||||
set_clock_comparator(end);
|
||||
trace_hardirqs_on();
|
||||
__load_psw_mask(mask);
|
||||
local_irq_disable();
|
||||
} while (get_clock() < end);
|
||||
lockdep_on();
|
||||
__ctl_load(cr0_saved, 0, 0);
|
||||
local_tick_enable(clock_saved);
|
||||
|
|
|
|||
|
|
@ -19,9 +19,10 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
|
|||
asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
|
||||
unsigned long r6, unsigned long r7,
|
||||
struct pt_regs __regs);
|
||||
asmlinkage int sys_execve(const char __user *ufilename, char __user * __user *uargv,
|
||||
char __user * __user *uenvp, unsigned long r7,
|
||||
struct pt_regs __regs);
|
||||
asmlinkage int sys_execve(const char __user *ufilename,
|
||||
const char __user *const __user *uargv,
|
||||
const char __user *const __user *uenvp,
|
||||
unsigned long r7, struct pt_regs __regs);
|
||||
asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,
|
||||
unsigned long r6, unsigned long r7,
|
||||
struct pt_regs __regs);
|
||||
|
|
|
|||
|
|
@ -727,6 +727,9 @@ struct winch {
|
|||
|
||||
static void free_winch(struct winch *winch, int free_irq_ok)
|
||||
{
|
||||
if (free_irq_ok)
|
||||
free_irq(WINCH_IRQ, winch);
|
||||
|
||||
list_del(&winch->list);
|
||||
|
||||
if (winch->pid != -1)
|
||||
|
|
@ -735,8 +738,6 @@ static void free_winch(struct winch *winch, int free_irq_ok)
|
|||
os_close_file(winch->fd);
|
||||
if (winch->stack != 0)
|
||||
free_stack(winch->stack, 0);
|
||||
if (free_irq_ok)
|
||||
free_irq(WINCH_IRQ, winch);
|
||||
kfree(winch);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ SECTIONS
|
|||
_text = .;
|
||||
_stext = .;
|
||||
__init_begin = .;
|
||||
INIT_TEXT_SECTION(PAGE_SIZE)
|
||||
INIT_TEXT_SECTION(0)
|
||||
. = ALIGN(PAGE_SIZE);
|
||||
|
||||
.text :
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ static inline long long timeval_to_ns(const struct timeval *tv)
|
|||
long long disable_timer(void)
|
||||
{
|
||||
struct itimerval time = ((struct itimerval) { { 0, 0 }, { 0, 0 } });
|
||||
int remain, max = UM_NSEC_PER_SEC / UM_HZ;
|
||||
long long remain, max = UM_NSEC_PER_SEC / UM_HZ;
|
||||
|
||||
if (setitimer(ITIMER_VIRTUAL, &time, &time) < 0)
|
||||
printk(UM_KERN_ERR "disable_timer - setitimer failed, "
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@
|
|||
#define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */
|
||||
#define X86_FEATURE_OSVW (6*32+ 9) /* OS Visible Workaround */
|
||||
#define X86_FEATURE_IBS (6*32+10) /* Instruction Based Sampling */
|
||||
#define X86_FEATURE_SSE5 (6*32+11) /* SSE-5 */
|
||||
#define X86_FEATURE_XOP (6*32+11) /* extended AVX instructions */
|
||||
#define X86_FEATURE_SKINIT (6*32+12) /* SKINIT/STGI instructions */
|
||||
#define X86_FEATURE_WDT (6*32+13) /* Watchdog timer */
|
||||
#define X86_FEATURE_NODEID_MSR (6*32+19) /* NodeId MSR */
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
|
|||
|
||||
extern void iounmap(volatile void __iomem *addr);
|
||||
|
||||
extern void set_iounmap_nonlazy(void);
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ enum mrst_cpu_type {
|
|||
};
|
||||
|
||||
extern enum mrst_cpu_type __mrst_cpu_chip;
|
||||
static enum mrst_cpu_type mrst_identify_cpu(void)
|
||||
static inline enum mrst_cpu_type mrst_identify_cpu(void)
|
||||
{
|
||||
return __mrst_cpu_chip;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ struct smp_ops {
|
|||
void (*smp_prepare_cpus)(unsigned max_cpus);
|
||||
void (*smp_cpus_done)(unsigned max_cpus);
|
||||
|
||||
void (*smp_send_stop)(void);
|
||||
void (*stop_other_cpus)(int wait);
|
||||
void (*smp_send_reschedule)(int cpu);
|
||||
|
||||
int (*cpu_up)(unsigned cpu);
|
||||
|
|
@ -73,7 +73,12 @@ extern struct smp_ops smp_ops;
|
|||
|
||||
static inline void smp_send_stop(void)
|
||||
{
|
||||
smp_ops.smp_send_stop();
|
||||
smp_ops.stop_other_cpus(0);
|
||||
}
|
||||
|
||||
static inline void stop_other_cpus(void)
|
||||
{
|
||||
smp_ops.stop_other_cpus(1);
|
||||
}
|
||||
|
||||
static inline void smp_prepare_boot_cpu(void)
|
||||
|
|
|
|||
|
|
@ -1397,6 +1397,7 @@ int setup_ioapic_entry(int apic_id, int irq,
|
|||
irte.dlvry_mode = apic->irq_delivery_mode;
|
||||
irte.vector = vector;
|
||||
irte.dest_id = IRTE_DEST(destination);
|
||||
irte.redir_hint = 1;
|
||||
|
||||
/* Set source-id of interrupt request */
|
||||
set_ioapic_sid(&irte, apic_id);
|
||||
|
|
@ -3348,6 +3349,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
|
|||
irte.dlvry_mode = apic->irq_delivery_mode;
|
||||
irte.vector = cfg->vector;
|
||||
irte.dest_id = IRTE_DEST(dest);
|
||||
irte.redir_hint = 1;
|
||||
|
||||
/* Set source-id of interrupt request */
|
||||
if (pdev)
|
||||
|
|
|
|||
|
|
@ -701,6 +701,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
|
|||
per_cpu(acfreq_data, policy->cpu) = NULL;
|
||||
acpi_processor_unregister_performance(data->acpi_data,
|
||||
policy->cpu);
|
||||
kfree(data->freq_table);
|
||||
kfree(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -827,7 +827,7 @@ int __init amd_special_default_mtrr(void)
|
|||
|
||||
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
|
||||
return 0;
|
||||
if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11)
|
||||
if (boot_cpu_data.x86 < 0xf)
|
||||
return 0;
|
||||
/* In case some hypervisor doesn't pass SYSCFG through: */
|
||||
if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static __initconst const u64 amd_hw_cache_event_ids
|
|||
[ C(DTLB) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
|
||||
[ C(RESULT_MISS) ] = 0x0046, /* L1 DTLB and L2 DLTB Miss */
|
||||
[ C(RESULT_MISS) ] = 0x0746, /* L1_DTLB_AND_L2_DLTB_MISS.ALL */
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = 0,
|
||||
|
|
@ -66,7 +66,7 @@ static __initconst const u64 amd_hw_cache_event_ids
|
|||
[ C(ITLB) ] = {
|
||||
[ C(OP_READ) ] = {
|
||||
[ C(RESULT_ACCESS) ] = 0x0080, /* Instruction fecthes */
|
||||
[ C(RESULT_MISS) ] = 0x0085, /* Instr. fetch ITLB misses */
|
||||
[ C(RESULT_MISS) ] = 0x0385, /* L1_ITLB_AND_L2_ITLB_MISS.ALL */
|
||||
},
|
||||
[ C(OP_WRITE) ] = {
|
||||
[ C(RESULT_ACCESS) ] = -1,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
|
|||
if (!csize)
|
||||
return 0;
|
||||
|
||||
vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
|
||||
vaddr = ioremap_cache(pfn << PAGE_SHIFT, PAGE_SIZE);
|
||||
if (!vaddr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -46,6 +46,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
|
|||
} else
|
||||
memcpy(buf, vaddr + offset, csize);
|
||||
|
||||
set_iounmap_nonlazy();
|
||||
iounmap(vaddr);
|
||||
return csize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,6 +433,10 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args)
|
|||
dr6_p = (unsigned long *)ERR_PTR(args->err);
|
||||
dr6 = *dr6_p;
|
||||
|
||||
/* If it's a single step, TRAP bits are random */
|
||||
if (dr6 & DR_STEP)
|
||||
return NOTIFY_DONE;
|
||||
|
||||
/* Do an early return if no trap bits are set in DR6 */
|
||||
if ((dr6 & DR_TRAP_BITS) == 0)
|
||||
return NOTIFY_DONE;
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
|
|||
unsigned long flags;
|
||||
int ret = -EIO;
|
||||
int i;
|
||||
int restarts = 0;
|
||||
|
||||
spin_lock_irqsave(&ec_lock, flags);
|
||||
|
||||
|
|
@ -169,7 +170,9 @@ restart:
|
|||
if (wait_on_obf(0x6c, 1)) {
|
||||
printk(KERN_ERR "olpc-ec: timeout waiting for"
|
||||
" EC to provide data!\n");
|
||||
goto restart;
|
||||
if (restarts++ < 10)
|
||||
goto restart;
|
||||
goto err;
|
||||
}
|
||||
outbuf[i] = inb(0x68);
|
||||
pr_devel("olpc-ec: received 0x%x\n", outbuf[i]);
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ void native_machine_shutdown(void)
|
|||
/* O.K Now that I'm on the appropriate processor,
|
||||
* stop all of the others.
|
||||
*/
|
||||
smp_send_stop();
|
||||
stop_other_cpus();
|
||||
#endif
|
||||
|
||||
lapic_shutdown();
|
||||
|
|
|
|||
|
|
@ -159,10 +159,10 @@ asmlinkage void smp_reboot_interrupt(void)
|
|||
irq_exit();
|
||||
}
|
||||
|
||||
static void native_smp_send_stop(void)
|
||||
static void native_stop_other_cpus(int wait)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long wait;
|
||||
unsigned long timeout;
|
||||
|
||||
if (reboot_force)
|
||||
return;
|
||||
|
|
@ -179,9 +179,12 @@ static void native_smp_send_stop(void)
|
|||
if (num_online_cpus() > 1) {
|
||||
apic->send_IPI_allbutself(REBOOT_VECTOR);
|
||||
|
||||
/* Don't wait longer than a second */
|
||||
wait = USEC_PER_SEC;
|
||||
while (num_online_cpus() > 1 && wait--)
|
||||
/*
|
||||
* Don't wait longer than a second if the caller
|
||||
* didn't ask us to wait.
|
||||
*/
|
||||
timeout = USEC_PER_SEC;
|
||||
while (num_online_cpus() > 1 && (wait || timeout--))
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
|
|
@ -227,7 +230,7 @@ struct smp_ops smp_ops = {
|
|||
.smp_prepare_cpus = native_smp_prepare_cpus,
|
||||
.smp_cpus_done = native_smp_cpus_done,
|
||||
|
||||
.smp_send_stop = native_smp_send_stop,
|
||||
.stop_other_cpus = native_stop_other_cpus,
|
||||
.smp_send_reschedule = native_smp_send_reschedule,
|
||||
|
||||
.cpu_up = native_cpu_up,
|
||||
|
|
|
|||
|
|
@ -575,6 +575,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
|
|||
if (regs->flags & X86_VM_MASK) {
|
||||
handle_vm86_trap((struct kernel_vm86_regs *) regs,
|
||||
error_code, 1);
|
||||
preempt_conditional_cli(regs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -551,8 +551,14 @@ cannot_handle:
|
|||
int handle_vm86_trap(struct kernel_vm86_regs *regs, long error_code, int trapno)
|
||||
{
|
||||
if (VMPI.is_vm86pus) {
|
||||
if ((trapno == 3) || (trapno == 1))
|
||||
return_to_32bit(regs, VM86_TRAP + (trapno << 8));
|
||||
if ((trapno == 3) || (trapno == 1)) {
|
||||
KVM86->regs32->ax = VM86_TRAP + (trapno << 8);
|
||||
/* setting this flag forces the code in entry_32.S to
|
||||
call save_v86_state() and change the stack pointer
|
||||
to KVM86->regs32 */
|
||||
set_thread_flag(TIF_IRET);
|
||||
return 0;
|
||||
}
|
||||
do_int(regs, trapno, (unsigned char __user *) (regs->pt.ss << 4), SP(regs));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,14 @@ struct nested_state {
|
|||
/* A VMEXIT is required but not yet emulated */
|
||||
bool exit_required;
|
||||
|
||||
/*
|
||||
* If we vmexit during an instruction emulation we need this to restore
|
||||
* the l1 guest rip after the emulation
|
||||
*/
|
||||
unsigned long vmexit_rip;
|
||||
unsigned long vmexit_rsp;
|
||||
unsigned long vmexit_rax;
|
||||
|
||||
/* cache for intercepts of the guest */
|
||||
u16 intercept_cr_read;
|
||||
u16 intercept_cr_write;
|
||||
|
|
@ -1206,8 +1214,12 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
|
|||
if (old == new) {
|
||||
/* cr0 write with ts and mp unchanged */
|
||||
svm->vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE;
|
||||
if (nested_svm_exit_handled(svm) == NESTED_EXIT_DONE)
|
||||
if (nested_svm_exit_handled(svm) == NESTED_EXIT_DONE) {
|
||||
svm->nested.vmexit_rip = kvm_rip_read(vcpu);
|
||||
svm->nested.vmexit_rsp = kvm_register_read(vcpu, VCPU_REGS_RSP);
|
||||
svm->nested.vmexit_rax = kvm_register_read(vcpu, VCPU_REGS_RAX);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2399,6 +2411,23 @@ static int emulate_on_interception(struct vcpu_svm *svm)
|
|||
return emulate_instruction(&svm->vcpu, 0, 0, 0) == EMULATE_DONE;
|
||||
}
|
||||
|
||||
static int cr0_write_interception(struct vcpu_svm *svm)
|
||||
{
|
||||
struct kvm_vcpu *vcpu = &svm->vcpu;
|
||||
int r;
|
||||
|
||||
r = emulate_instruction(&svm->vcpu, 0, 0, 0);
|
||||
|
||||
if (svm->nested.vmexit_rip) {
|
||||
kvm_register_write(vcpu, VCPU_REGS_RIP, svm->nested.vmexit_rip);
|
||||
kvm_register_write(vcpu, VCPU_REGS_RSP, svm->nested.vmexit_rsp);
|
||||
kvm_register_write(vcpu, VCPU_REGS_RAX, svm->nested.vmexit_rax);
|
||||
svm->nested.vmexit_rip = 0;
|
||||
}
|
||||
|
||||
return r == EMULATE_DONE;
|
||||
}
|
||||
|
||||
static int cr8_write_interception(struct vcpu_svm *svm)
|
||||
{
|
||||
struct kvm_run *kvm_run = svm->vcpu.run;
|
||||
|
|
@ -2672,7 +2701,7 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm) = {
|
|||
[SVM_EXIT_READ_CR4] = emulate_on_interception,
|
||||
[SVM_EXIT_READ_CR8] = emulate_on_interception,
|
||||
[SVM_EXIT_CR0_SEL_WRITE] = emulate_on_interception,
|
||||
[SVM_EXIT_WRITE_CR0] = emulate_on_interception,
|
||||
[SVM_EXIT_WRITE_CR0] = cr0_write_interception,
|
||||
[SVM_EXIT_WRITE_CR3] = emulate_on_interception,
|
||||
[SVM_EXIT_WRITE_CR4] = emulate_on_interception,
|
||||
[SVM_EXIT_WRITE_CR8] = cr8_write_interception,
|
||||
|
|
@ -3252,6 +3281,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;
|
||||
|
||||
load_host_msrs(vcpu);
|
||||
kvm_load_ldt(ldt_selector);
|
||||
loadsegment(fs, fs_selector);
|
||||
#ifdef CONFIG_X86_64
|
||||
load_gs_index(gs_selector);
|
||||
|
|
@ -3259,7 +3289,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||
#else
|
||||
loadsegment(gs, gs_selector);
|
||||
#endif
|
||||
kvm_load_ldt(ldt_selector);
|
||||
|
||||
reload_tss(vcpu);
|
||||
|
||||
|
|
@ -3354,6 +3383,10 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu)
|
|||
static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
|
||||
{
|
||||
switch (func) {
|
||||
case 0x80000001:
|
||||
if (nested)
|
||||
entry->ecx |= (1 << 2); /* Set SVM bit */
|
||||
break;
|
||||
case 0x8000000A:
|
||||
entry->eax = 1; /* SVM revision 1 */
|
||||
entry->ebx = 8; /* Lets support 8 ASIDs in case we add proper
|
||||
|
|
|
|||
|
|
@ -828,10 +828,9 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(&vmx->vcpu)) {
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
if (is_long_mode(&vmx->vcpu))
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < vmx->save_nmsrs; ++i)
|
||||
kvm_set_shared_msr(vmx->guest_msrs[i].index,
|
||||
|
|
@ -846,23 +845,23 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
|
|||
|
||||
++vmx->vcpu.stat.host_state_reload;
|
||||
vmx->host_state.loaded = 0;
|
||||
if (vmx->host_state.fs_reload_needed)
|
||||
loadsegment(fs, vmx->host_state.fs_sel);
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(&vmx->vcpu))
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
|
||||
#endif
|
||||
if (vmx->host_state.gs_ldt_reload_needed) {
|
||||
kvm_load_ldt(vmx->host_state.ldt_sel);
|
||||
#ifdef CONFIG_X86_64
|
||||
load_gs_index(vmx->host_state.gs_sel);
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
|
||||
#else
|
||||
loadsegment(gs, vmx->host_state.gs_sel);
|
||||
#endif
|
||||
}
|
||||
if (vmx->host_state.fs_reload_needed)
|
||||
loadsegment(fs, vmx->host_state.fs_sel);
|
||||
reload_tss();
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(&vmx->vcpu)) {
|
||||
rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
}
|
||||
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
|
||||
#endif
|
||||
if (current_thread_info()->status & TS_USEDFPU)
|
||||
clts();
|
||||
|
|
|
|||
|
|
@ -1994,9 +1994,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|||
0 /* Reserved, AES */ | F(XSAVE) | 0 /* OSXSAVE */ | F(AVX);
|
||||
/* cpuid 0x80000001.ecx */
|
||||
const u32 kvm_supported_word6_x86_features =
|
||||
F(LAHF_LM) | F(CMP_LEGACY) | F(SVM) | 0 /* ExtApicSpace */ |
|
||||
F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
|
||||
F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
|
||||
F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(SSE5) |
|
||||
F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(XOP) |
|
||||
0 /* SKINIT */ | 0 /* WDT */;
|
||||
|
||||
/* all calls to cpuid_count() should be made on the same cpu */
|
||||
|
|
@ -2305,6 +2305,7 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
|
|||
!kvm_exception_is_soft(vcpu->arch.exception.nr);
|
||||
events->exception.nr = vcpu->arch.exception.nr;
|
||||
events->exception.has_error_code = vcpu->arch.exception.has_error_code;
|
||||
events->exception.pad = 0;
|
||||
events->exception.error_code = vcpu->arch.exception.error_code;
|
||||
|
||||
events->interrupt.injected =
|
||||
|
|
@ -2318,12 +2319,14 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
|
|||
events->nmi.injected = vcpu->arch.nmi_injected;
|
||||
events->nmi.pending = vcpu->arch.nmi_pending;
|
||||
events->nmi.masked = kvm_x86_ops->get_nmi_mask(vcpu);
|
||||
events->nmi.pad = 0;
|
||||
|
||||
events->sipi_vector = vcpu->arch.sipi_vector;
|
||||
|
||||
events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING
|
||||
| KVM_VCPUEVENT_VALID_SIPI_VECTOR
|
||||
| KVM_VCPUEVENT_VALID_SHADOW);
|
||||
memset(&events->reserved, 0, sizeof(events->reserved));
|
||||
}
|
||||
|
||||
static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
|
||||
|
|
@ -2366,6 +2369,7 @@ static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu,
|
|||
dbgregs->dr6 = vcpu->arch.dr6;
|
||||
dbgregs->dr7 = vcpu->arch.dr7;
|
||||
dbgregs->flags = 0;
|
||||
memset(&dbgregs->reserved, 0, sizeof(dbgregs->reserved));
|
||||
}
|
||||
|
||||
static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
|
||||
|
|
@ -2849,6 +2853,7 @@ static int kvm_vm_ioctl_get_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)
|
|||
sizeof(ps->channels));
|
||||
ps->flags = kvm->arch.vpit->pit_state.flags;
|
||||
mutex_unlock(&kvm->arch.vpit->pit_state.lock);
|
||||
memset(&ps->reserved, 0, sizeof(ps->reserved));
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -2912,10 +2917,6 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
|
|||
struct kvm_memslots *slots, *old_slots;
|
||||
unsigned long *dirty_bitmap;
|
||||
|
||||
spin_lock(&kvm->mmu_lock);
|
||||
kvm_mmu_slot_remove_write_access(kvm, log->slot);
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
|
||||
r = -ENOMEM;
|
||||
dirty_bitmap = vmalloc(n);
|
||||
if (!dirty_bitmap)
|
||||
|
|
@ -2937,6 +2938,10 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
|
|||
dirty_bitmap = old_slots->memslots[log->slot].dirty_bitmap;
|
||||
kfree(old_slots);
|
||||
|
||||
spin_lock(&kvm->mmu_lock);
|
||||
kvm_mmu_slot_remove_write_access(kvm, log->slot);
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
|
||||
r = -EFAULT;
|
||||
if (copy_to_user(log->dirty_bitmap, dirty_bitmap, n)) {
|
||||
vfree(dirty_bitmap);
|
||||
|
|
@ -3229,6 +3234,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
|
|||
now_ns = timespec_to_ns(&now);
|
||||
user_ns.clock = kvm->arch.kvmclock_offset + now_ns;
|
||||
user_ns.flags = 0;
|
||||
memset(&user_ns.pad, 0, sizeof(user_ns.pad));
|
||||
|
||||
r = -EFAULT;
|
||||
if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
|
||||
|
|
|
|||
|
|
@ -1017,10 +1017,6 @@ static void xen_reboot(int reason)
|
|||
{
|
||||
struct sched_shutdown r = { .reason = reason };
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
smp_send_stop();
|
||||
#endif
|
||||
|
||||
if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))
|
||||
BUG();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -400,9 +400,9 @@ static void stop_self(void *v)
|
|||
BUG();
|
||||
}
|
||||
|
||||
static void xen_smp_send_stop(void)
|
||||
static void xen_stop_other_cpus(int wait)
|
||||
{
|
||||
smp_call_function(stop_self, NULL, 0);
|
||||
smp_call_function(stop_self, NULL, wait);
|
||||
}
|
||||
|
||||
static void xen_smp_send_reschedule(int cpu)
|
||||
|
|
@ -470,7 +470,7 @@ static const struct smp_ops xen_smp_ops __initdata = {
|
|||
.cpu_disable = xen_cpu_disable,
|
||||
.play_dead = xen_play_dead,
|
||||
|
||||
.smp_send_stop = xen_smp_send_stop,
|
||||
.stop_other_cpus = xen_stop_other_cpus,
|
||||
.smp_send_reschedule = xen_smp_send_reschedule,
|
||||
|
||||
.send_call_func_ipi = xen_smp_send_call_function_ipi,
|
||||
|
|
|
|||
|
|
@ -205,6 +205,8 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
|
|||
unaligned = 1;
|
||||
break;
|
||||
}
|
||||
if (!iov[i].iov_len)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (unaligned || (q->dma_pad_mask & len) || map_data)
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ EXPORT_SYMBOL(blk_queue_logical_block_size);
|
|||
* hardware can operate on without reverting to read-modify-write
|
||||
* operations.
|
||||
*/
|
||||
void blk_queue_physical_block_size(struct request_queue *q, unsigned short size)
|
||||
void blk_queue_physical_block_size(struct request_queue *q, unsigned int size)
|
||||
{
|
||||
q->limits.physical_block_size = size;
|
||||
|
||||
|
|
|
|||
|
|
@ -541,13 +541,15 @@ void add_disk(struct gendisk *disk)
|
|||
disk->major = MAJOR(devt);
|
||||
disk->first_minor = MINOR(devt);
|
||||
|
||||
/* Register BDI before referencing it from bdev */
|
||||
bdi = &disk->queue->backing_dev_info;
|
||||
bdi_register_dev(bdi, disk_devt(disk));
|
||||
|
||||
blk_register_region(disk_devt(disk), disk->minors, NULL,
|
||||
exact_match, exact_lock, disk);
|
||||
register_disk(disk);
|
||||
blk_register_queue(disk);
|
||||
|
||||
bdi = &disk->queue->backing_dev_info;
|
||||
bdi_register_dev(bdi, disk_devt(disk));
|
||||
retval = sysfs_create_link(&disk_to_dev(disk)->kobj, &bdi->dev->kobj,
|
||||
"bdi");
|
||||
WARN_ON(retval);
|
||||
|
|
|
|||
|
|
@ -321,33 +321,47 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
|
|||
if (hdr->iovec_count) {
|
||||
const int size = sizeof(struct sg_iovec) * hdr->iovec_count;
|
||||
size_t iov_data_len;
|
||||
struct sg_iovec *iov;
|
||||
struct sg_iovec *sg_iov;
|
||||
struct iovec *iov;
|
||||
int i;
|
||||
|
||||
iov = kmalloc(size, GFP_KERNEL);
|
||||
if (!iov) {
|
||||
sg_iov = kmalloc(size, GFP_KERNEL);
|
||||
if (!sg_iov) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (copy_from_user(iov, hdr->dxferp, size)) {
|
||||
kfree(iov);
|
||||
if (copy_from_user(sg_iov, hdr->dxferp, size)) {
|
||||
kfree(sg_iov);
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sum up the vecs, making sure they don't overflow
|
||||
*/
|
||||
iov = (struct iovec *) sg_iov;
|
||||
iov_data_len = 0;
|
||||
for (i = 0; i < hdr->iovec_count; i++) {
|
||||
if (iov_data_len + iov[i].iov_len < iov_data_len) {
|
||||
kfree(sg_iov);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
iov_data_len += iov[i].iov_len;
|
||||
}
|
||||
|
||||
/* SG_IO howto says that the shorter of the two wins */
|
||||
iov_data_len = iov_length((struct iovec *)iov,
|
||||
hdr->iovec_count);
|
||||
if (hdr->dxfer_len < iov_data_len) {
|
||||
hdr->iovec_count = iov_shorten((struct iovec *)iov,
|
||||
hdr->iovec_count = iov_shorten(iov,
|
||||
hdr->iovec_count,
|
||||
hdr->dxfer_len);
|
||||
iov_data_len = hdr->dxfer_len;
|
||||
}
|
||||
|
||||
ret = blk_rq_map_user_iov(q, rq, NULL, iov, hdr->iovec_count,
|
||||
ret = blk_rq_map_user_iov(q, rq, NULL, sg_iov, hdr->iovec_count,
|
||||
iov_data_len, GFP_KERNEL);
|
||||
kfree(iov);
|
||||
kfree(sg_iov);
|
||||
} else if (hdr->dxfer_len)
|
||||
ret = blk_rq_map_user(q, rq, NULL, hdr->dxferp, hdr->dxfer_len,
|
||||
GFP_KERNEL);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ enum {
|
|||
* due to bad math.
|
||||
*/
|
||||
ACPI_BATTERY_QUIRK_SIGNED16_CURRENT,
|
||||
ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY,
|
||||
};
|
||||
|
||||
struct acpi_battery {
|
||||
|
|
@ -412,6 +413,8 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
|
|||
result = extract_package(battery, buffer.pointer,
|
||||
info_offsets, ARRAY_SIZE(info_offsets));
|
||||
kfree(buffer.pointer);
|
||||
if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
|
||||
battery->full_charge_capacity = battery->design_capacity;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -448,6 +451,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
|
|||
battery->rate_now != -1)
|
||||
battery->rate_now = abs((s16)battery->rate_now);
|
||||
|
||||
if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
|
||||
&& battery->capacity_now >= 0 && battery->capacity_now <= 100)
|
||||
battery->capacity_now = (battery->capacity_now *
|
||||
battery->full_charge_capacity) / 100;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -561,6 +568,33 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* According to the ACPI spec, some kinds of primary batteries can
|
||||
* report percentage battery remaining capacity directly to OS.
|
||||
* In this case, it reports the Last Full Charged Capacity == 100
|
||||
* and BatteryPresentRate == 0xFFFFFFFF.
|
||||
*
|
||||
* Now we found some battery reports percentage remaining capacity
|
||||
* even if it's rechargeable.
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=15979
|
||||
*
|
||||
* Handle this correctly so that they won't break userspace.
|
||||
*/
|
||||
static void acpi_battery_quirks2(struct acpi_battery *battery)
|
||||
{
|
||||
if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
|
||||
return ;
|
||||
|
||||
if (battery->full_charge_capacity == 100 &&
|
||||
battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN &&
|
||||
battery->capacity_now >=0 && battery->capacity_now <= 100) {
|
||||
set_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags);
|
||||
battery->full_charge_capacity = battery->design_capacity;
|
||||
battery->capacity_now = (battery->capacity_now *
|
||||
battery->full_charge_capacity) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
static int acpi_battery_update(struct acpi_battery *battery)
|
||||
{
|
||||
int result, old_present = acpi_battery_present(battery);
|
||||
|
|
@ -586,7 +620,9 @@ static int acpi_battery_update(struct acpi_battery *battery)
|
|||
if (!battery->bat.dev)
|
||||
sysfs_add_battery(battery);
|
||||
#endif
|
||||
return acpi_battery_get_state(battery);
|
||||
result = acpi_battery_get_state(battery);
|
||||
acpi_battery_quirks2(battery);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -935,6 +935,12 @@ static int __init acpi_bus_init(void)
|
|||
goto error1;
|
||||
}
|
||||
|
||||
/*
|
||||
* _PDC control method may load dynamic SSDT tables,
|
||||
* and we need to install the table handler before that.
|
||||
*/
|
||||
acpi_sysfs_init();
|
||||
|
||||
acpi_early_processor_set_pdc();
|
||||
|
||||
/*
|
||||
|
|
@ -1026,7 +1032,6 @@ static int __init acpi_init(void)
|
|||
acpi_scan_init();
|
||||
acpi_ec_init();
|
||||
acpi_power_init();
|
||||
acpi_sysfs_init();
|
||||
acpi_debugfs_init();
|
||||
acpi_sleep_proc_init();
|
||||
acpi_wakeup_device_init();
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ int __init acpi_debugfs_init(void)
|
|||
if (!acpi_dir)
|
||||
goto err;
|
||||
|
||||
cm_dentry = debugfs_create_file("custom_method", S_IWUGO,
|
||||
cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
|
||||
acpi_dir, NULL, &cm_fops);
|
||||
if (!cm_dentry)
|
||||
goto err;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ enum {
|
|||
AHCI_CMD_RESET = (1 << 8),
|
||||
AHCI_CMD_CLR_BUSY = (1 << 10),
|
||||
|
||||
RX_FIS_PIO_SETUP = 0x20, /* offset of PIO Setup FIS data */
|
||||
RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */
|
||||
RX_FIS_SDB = 0x58, /* offset of SDB FIS data */
|
||||
RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */
|
||||
|
|
|
|||
|
|
@ -1830,12 +1830,24 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
|
|||
static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
|
||||
{
|
||||
struct ahci_port_priv *pp = qc->ap->private_data;
|
||||
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
|
||||
u8 *rx_fis = pp->rx_fis;
|
||||
|
||||
if (pp->fbs_enabled)
|
||||
d2h_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ;
|
||||
rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ;
|
||||
|
||||
/*
|
||||
* After a successful execution of an ATA PIO data-in command,
|
||||
* the device doesn't send D2H Reg FIS to update the TF and
|
||||
* the host should take TF and E_Status from the preceding PIO
|
||||
* Setup FIS.
|
||||
*/
|
||||
if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE &&
|
||||
!(qc->flags & ATA_QCFLAG_FAILED)) {
|
||||
ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf);
|
||||
qc->result_tf.command = (rx_fis + RX_FIS_PIO_SETUP)[15];
|
||||
} else
|
||||
ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf);
|
||||
|
||||
ata_tf_from_fis(d2h_fis, &qc->result_tf);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2577,8 +2577,11 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
|
|||
*
|
||||
* If door lock fails, always clear sdev->locked to
|
||||
* avoid this infinite loop.
|
||||
*
|
||||
* This may happen before SCSI scan is complete. Make
|
||||
* sure qc->dev->sdev isn't NULL before dereferencing.
|
||||
*/
|
||||
if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL)
|
||||
if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev)
|
||||
qc->dev->sdev->locked = 0;
|
||||
|
||||
qc->scsicmd->result = SAM_STAT_CHECK_CONDITION;
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void svia_configure(struct pci_dev *pdev)
|
||||
static void svia_configure(struct pci_dev *pdev, int board_id)
|
||||
{
|
||||
u8 tmp8;
|
||||
|
||||
|
|
@ -577,7 +577,7 @@ static void svia_configure(struct pci_dev *pdev)
|
|||
}
|
||||
|
||||
/*
|
||||
* vt6421 has problems talking to some drives. The following
|
||||
* vt6420/1 has problems talking to some drives. The following
|
||||
* is the fix from Joseph Chan <JosephChan@via.com.tw>.
|
||||
*
|
||||
* When host issues HOLD, device may send up to 20DW of data
|
||||
|
|
@ -596,8 +596,9 @@ static void svia_configure(struct pci_dev *pdev)
|
|||
*
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=15173
|
||||
* http://article.gmane.org/gmane.linux.ide/46352
|
||||
* http://thread.gmane.org/gmane.linux.kernel/1062139
|
||||
*/
|
||||
if (pdev->device == 0x3249) {
|
||||
if (board_id == vt6420 || board_id == vt6421) {
|
||||
pci_read_config_byte(pdev, 0x52, &tmp8);
|
||||
tmp8 |= 1 << 2;
|
||||
pci_write_config_byte(pdev, 0x52, tmp8);
|
||||
|
|
@ -652,7 +653,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
svia_configure(pdev);
|
||||
svia_configure(pdev, board_id);
|
||||
|
||||
pci_set_master(pdev);
|
||||
return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
|
||||
|
|
|
|||
|
|
@ -256,9 +256,16 @@ static int hci_uart_tty_open(struct tty_struct *tty)
|
|||
|
||||
BT_DBG("tty %p", tty);
|
||||
|
||||
/* FIXME: This btw is bogus, nothing requires the old ldisc to clear
|
||||
the pointer */
|
||||
if (hu)
|
||||
return -EEXIST;
|
||||
|
||||
/* Error if the tty has no write op instead of leaving an exploitable
|
||||
hole */
|
||||
if (tty->ops->write == NULL)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
|
||||
BT_ERR("Can't allocate control structure");
|
||||
return -ENFILE;
|
||||
|
|
|
|||
|
|
@ -1049,6 +1049,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
|
|||
ID(PCI_DEVICE_ID_INTEL_G45_HB),
|
||||
ID(PCI_DEVICE_ID_INTEL_G41_HB),
|
||||
ID(PCI_DEVICE_ID_INTEL_B43_HB),
|
||||
ID(PCI_DEVICE_ID_INTEL_B43_1_HB),
|
||||
ID(PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB),
|
||||
ID(PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB),
|
||||
ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB),
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ static void intel_i830_init_gtt_entries(void)
|
|||
|
||||
pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl);
|
||||
|
||||
if (IS_I965) {
|
||||
if (IS_G33 || IS_I965) {
|
||||
u32 pgetbl_ctl;
|
||||
pgetbl_ctl = readl(intel_private.registers+I810_PGETBL_CTL);
|
||||
|
||||
|
|
@ -567,22 +567,6 @@ static void intel_i830_init_gtt_entries(void)
|
|||
size = 512;
|
||||
}
|
||||
size += 4; /* add in BIOS popup space */
|
||||
} else if (IS_G33 && !IS_PINEVIEW) {
|
||||
/* G33's GTT size defined in gmch_ctrl */
|
||||
switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
|
||||
case G33_PGETBL_SIZE_1M:
|
||||
size = 1024;
|
||||
break;
|
||||
case G33_PGETBL_SIZE_2M:
|
||||
size = 2048;
|
||||
break;
|
||||
default:
|
||||
dev_info(&agp_bridge->dev->dev,
|
||||
"unknown page table size 0x%x, assuming 512KB\n",
|
||||
(gmch_ctrl & G33_PGETBL_SIZE_MASK));
|
||||
size = 512;
|
||||
}
|
||||
size += 4;
|
||||
} else if (IS_G4X || IS_PINEVIEW) {
|
||||
/* On 4 series hardware, GTT stolen is separate from graphics
|
||||
* stolen, ignore it in stolen gtt entries counting. However,
|
||||
|
|
@ -1257,24 +1241,31 @@ static int intel_i915_get_gtt_size(void)
|
|||
int size;
|
||||
|
||||
if (IS_G33) {
|
||||
u16 gmch_ctrl;
|
||||
u32 pgetbl_ctl;
|
||||
pgetbl_ctl = readl(intel_private.registers+I810_PGETBL_CTL);
|
||||
|
||||
/* G33's GTT size defined in gmch_ctrl */
|
||||
pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl);
|
||||
switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
|
||||
case I830_GMCH_GMS_STOLEN_512:
|
||||
switch (pgetbl_ctl & I965_PGETBL_SIZE_MASK) {
|
||||
case I965_PGETBL_SIZE_128KB:
|
||||
size = 128;
|
||||
break;
|
||||
case I965_PGETBL_SIZE_256KB:
|
||||
size = 256;
|
||||
break;
|
||||
case I965_PGETBL_SIZE_512KB:
|
||||
size = 512;
|
||||
break;
|
||||
case I830_GMCH_GMS_STOLEN_1024:
|
||||
case I965_PGETBL_SIZE_1MB:
|
||||
size = 1024;
|
||||
break;
|
||||
case I830_GMCH_GMS_STOLEN_8192:
|
||||
size = 8*1024;
|
||||
case I965_PGETBL_SIZE_2MB:
|
||||
size = 2048;
|
||||
break;
|
||||
case I965_PGETBL_SIZE_1_5MB:
|
||||
size = 1024 + 512;
|
||||
break;
|
||||
default:
|
||||
dev_info(&agp_bridge->dev->dev,
|
||||
"unknown page table size 0x%x, assuming 512KB\n",
|
||||
(gmch_ctrl & I830_GMCH_GMS_MASK));
|
||||
dev_info(&intel_private.pcidev->dev,
|
||||
"unknown page table size, assuming 512KB\n");
|
||||
size = 512;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1306,14 +1297,6 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
|
|||
pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp);
|
||||
pci_read_config_dword(intel_private.pcidev, I915_PTEADDR, &temp2);
|
||||
|
||||
gtt_map_size = intel_i915_get_gtt_size();
|
||||
|
||||
intel_private.gtt = ioremap(temp2, gtt_map_size);
|
||||
if (!intel_private.gtt)
|
||||
return -ENOMEM;
|
||||
|
||||
intel_private.gtt_total_size = gtt_map_size / 4;
|
||||
|
||||
temp &= 0xfff80000;
|
||||
|
||||
intel_private.registers = ioremap(temp, 128 * 4096);
|
||||
|
|
@ -1322,6 +1305,14 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
gtt_map_size = intel_i915_get_gtt_size();
|
||||
|
||||
intel_private.gtt = ioremap(temp2, gtt_map_size);
|
||||
if (!intel_private.gtt)
|
||||
return -ENOMEM;
|
||||
|
||||
intel_private.gtt_total_size = gtt_map_size / 4;
|
||||
|
||||
temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000;
|
||||
global_cache_flush(); /* FIXME: ? */
|
||||
|
||||
|
|
|
|||
|
|
@ -479,6 +479,21 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp)
|
|||
if (irq) {
|
||||
unsigned long irq_flags;
|
||||
|
||||
if (devp->hd_flags & HPET_SHARED_IRQ) {
|
||||
/*
|
||||
* To prevent the interrupt handler from seeing an
|
||||
* unwanted interrupt status bit, program the timer
|
||||
* so that it will not fire in the near future ...
|
||||
*/
|
||||
writel(readl(&timer->hpet_config) & ~Tn_TYPE_CNF_MASK,
|
||||
&timer->hpet_config);
|
||||
write_counter(read_counter(&hpet->hpet_mc),
|
||||
&timer->hpet_compare);
|
||||
/* ... and clear any left-over status. */
|
||||
isr = 1 << (devp - devp->hd_hpets->hp_dev);
|
||||
writel(isr, &hpet->hpet_isr);
|
||||
}
|
||||
|
||||
sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev));
|
||||
irq_flags = devp->hd_flags & HPET_SHARED_IRQ
|
||||
? IRQF_SHARED : IRQF_DISABLED;
|
||||
|
|
@ -970,6 +985,8 @@ static int hpet_acpi_add(struct acpi_device *device)
|
|||
return -ENODEV;
|
||||
|
||||
if (!data.hd_address || !data.hd_nirqs) {
|
||||
if (data.hd_address)
|
||||
iounmap(data.hd_address);
|
||||
printk("%s: no address or irqs in _CRS\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1665,6 +1665,17 @@ static int check_hotmod_int_op(const char *curr, const char *option,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct smi_info *smi_info_alloc(void)
|
||||
{
|
||||
struct smi_info *info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
|
||||
if (info) {
|
||||
spin_lock_init(&info->si_lock);
|
||||
spin_lock_init(&info->msg_lock);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
static int hotmod_handler(const char *val, struct kernel_param *kp)
|
||||
{
|
||||
char *str = kstrdup(val, GFP_KERNEL);
|
||||
|
|
@ -1779,7 +1790,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
|
|||
}
|
||||
|
||||
if (op == HM_ADD) {
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info) {
|
||||
rv = -ENOMEM;
|
||||
goto out;
|
||||
|
|
@ -1844,7 +1855,7 @@ static __devinit void hardcode_find_bmc(void)
|
|||
if (!ports[i] && !addrs[i])
|
||||
continue;
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
|
|
@ -2028,7 +2039,7 @@ static __devinit int try_init_spmi(struct SPMITable *spmi)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info) {
|
||||
printk(KERN_ERR PFX "Could not allocate SI data (3)\n");
|
||||
return -ENOMEM;
|
||||
|
|
@ -2138,7 +2149,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev,
|
|||
if (!acpi_dev)
|
||||
return -ENODEV;
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -2319,7 +2330,7 @@ static __devinit void try_init_dmi(struct dmi_ipmi_data *ipmi_data)
|
|||
{
|
||||
struct smi_info *info;
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info) {
|
||||
printk(KERN_ERR PFX "Could not allocate SI data\n");
|
||||
return;
|
||||
|
|
@ -2426,7 +2437,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
|
|||
int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
|
||||
struct smi_info *info;
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -2567,7 +2578,7 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
|
||||
if (!info) {
|
||||
dev_err(&dev->dev,
|
||||
|
|
@ -3014,7 +3025,7 @@ static __devinit void default_find_bmc(void)
|
|||
if (check_legacy_ioport(ipmi_defaults[i].port))
|
||||
continue;
|
||||
#endif
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = smi_info_alloc();
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
|
|
@ -3139,9 +3150,6 @@ static int try_smi_init(struct smi_info *new_smi)
|
|||
goto out_err;
|
||||
}
|
||||
|
||||
spin_lock_init(&(new_smi->si_lock));
|
||||
spin_lock_init(&(new_smi->msg_lock));
|
||||
|
||||
/* Do low-level detection first. */
|
||||
if (new_smi->handlers->detect(new_smi->si_sm)) {
|
||||
if (new_smi->addr_source)
|
||||
|
|
|
|||
|
|
@ -4127,6 +4127,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
|||
if (cmd != SIOCWANDEV)
|
||||
return hdlc_ioctl(dev, ifr, cmd);
|
||||
|
||||
memset(&new_line, 0, size);
|
||||
|
||||
switch(ifr->ifr_settings.type) {
|
||||
case IF_GET_IFACE: /* return current sync_serial_settings */
|
||||
|
||||
|
|
|
|||
|
|
@ -413,7 +413,8 @@ static void flush_to_ldisc(struct work_struct *work)
|
|||
spin_lock_irqsave(&tty->buf.lock, flags);
|
||||
|
||||
if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) {
|
||||
struct tty_buffer *head;
|
||||
struct tty_buffer *head, *tail = tty->buf.tail;
|
||||
int seen_tail = 0;
|
||||
while ((head = tty->buf.head) != NULL) {
|
||||
int count;
|
||||
char *char_buf;
|
||||
|
|
@ -423,6 +424,15 @@ static void flush_to_ldisc(struct work_struct *work)
|
|||
if (!count) {
|
||||
if (head->next == NULL)
|
||||
break;
|
||||
/*
|
||||
There's a possibility tty might get new buffer
|
||||
added during the unlock window below. We could
|
||||
end up spinning in here forever hogging the CPU
|
||||
completely. To avoid this let's have a rest each
|
||||
time we processed the tail buffer.
|
||||
*/
|
||||
if (tail == head)
|
||||
seen_tail = 1;
|
||||
tty->buf.head = head->next;
|
||||
tty_buffer_free(tty, head);
|
||||
continue;
|
||||
|
|
@ -432,7 +442,7 @@ static void flush_to_ldisc(struct work_struct *work)
|
|||
line discipline as we want to empty the queue */
|
||||
if (test_bit(TTY_FLUSHPENDING, &tty->flags))
|
||||
break;
|
||||
if (!tty->receive_room) {
|
||||
if (!tty->receive_room || seen_tail) {
|
||||
schedule_delayed_work(&tty->buf.work, 1);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -553,6 +553,9 @@ void __tty_hangup(struct tty_struct *tty)
|
|||
|
||||
tty_lock();
|
||||
|
||||
/* some functions below drop BTM, so we need this bit */
|
||||
set_bit(TTY_HUPPING, &tty->flags);
|
||||
|
||||
/* inuse_filps is protected by the single tty lock,
|
||||
this really needs to change if we want to flush the
|
||||
workqueue with the lock held */
|
||||
|
|
@ -572,6 +575,10 @@ void __tty_hangup(struct tty_struct *tty)
|
|||
}
|
||||
spin_unlock(&tty_files_lock);
|
||||
|
||||
/*
|
||||
* it drops BTM and thus races with reopen
|
||||
* we protect the race by TTY_HUPPING
|
||||
*/
|
||||
tty_ldisc_hangup(tty);
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
|
|
@ -609,7 +616,6 @@ void __tty_hangup(struct tty_struct *tty)
|
|||
tty->session = NULL;
|
||||
tty->pgrp = NULL;
|
||||
tty->ctrl_status = 0;
|
||||
set_bit(TTY_HUPPED, &tty->flags);
|
||||
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
|
||||
|
||||
/* Account for the p->signal references we killed */
|
||||
|
|
@ -635,6 +641,7 @@ void __tty_hangup(struct tty_struct *tty)
|
|||
* can't yet guarantee all that.
|
||||
*/
|
||||
set_bit(TTY_HUPPED, &tty->flags);
|
||||
clear_bit(TTY_HUPPING, &tty->flags);
|
||||
tty_ldisc_enable(tty);
|
||||
|
||||
tty_unlock();
|
||||
|
|
@ -1304,7 +1311,9 @@ static int tty_reopen(struct tty_struct *tty)
|
|||
{
|
||||
struct tty_driver *driver = tty->driver;
|
||||
|
||||
if (test_bit(TTY_CLOSING, &tty->flags))
|
||||
if (test_bit(TTY_CLOSING, &tty->flags) ||
|
||||
test_bit(TTY_HUPPING, &tty->flags) ||
|
||||
test_bit(TTY_LDISC_CHANGING, &tty->flags))
|
||||
return -EIO;
|
||||
|
||||
if (driver->type == TTY_DRIVER_TYPE_PTY &&
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
static DEFINE_SPINLOCK(tty_ldisc_lock);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_idle);
|
||||
/* Line disc dispatch table */
|
||||
static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS];
|
||||
|
||||
|
|
@ -83,6 +84,7 @@ static void put_ldisc(struct tty_ldisc *ld)
|
|||
return;
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
wake_up(&tty_ldisc_idle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -452,6 +454,8 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld)
|
|||
/* BTM here locks versus a hangup event */
|
||||
WARN_ON(!tty_locked());
|
||||
ret = ld->ops->open(tty);
|
||||
if (ret)
|
||||
clear_bit(TTY_LDISC_OPEN, &tty->flags);
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -530,6 +534,23 @@ static int tty_ldisc_halt(struct tty_struct *tty)
|
|||
return cancel_delayed_work_sync(&tty->buf.work);
|
||||
}
|
||||
|
||||
/**
|
||||
* tty_ldisc_wait_idle - wait for the ldisc to become idle
|
||||
* @tty: tty to wait for
|
||||
*
|
||||
* Wait for the line discipline to become idle. The discipline must
|
||||
* have been halted for this to guarantee it remains idle.
|
||||
*/
|
||||
static int tty_ldisc_wait_idle(struct tty_struct *tty)
|
||||
{
|
||||
int ret;
|
||||
ret = wait_event_interruptible_timeout(tty_ldisc_idle,
|
||||
atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return ret > 0 ? 0 : -EBUSY;
|
||||
}
|
||||
|
||||
/**
|
||||
* tty_set_ldisc - set line discipline
|
||||
* @tty: the terminal to set
|
||||
|
|
@ -634,8 +655,17 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
|
|||
|
||||
flush_scheduled_work();
|
||||
|
||||
retval = tty_ldisc_wait_idle(tty);
|
||||
|
||||
tty_lock();
|
||||
mutex_lock(&tty->ldisc_mutex);
|
||||
|
||||
/* handle wait idle failure locked */
|
||||
if (retval) {
|
||||
tty_ldisc_put(new_ldisc);
|
||||
goto enable;
|
||||
}
|
||||
|
||||
if (test_bit(TTY_HUPPED, &tty->flags)) {
|
||||
/* We were raced by the hangup method. It will have stomped
|
||||
the ldisc data and closed the ldisc down */
|
||||
|
|
@ -669,6 +699,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
|
|||
|
||||
tty_ldisc_put(o_ldisc);
|
||||
|
||||
enable:
|
||||
/*
|
||||
* Allow ldisc referencing to occur again
|
||||
*/
|
||||
|
|
@ -714,9 +745,12 @@ static void tty_reset_termios(struct tty_struct *tty)
|
|||
* state closed
|
||||
*/
|
||||
|
||||
static void tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
|
||||
static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
|
||||
{
|
||||
struct tty_ldisc *ld;
|
||||
struct tty_ldisc *ld = tty_ldisc_get(ldisc);
|
||||
|
||||
if (IS_ERR(ld))
|
||||
return -1;
|
||||
|
||||
tty_ldisc_close(tty, tty->ldisc);
|
||||
tty_ldisc_put(tty->ldisc);
|
||||
|
|
@ -724,10 +758,10 @@ static void tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
|
|||
/*
|
||||
* Switch the line discipline back
|
||||
*/
|
||||
ld = tty_ldisc_get(ldisc);
|
||||
BUG_ON(IS_ERR(ld));
|
||||
tty_ldisc_assign(tty, ld);
|
||||
tty_set_termios_ldisc(tty, ldisc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -802,13 +836,16 @@ void tty_ldisc_hangup(struct tty_struct *tty)
|
|||
a FIXME */
|
||||
if (tty->ldisc) { /* Not yet closed */
|
||||
if (reset == 0) {
|
||||
tty_ldisc_reinit(tty, tty->termios->c_line);
|
||||
err = tty_ldisc_open(tty, tty->ldisc);
|
||||
|
||||
if (!tty_ldisc_reinit(tty, tty->termios->c_line))
|
||||
err = tty_ldisc_open(tty, tty->ldisc);
|
||||
else
|
||||
err = 1;
|
||||
}
|
||||
/* If the re-open fails or we reset then go to N_TTY. The
|
||||
N_TTY open cannot fail */
|
||||
if (reset || err) {
|
||||
tty_ldisc_reinit(tty, N_TTY);
|
||||
BUG_ON(tty_ldisc_reinit(tty, N_TTY));
|
||||
WARN_ON(tty_ldisc_open(tty, tty->ldisc));
|
||||
}
|
||||
tty_ldisc_enable(tty);
|
||||
|
|
|
|||
|
|
@ -503,6 +503,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
|
|||
struct kbd_struct * kbd;
|
||||
unsigned int console;
|
||||
unsigned char ucval;
|
||||
unsigned int uival;
|
||||
void __user *up = (void __user *)arg;
|
||||
int i, perm;
|
||||
int ret = 0;
|
||||
|
|
@ -657,7 +658,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
|
|||
break;
|
||||
|
||||
case KDGETMODE:
|
||||
ucval = vc->vc_mode;
|
||||
uival = vc->vc_mode;
|
||||
goto setint;
|
||||
|
||||
case KDMAPDISP:
|
||||
|
|
@ -695,7 +696,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
|
|||
break;
|
||||
|
||||
case KDGKBMODE:
|
||||
ucval = ((kbd->kbdmode == VC_RAW) ? K_RAW :
|
||||
uival = ((kbd->kbdmode == VC_RAW) ? K_RAW :
|
||||
(kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW :
|
||||
(kbd->kbdmode == VC_UNICODE) ? K_UNICODE :
|
||||
K_XLATE);
|
||||
|
|
@ -717,9 +718,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
|
|||
break;
|
||||
|
||||
case KDGKBMETA:
|
||||
ucval = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT);
|
||||
uival = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT);
|
||||
setint:
|
||||
ret = put_user(ucval, (int __user *)arg);
|
||||
ret = put_user(uival, (int __user *)arg);
|
||||
break;
|
||||
|
||||
case KDGETKEYCODE:
|
||||
|
|
@ -949,7 +950,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
|
|||
for (i = 0; i < MAX_NR_CONSOLES; ++i)
|
||||
if (! VT_IS_IN_USE(i))
|
||||
break;
|
||||
ucval = i < MAX_NR_CONSOLES ? (i+1) : -1;
|
||||
uival = i < MAX_NR_CONSOLES ? (i+1) : -1;
|
||||
goto setint;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key,
|
|||
if (initial)
|
||||
asm volatile (".byte 0xf3,0x0f,0xa7,0xd0" /* rep xcryptcbc */
|
||||
: "+S" (input), "+D" (output), "+a" (iv)
|
||||
: "d" (control_word), "b" (key), "c" (count));
|
||||
: "d" (control_word), "b" (key), "c" (initial));
|
||||
|
||||
asm volatile (".byte 0xf3,0x0f,0xa7,0xd0" /* rep xcryptcbc */
|
||||
: "+S" (input), "+D" (output), "+a" (iv)
|
||||
|
|
|
|||
|
|
@ -739,7 +739,7 @@ static void ar_context_tasklet(unsigned long data)
|
|||
d = &ab->descriptor;
|
||||
|
||||
if (d->res_count == 0) {
|
||||
size_t size, rest, offset;
|
||||
size_t size, size2, rest, pktsize, size3, offset;
|
||||
dma_addr_t start_bus;
|
||||
void *start;
|
||||
|
||||
|
|
@ -750,25 +750,61 @@ static void ar_context_tasklet(unsigned long data)
|
|||
*/
|
||||
|
||||
offset = offsetof(struct ar_buffer, data);
|
||||
start = buffer = ab;
|
||||
start = ab;
|
||||
start_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
|
||||
buffer = ab->data;
|
||||
|
||||
ab = ab->next;
|
||||
d = &ab->descriptor;
|
||||
size = buffer + PAGE_SIZE - ctx->pointer;
|
||||
size = start + PAGE_SIZE - ctx->pointer;
|
||||
/* valid buffer data in the next page */
|
||||
rest = le16_to_cpu(d->req_count) - le16_to_cpu(d->res_count);
|
||||
/* what actually fits in this page */
|
||||
size2 = min(rest, (size_t)PAGE_SIZE - offset - size);
|
||||
memmove(buffer, ctx->pointer, size);
|
||||
memcpy(buffer + size, ab->data, rest);
|
||||
ctx->current_buffer = ab;
|
||||
ctx->pointer = (void *) ab->data + rest;
|
||||
end = buffer + size + rest;
|
||||
memcpy(buffer + size, ab->data, size2);
|
||||
|
||||
while (buffer < end)
|
||||
buffer = handle_ar_packet(ctx, buffer);
|
||||
while (size > 0) {
|
||||
void *next = handle_ar_packet(ctx, buffer);
|
||||
pktsize = next - buffer;
|
||||
if (pktsize >= size) {
|
||||
/*
|
||||
* We have handled all the data that was
|
||||
* originally in this page, so we can now
|
||||
* continue in the next page.
|
||||
*/
|
||||
buffer = next;
|
||||
break;
|
||||
}
|
||||
/* move the next packet to the start of the buffer */
|
||||
memmove(buffer, next, size + size2 - pktsize);
|
||||
size -= pktsize;
|
||||
/* fill up this page again */
|
||||
size3 = min(rest - size2,
|
||||
(size_t)PAGE_SIZE - offset - size - size2);
|
||||
memcpy(buffer + size + size2,
|
||||
(void *) ab->data + size2, size3);
|
||||
size2 += size3;
|
||||
}
|
||||
|
||||
dma_free_coherent(ohci->card.device, PAGE_SIZE,
|
||||
start, start_bus);
|
||||
ar_context_add_page(ctx);
|
||||
if (rest > 0) {
|
||||
/* handle the packets that are fully in the next page */
|
||||
buffer = (void *) ab->data +
|
||||
(buffer - (start + offset + size));
|
||||
end = (void *) ab->data + rest;
|
||||
|
||||
while (buffer < end)
|
||||
buffer = handle_ar_packet(ctx, buffer);
|
||||
|
||||
ctx->current_buffer = ab;
|
||||
ctx->pointer = end;
|
||||
|
||||
dma_free_coherent(ohci->card.device, PAGE_SIZE,
|
||||
start, start_bus);
|
||||
ar_context_add_page(ctx);
|
||||
} else {
|
||||
ctx->pointer = start + PAGE_SIZE;
|
||||
}
|
||||
} else {
|
||||
buffer = ctx->pointer;
|
||||
ctx->pointer = end =
|
||||
|
|
|
|||
|
|
@ -56,6 +56,18 @@ static struct cs5535_gpio_chip {
|
|||
* registers, see include/linux/cs5535.h.
|
||||
*/
|
||||
|
||||
static void errata_outl(u32 val, unsigned long addr)
|
||||
{
|
||||
/*
|
||||
* According to the CS5536 errata (#36), after suspend
|
||||
* a write to the high bank GPIO register will clear all
|
||||
* non-selected bits; the recommended workaround is a
|
||||
* read-modify-write operation.
|
||||
*/
|
||||
val |= inl(addr);
|
||||
outl(val, addr);
|
||||
}
|
||||
|
||||
static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset,
|
||||
unsigned int reg)
|
||||
{
|
||||
|
|
@ -64,7 +76,7 @@ static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset,
|
|||
outl(1 << offset, chip->base + reg);
|
||||
else
|
||||
/* high bank register */
|
||||
outl(1 << (offset - 16), chip->base + 0x80 + reg);
|
||||
errata_outl(1 << (offset - 16), chip->base + 0x80 + reg);
|
||||
}
|
||||
|
||||
void cs5535_gpio_set(unsigned offset, unsigned int reg)
|
||||
|
|
@ -86,7 +98,7 @@ static void __cs5535_gpio_clear(struct cs5535_gpio_chip *chip, unsigned offset,
|
|||
outl(1 << (offset + 16), chip->base + reg);
|
||||
else
|
||||
/* high bank register */
|
||||
outl(1 << offset, chip->base + 0x80 + reg);
|
||||
errata_outl(1 << offset, chip->base + 0x80 + reg);
|
||||
}
|
||||
|
||||
void cs5535_gpio_clear(unsigned offset, unsigned int reg)
|
||||
|
|
|
|||
|
|
@ -2306,6 +2306,9 @@ int i915_driver_unload(struct drm_device *dev)
|
|||
i915_gem_lastclose(dev);
|
||||
|
||||
intel_cleanup_overlay(dev);
|
||||
|
||||
if (!I915_NEED_GFX_HWS(dev))
|
||||
i915_free_hws(dev);
|
||||
}
|
||||
|
||||
intel_teardown_mchbar(dev);
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev)
|
|||
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
|
||||
int ret = IRQ_NONE;
|
||||
u32 de_iir, gt_iir, de_ier, pch_iir;
|
||||
u32 hotplug_mask;
|
||||
struct drm_i915_master_private *master_priv;
|
||||
struct intel_ring_buffer *render_ring = &dev_priv->render_ring;
|
||||
|
||||
|
|
@ -325,6 +326,11 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev)
|
|||
if (de_iir == 0 && gt_iir == 0 && pch_iir == 0)
|
||||
goto done;
|
||||
|
||||
if (HAS_PCH_CPT(dev))
|
||||
hotplug_mask = SDE_HOTPLUG_MASK_CPT;
|
||||
else
|
||||
hotplug_mask = SDE_HOTPLUG_MASK;
|
||||
|
||||
ret = IRQ_HANDLED;
|
||||
|
||||
if (dev->primary->master) {
|
||||
|
|
@ -366,10 +372,8 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev)
|
|||
drm_handle_vblank(dev, 1);
|
||||
|
||||
/* check event from PCH */
|
||||
if ((de_iir & DE_PCH_EVENT) &&
|
||||
(pch_iir & SDE_HOTPLUG_MASK)) {
|
||||
if ((de_iir & DE_PCH_EVENT) && (pch_iir & hotplug_mask))
|
||||
queue_work(dev_priv->wq, &dev_priv->hotplug_work);
|
||||
}
|
||||
|
||||
if (de_iir & DE_PCU_EVENT) {
|
||||
I915_WRITE16(MEMINTRSTS, I915_READ(MEMINTRSTS));
|
||||
|
|
@ -1424,8 +1428,7 @@ static int ironlake_irq_postinstall(struct drm_device *dev)
|
|||
u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT |
|
||||
DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE;
|
||||
u32 render_mask = GT_PIPE_NOTIFY | GT_BSD_USER_INTERRUPT;
|
||||
u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG |
|
||||
SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG;
|
||||
u32 hotplug_mask;
|
||||
|
||||
dev_priv->irq_mask_reg = ~display_mask;
|
||||
dev_priv->de_irq_enable_reg = display_mask | DE_PIPEA_VBLANK | DE_PIPEB_VBLANK;
|
||||
|
|
@ -1450,6 +1453,14 @@ static int ironlake_irq_postinstall(struct drm_device *dev)
|
|||
I915_WRITE(GTIER, dev_priv->gt_irq_enable_reg);
|
||||
(void) I915_READ(GTIER);
|
||||
|
||||
if (HAS_PCH_CPT(dev)) {
|
||||
hotplug_mask = SDE_CRT_HOTPLUG_CPT | SDE_PORTB_HOTPLUG_CPT |
|
||||
SDE_PORTC_HOTPLUG_CPT | SDE_PORTD_HOTPLUG_CPT ;
|
||||
} else {
|
||||
hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG |
|
||||
SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG;
|
||||
}
|
||||
|
||||
dev_priv->pch_irq_mask_reg = ~hotplug_mask;
|
||||
dev_priv->pch_irq_enable_reg = hotplug_mask;
|
||||
|
||||
|
|
|
|||
|
|
@ -2551,6 +2551,10 @@
|
|||
#define SDE_PORTD_HOTPLUG_CPT (1 << 23)
|
||||
#define SDE_PORTC_HOTPLUG_CPT (1 << 22)
|
||||
#define SDE_PORTB_HOTPLUG_CPT (1 << 21)
|
||||
#define SDE_HOTPLUG_MASK_CPT (SDE_CRT_HOTPLUG_CPT | \
|
||||
SDE_PORTD_HOTPLUG_CPT | \
|
||||
SDE_PORTC_HOTPLUG_CPT | \
|
||||
SDE_PORTB_HOTPLUG_CPT)
|
||||
|
||||
#define SDEISR 0xc4000
|
||||
#define SDEIMR 0xc4004
|
||||
|
|
@ -2722,6 +2726,9 @@
|
|||
#define FDI_RXB_CHICKEN 0xc2010
|
||||
#define FDI_RX_PHASE_SYNC_POINTER_ENABLE (1)
|
||||
|
||||
#define SOUTH_DSPCLK_GATE_D 0xc2020
|
||||
#define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
|
||||
|
||||
/* CPU: FDI_TX */
|
||||
#define FDI_TXA_CTL 0x60100
|
||||
#define FDI_TXB_CTL 0x61100
|
||||
|
|
|
|||
|
|
@ -862,8 +862,10 @@ int i915_restore_state(struct drm_device *dev)
|
|||
/* Clock gating state */
|
||||
intel_init_clock_gating(dev);
|
||||
|
||||
if (HAS_PCH_SPLIT(dev))
|
||||
if (HAS_PCH_SPLIT(dev)) {
|
||||
ironlake_enable_drps(dev);
|
||||
intel_init_emon(dev);
|
||||
}
|
||||
|
||||
/* Cache mode state */
|
||||
I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,8 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
|
|||
DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
|
||||
|
||||
if (turn_off_dac) {
|
||||
I915_WRITE(PCH_ADPA, temp);
|
||||
/* Make sure hotplug is enabled */
|
||||
I915_WRITE(PCH_ADPA, temp | ADPA_CRT_HOTPLUG_ENABLE);
|
||||
(void)I915_READ(PCH_ADPA);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5673,6 +5673,13 @@ void intel_init_clock_gating(struct drm_device *dev)
|
|||
|
||||
I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate);
|
||||
|
||||
/*
|
||||
* On Ibex Peak and Cougar Point, we need to disable clock
|
||||
* gating for the panel power sequencer or it will fail to
|
||||
* start up when no ports are active.
|
||||
*/
|
||||
I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
|
||||
|
||||
/*
|
||||
* According to the spec the following bits should be set in
|
||||
* order to enable memory self-refresh
|
||||
|
|
|
|||
|
|
@ -250,6 +250,7 @@ extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
|
|||
extern void intel_init_clock_gating(struct drm_device *dev);
|
||||
extern void ironlake_enable_drps(struct drm_device *dev);
|
||||
extern void ironlake_disable_drps(struct drm_device *dev);
|
||||
extern void intel_init_emon(struct drm_device *dev);
|
||||
|
||||
extern int intel_pin_and_fence_fb_obj(struct drm_device *dev,
|
||||
struct drm_gem_object *obj);
|
||||
|
|
|
|||
|
|
@ -1367,6 +1367,12 @@ void intel_setup_overlay(struct drm_device *dev)
|
|||
goto out_free_bo;
|
||||
}
|
||||
overlay->flip_addr = overlay->reg_bo->gtt_offset;
|
||||
|
||||
ret = i915_gem_object_set_to_gtt_domain(reg_bo, true);
|
||||
if (ret) {
|
||||
DRM_ERROR("failed to move overlay register bo into the GTT\n");
|
||||
goto out_unpin_bo;
|
||||
}
|
||||
} else {
|
||||
ret = i915_gem_attach_phys_object(dev, reg_bo,
|
||||
I915_GEM_PHYS_OVERLAY_REGS,
|
||||
|
|
@ -1399,6 +1405,8 @@ void intel_setup_overlay(struct drm_device *dev)
|
|||
DRM_INFO("initialized overlay support\n");
|
||||
return;
|
||||
|
||||
out_unpin_bo:
|
||||
i915_gem_object_unpin(reg_bo);
|
||||
out_free_bo:
|
||||
drm_gem_object_unreference(reg_bo);
|
||||
out_free:
|
||||
|
|
|
|||
|
|
@ -1498,10 +1498,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
|
|||
if (!intel_sdvo_write_cmd(intel_sdvo,
|
||||
SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0))
|
||||
return connector_status_unknown;
|
||||
if (intel_sdvo->is_tv) {
|
||||
/* add 30ms delay when the output type is SDVO-TV */
|
||||
|
||||
/* add 30ms delay when the output type might be TV */
|
||||
if (intel_sdvo->caps.output_flags &
|
||||
(SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_CVBS0))
|
||||
mdelay(30);
|
||||
}
|
||||
|
||||
if (!intel_sdvo_read_response(intel_sdvo, &response, 2))
|
||||
return connector_status_unknown;
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
|
|||
base += 3;
|
||||
break;
|
||||
case ATOM_IIO_WRITE:
|
||||
(void)ctx->card->ioreg_read(ctx->card, CU16(base + 1));
|
||||
ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp);
|
||||
base += 3;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -2318,6 +2318,9 @@ void r100_vram_init_sizes(struct radeon_device *rdev)
|
|||
/* Fix for RN50, M6, M7 with 8/16/32(??) MBs of VRAM -
|
||||
* Novell bug 204882 + along with lots of ubuntu ones
|
||||
*/
|
||||
if (rdev->mc.aper_size > config_aper_size)
|
||||
config_aper_size = rdev->mc.aper_size;
|
||||
|
||||
if (config_aper_size > rdev->mc.real_vram_size)
|
||||
rdev->mc.mc_vram_size = config_aper_size;
|
||||
else
|
||||
|
|
@ -3225,6 +3228,8 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev,
|
|||
for (u = 0; u < track->num_texture; u++) {
|
||||
if (!track->textures[u].enabled)
|
||||
continue;
|
||||
if (track->textures[u].lookup_disable)
|
||||
continue;
|
||||
robj = track->textures[u].robj;
|
||||
if (robj == NULL) {
|
||||
DRM_ERROR("No texture bound to unit %u\n", u);
|
||||
|
|
@ -3459,6 +3464,7 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track
|
|||
track->textures[i].robj = NULL;
|
||||
/* CS IB emission code makes sure texture unit are disabled */
|
||||
track->textures[i].enabled = false;
|
||||
track->textures[i].lookup_disable = false;
|
||||
track->textures[i].roundup_w = true;
|
||||
track->textures[i].roundup_h = true;
|
||||
if (track->separate_cube)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ struct r100_cs_track_texture {
|
|||
unsigned height_11;
|
||||
bool use_pitch;
|
||||
bool enabled;
|
||||
bool lookup_disable;
|
||||
bool roundup_w;
|
||||
bool roundup_h;
|
||||
unsigned compress_format;
|
||||
|
|
|
|||
|
|
@ -447,6 +447,8 @@ int r200_packet0_check(struct radeon_cs_parser *p,
|
|||
track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK);
|
||||
track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK);
|
||||
}
|
||||
if (idx_value & R200_TXFORMAT_LOOKUP_DISABLE)
|
||||
track->textures[i].lookup_disable = true;
|
||||
switch ((idx_value & RADEON_TXFORMAT_FORMAT_MASK)) {
|
||||
case R200_TXFORMAT_I8:
|
||||
case R200_TXFORMAT_RGB332:
|
||||
|
|
|
|||
|
|
@ -97,14 +97,8 @@ u32 rv6xx_get_temp(struct radeon_device *rdev)
|
|||
{
|
||||
u32 temp = (RREG32(CG_THERMAL_STATUS) & ASIC_T_MASK) >>
|
||||
ASIC_T_SHIFT;
|
||||
u32 actual_temp = 0;
|
||||
|
||||
if ((temp >> 7) & 1)
|
||||
actual_temp = 0;
|
||||
else
|
||||
actual_temp = (temp >> 1) & 0xff;
|
||||
|
||||
return actual_temp * 1000;
|
||||
return temp * 1000;
|
||||
}
|
||||
|
||||
void r600_pm_get_dynpm_state(struct radeon_device *rdev)
|
||||
|
|
@ -1608,8 +1602,11 @@ void r600_gpu_init(struct radeon_device *rdev)
|
|||
rdev->config.r600.tiling_npipes = rdev->config.r600.max_tile_pipes;
|
||||
rdev->config.r600.tiling_nbanks = 4 << ((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
|
||||
tiling_config |= BANK_TILING((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
|
||||
tiling_config |= GROUP_SIZE(0);
|
||||
rdev->config.r600.tiling_group_size = 256;
|
||||
tiling_config |= GROUP_SIZE((ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT);
|
||||
if ((ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT)
|
||||
rdev->config.r600.tiling_group_size = 512;
|
||||
else
|
||||
rdev->config.r600.tiling_group_size = 256;
|
||||
tmp = (ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT;
|
||||
if (tmp > 3) {
|
||||
tiling_config |= ROW_TILING(3);
|
||||
|
|
|
|||
|
|
@ -650,8 +650,8 @@ void r600_kms_blit_copy(struct radeon_device *rdev,
|
|||
int src_x = src_gpu_addr & 255;
|
||||
int dst_x = dst_gpu_addr & 255;
|
||||
int h = 1;
|
||||
src_gpu_addr = src_gpu_addr & ~255;
|
||||
dst_gpu_addr = dst_gpu_addr & ~255;
|
||||
src_gpu_addr = src_gpu_addr & ~255ULL;
|
||||
dst_gpu_addr = dst_gpu_addr & ~255ULL;
|
||||
|
||||
if (!src_x && !dst_x) {
|
||||
h = (cur_size / max_bytes);
|
||||
|
|
@ -744,8 +744,8 @@ void r600_kms_blit_copy(struct radeon_device *rdev,
|
|||
int src_x = (src_gpu_addr & 255);
|
||||
int dst_x = (dst_gpu_addr & 255);
|
||||
int h = 1;
|
||||
src_gpu_addr = src_gpu_addr & ~255;
|
||||
dst_gpu_addr = dst_gpu_addr & ~255;
|
||||
src_gpu_addr = src_gpu_addr & ~255ULL;
|
||||
dst_gpu_addr = dst_gpu_addr & ~255ULL;
|
||||
|
||||
if (!src_x && !dst_x) {
|
||||
h = (cur_size / max_bytes);
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
|
|||
__func__, __LINE__, pitch);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!IS_ALIGNED((height / 8), track->nbanks)) {
|
||||
if (!IS_ALIGNED((height / 8), track->npipes)) {
|
||||
dev_warn(p->dev, "%s:%d cb height (%d) invalid\n",
|
||||
__func__, __LINE__, height);
|
||||
return -EINVAL;
|
||||
|
|
@ -367,7 +367,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
|
|||
__func__, __LINE__, pitch);
|
||||
return -EINVAL;
|
||||
}
|
||||
if ((height / 8) & (track->nbanks - 1)) {
|
||||
if (!IS_ALIGNED((height / 8), track->npipes)) {
|
||||
dev_warn(p->dev, "%s:%d db height (%d) invalid\n",
|
||||
__func__, __LINE__, height);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@
|
|||
#define R600_HDP_NONSURFACE_BASE 0x2c04
|
||||
|
||||
#define R600_BUS_CNTL 0x5420
|
||||
# define R600_BIOS_ROM_DIS (1 << 1)
|
||||
#define R600_CONFIG_CNTL 0x5424
|
||||
#define R600_CONFIG_MEMSIZE 0x5428
|
||||
#define R600_CONFIG_F0_BASE 0x542C
|
||||
|
|
|
|||
|
|
@ -98,6 +98,14 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev
|
|||
}
|
||||
}
|
||||
|
||||
/* some DCE3 boards have bad data for this entry */
|
||||
if (ASIC_IS_DCE3(rdev)) {
|
||||
if ((i == 4) &&
|
||||
(gpio->usClkMaskRegisterIndex == 0x1fda) &&
|
||||
(gpio->sucI2cId.ucAccess == 0x94))
|
||||
gpio->sucI2cId.ucAccess = 0x14;
|
||||
}
|
||||
|
||||
if (gpio->sucI2cId.ucAccess == id) {
|
||||
i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4;
|
||||
i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4;
|
||||
|
|
@ -174,6 +182,14 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev)
|
|||
}
|
||||
}
|
||||
|
||||
/* some DCE3 boards have bad data for this entry */
|
||||
if (ASIC_IS_DCE3(rdev)) {
|
||||
if ((i == 4) &&
|
||||
(gpio->usClkMaskRegisterIndex == 0x1fda) &&
|
||||
(gpio->sucI2cId.ucAccess == 0x94))
|
||||
gpio->sucI2cId.ucAccess = 0x14;
|
||||
}
|
||||
|
||||
i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4;
|
||||
i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4;
|
||||
i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4;
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool r700_read_disabled_bios(struct radeon_device *rdev)
|
||||
{
|
||||
uint32_t viph_control;
|
||||
|
|
@ -143,7 +144,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev)
|
|||
bool r;
|
||||
|
||||
viph_control = RREG32(RADEON_VIPH_CONTROL);
|
||||
bus_cntl = RREG32(RADEON_BUS_CNTL);
|
||||
bus_cntl = RREG32(R600_BUS_CNTL);
|
||||
d1vga_control = RREG32(AVIVO_D1VGA_CONTROL);
|
||||
d2vga_control = RREG32(AVIVO_D2VGA_CONTROL);
|
||||
vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL);
|
||||
|
|
@ -152,7 +153,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev)
|
|||
/* disable VIP */
|
||||
WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN));
|
||||
/* enable the rom */
|
||||
WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM));
|
||||
WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS));
|
||||
/* Disable VGA mode */
|
||||
WREG32(AVIVO_D1VGA_CONTROL,
|
||||
(d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE |
|
||||
|
|
@ -191,7 +192,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev)
|
|||
cg_spll_status = RREG32(R600_CG_SPLL_STATUS);
|
||||
}
|
||||
WREG32(RADEON_VIPH_CONTROL, viph_control);
|
||||
WREG32(RADEON_BUS_CNTL, bus_cntl);
|
||||
WREG32(R600_BUS_CNTL, bus_cntl);
|
||||
WREG32(AVIVO_D1VGA_CONTROL, d1vga_control);
|
||||
WREG32(AVIVO_D2VGA_CONTROL, d2vga_control);
|
||||
WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control);
|
||||
|
|
@ -216,7 +217,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev)
|
|||
bool r;
|
||||
|
||||
viph_control = RREG32(RADEON_VIPH_CONTROL);
|
||||
bus_cntl = RREG32(RADEON_BUS_CNTL);
|
||||
bus_cntl = RREG32(R600_BUS_CNTL);
|
||||
d1vga_control = RREG32(AVIVO_D1VGA_CONTROL);
|
||||
d2vga_control = RREG32(AVIVO_D2VGA_CONTROL);
|
||||
vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL);
|
||||
|
|
@ -231,7 +232,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev)
|
|||
/* disable VIP */
|
||||
WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN));
|
||||
/* enable the rom */
|
||||
WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM));
|
||||
WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS));
|
||||
/* Disable VGA mode */
|
||||
WREG32(AVIVO_D1VGA_CONTROL,
|
||||
(d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE |
|
||||
|
|
@ -262,7 +263,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev)
|
|||
|
||||
/* restore regs */
|
||||
WREG32(RADEON_VIPH_CONTROL, viph_control);
|
||||
WREG32(RADEON_BUS_CNTL, bus_cntl);
|
||||
WREG32(R600_BUS_CNTL, bus_cntl);
|
||||
WREG32(AVIVO_D1VGA_CONTROL, d1vga_control);
|
||||
WREG32(AVIVO_D2VGA_CONTROL, d2vga_control);
|
||||
WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control);
|
||||
|
|
|
|||
|
|
@ -571,6 +571,7 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde
|
|||
}
|
||||
|
||||
if (clk_mask && data_mask) {
|
||||
/* system specific masks */
|
||||
i2c.mask_clk_mask = clk_mask;
|
||||
i2c.mask_data_mask = data_mask;
|
||||
i2c.a_clk_mask = clk_mask;
|
||||
|
|
@ -579,7 +580,19 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde
|
|||
i2c.en_data_mask = data_mask;
|
||||
i2c.y_clk_mask = clk_mask;
|
||||
i2c.y_data_mask = data_mask;
|
||||
} else if ((ddc_line == RADEON_GPIOPAD_MASK) ||
|
||||
(ddc_line == RADEON_MDGPIO_MASK)) {
|
||||
/* default gpiopad masks */
|
||||
i2c.mask_clk_mask = (0x20 << 8);
|
||||
i2c.mask_data_mask = 0x80;
|
||||
i2c.a_clk_mask = (0x20 << 8);
|
||||
i2c.a_data_mask = 0x80;
|
||||
i2c.en_clk_mask = (0x20 << 8);
|
||||
i2c.en_data_mask = 0x80;
|
||||
i2c.y_clk_mask = (0x20 << 8);
|
||||
i2c.y_data_mask = 0x80;
|
||||
} else {
|
||||
/* default masks for ddc pads */
|
||||
i2c.mask_clk_mask = RADEON_GPIO_EN_1;
|
||||
i2c.mask_data_mask = RADEON_GPIO_EN_0;
|
||||
i2c.a_clk_mask = RADEON_GPIO_A_1;
|
||||
|
|
@ -716,7 +729,7 @@ void radeon_combios_i2c_init(struct radeon_device *rdev)
|
|||
clk = RBIOS8(offset + 3 + (i * 5) + 3);
|
||||
data = RBIOS8(offset + 3 + (i * 5) + 4);
|
||||
i2c = combios_setup_i2c_bus(rdev, DDC_MONID,
|
||||
clk, data);
|
||||
(1 << clk), (1 << data));
|
||||
rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "GPIOPAD_MASK");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1119,6 +1119,8 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVIA:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
|
||||
|
|
@ -1134,6 +1136,8 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
1);
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVII:
|
||||
case DRM_MODE_CONNECTOR_DVID:
|
||||
|
|
@ -1163,6 +1167,11 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
}
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DVII)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_HDMIA:
|
||||
case DRM_MODE_CONNECTOR_HDMIB:
|
||||
|
|
@ -1186,6 +1195,11 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_AUTO);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
|
|
@ -1216,6 +1230,9 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_AUTO);
|
||||
connector->interlace_allowed = true;
|
||||
/* in theory with a DP to VGA converter... */
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_SVIDEO:
|
||||
case DRM_MODE_CONNECTOR_Composite:
|
||||
|
|
@ -1231,6 +1248,8 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
radeon_atombios_get_tv_info(rdev));
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_LVDS:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
|
|
@ -1249,6 +1268,8 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1326,6 +1347,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
|
|||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVIA:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
|
||||
|
|
@ -1341,6 +1364,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
|
|||
1);
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVII:
|
||||
case DRM_MODE_CONNECTOR_DVID:
|
||||
|
|
@ -1358,6 +1383,11 @@ radeon_add_legacy_connector(struct drm_device *dev,
|
|||
1);
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DVII)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_SVIDEO:
|
||||
case DRM_MODE_CONNECTOR_Composite:
|
||||
|
|
@ -1380,6 +1410,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
|
|||
radeon_combios_get_tv_info(rdev));
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_LVDS:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type);
|
||||
|
|
@ -1393,6 +1425,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
|
|||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -595,6 +595,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action)
|
|||
int
|
||||
atombios_get_encoder_mode(struct drm_encoder *encoder)
|
||||
{
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct drm_connector *connector;
|
||||
|
|
@ -602,9 +603,20 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
|||
struct radeon_connector_atom_dig *dig_connector;
|
||||
|
||||
connector = radeon_get_connector_for_encoder(encoder);
|
||||
if (!connector)
|
||||
return 0;
|
||||
|
||||
if (!connector) {
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1:
|
||||
return ATOM_ENCODER_MODE_DVI;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2:
|
||||
default:
|
||||
return ATOM_ENCODER_MODE_CRT;
|
||||
}
|
||||
}
|
||||
radeon_connector = to_radeon_connector(connector);
|
||||
|
||||
switch (connector->connector_type) {
|
||||
|
|
@ -1547,6 +1559,23 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder)
|
|||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct radeon_encoder_atom_dig *dig;
|
||||
|
||||
/* check for pre-DCE3 cards with shared encoders;
|
||||
* can't really use the links individually, so don't disable
|
||||
* the encoder if it's in use by another connector
|
||||
*/
|
||||
if (!ASIC_IS_DCE3(rdev)) {
|
||||
struct drm_encoder *other_encoder;
|
||||
struct radeon_encoder *other_radeon_encoder;
|
||||
|
||||
list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) {
|
||||
other_radeon_encoder = to_radeon_encoder(other_encoder);
|
||||
if ((radeon_encoder->encoder_id == other_radeon_encoder->encoder_id) &&
|
||||
drm_helper_encoder_in_use(other_encoder))
|
||||
goto disable_done;
|
||||
}
|
||||
}
|
||||
|
||||
radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
|
||||
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
|
|
@ -1586,6 +1615,7 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder)
|
|||
break;
|
||||
}
|
||||
|
||||
disable_done:
|
||||
if (radeon_encoder_is_digital(encoder)) {
|
||||
if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI)
|
||||
r600_hdmi_disable(encoder);
|
||||
|
|
|
|||
|
|
@ -946,6 +946,7 @@ struct radeon_i2c_chan *radeon_i2c_create_dp(struct drm_device *dev,
|
|||
i2c->rec = *rec;
|
||||
i2c->adapter.owner = THIS_MODULE;
|
||||
i2c->dev = dev;
|
||||
sprintf(i2c->adapter.name, "Radeon aux bus %s", name);
|
||||
i2c_set_adapdata(&i2c->adapter, i2c);
|
||||
i2c->adapter.algo_data = &i2c->algo.dp;
|
||||
i2c->algo.dp.aux_ch = radeon_dp_i2c_aux_ch;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,8 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
|
|||
type = ttm_bo_type_device;
|
||||
}
|
||||
*bo_ptr = NULL;
|
||||
|
||||
retry:
|
||||
bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
|
||||
if (bo == NULL)
|
||||
return -ENOMEM;
|
||||
|
|
@ -109,8 +111,6 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
|
|||
bo->gobj = gobj;
|
||||
bo->surface_reg = -1;
|
||||
INIT_LIST_HEAD(&bo->list);
|
||||
|
||||
retry:
|
||||
radeon_ttm_placement_from_domain(bo, domain);
|
||||
/* Kernel allocation are uninterruptible */
|
||||
mutex_lock(&rdev->vram_mutex);
|
||||
|
|
|
|||
|
|
@ -2836,6 +2836,7 @@
|
|||
# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)
|
||||
# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)
|
||||
# define R200_TXFORMAT_ST_ROUTE_SHIFT 24
|
||||
# define R200_TXFORMAT_LOOKUP_DISABLE (1 << 27)
|
||||
# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
|
||||
# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
|
||||
# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
|
||||
|
|
|
|||
|
|
@ -643,10 +643,11 @@ static void rv770_gpu_init(struct radeon_device *rdev)
|
|||
else
|
||||
gb_tiling_config |= BANK_TILING((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
|
||||
rdev->config.rv770.tiling_nbanks = 4 << ((gb_tiling_config >> 4) & 0x3);
|
||||
|
||||
gb_tiling_config |= GROUP_SIZE(0);
|
||||
rdev->config.rv770.tiling_group_size = 256;
|
||||
|
||||
gb_tiling_config |= GROUP_SIZE((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT);
|
||||
if ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT)
|
||||
rdev->config.rv770.tiling_group_size = 512;
|
||||
else
|
||||
rdev->config.rv770.tiling_group_size = 256;
|
||||
if (((mc_arb_ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT) > 3) {
|
||||
gb_tiling_config |= ROW_TILING(3);
|
||||
gb_tiling_config |= SAMPLE_SPLIT(3);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct egalax_data {
|
|||
bool first; /* is this the first finger in the frame? */
|
||||
bool valid; /* valid finger data, or just placeholder? */
|
||||
bool activity; /* at least one active finger previously? */
|
||||
__u16 lastx, lasty; /* latest valid (x, y) in the frame */
|
||||
__u16 lastx, lasty, lastz; /* latest valid (x, y, z) in the frame */
|
||||
};
|
||||
|
||||
static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
||||
|
|
@ -79,6 +79,10 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
|||
case HID_DG_TIPPRESSURE:
|
||||
hid_map_usage(hi, usage, bit, max,
|
||||
EV_ABS, ABS_MT_PRESSURE);
|
||||
/* touchscreen emulation */
|
||||
input_set_abs_params(hi->input, ABS_PRESSURE,
|
||||
field->logical_minimum,
|
||||
field->logical_maximum, 0, 0);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -109,8 +113,8 @@ static void egalax_filter_event(struct egalax_data *td, struct input_dev *input)
|
|||
if (td->valid) {
|
||||
/* emit multitouch events */
|
||||
input_event(input, EV_ABS, ABS_MT_TRACKING_ID, td->id);
|
||||
input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x);
|
||||
input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y);
|
||||
input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x >> 3);
|
||||
input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y >> 3);
|
||||
input_event(input, EV_ABS, ABS_MT_PRESSURE, td->z);
|
||||
|
||||
input_mt_sync(input);
|
||||
|
|
@ -121,6 +125,7 @@ static void egalax_filter_event(struct egalax_data *td, struct input_dev *input)
|
|||
*/
|
||||
td->lastx = td->x;
|
||||
td->lasty = td->y;
|
||||
td->lastz = td->z;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -129,8 +134,9 @@ static void egalax_filter_event(struct egalax_data *td, struct input_dev *input)
|
|||
* the oldest on the panel, the one we want for single touch
|
||||
*/
|
||||
if (!td->first && td->activity) {
|
||||
input_event(input, EV_ABS, ABS_X, td->lastx);
|
||||
input_event(input, EV_ABS, ABS_Y, td->lasty);
|
||||
input_event(input, EV_ABS, ABS_X, td->lastx >> 3);
|
||||
input_event(input, EV_ABS, ABS_Y, td->lasty >> 3);
|
||||
input_event(input, EV_ABS, ABS_PRESSURE, td->lastz);
|
||||
}
|
||||
|
||||
if (!td->valid) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ static const struct hid_blacklist {
|
|||
{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
|
||||
{ USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
|
||||
{ USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },
|
||||
{ USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT },
|
||||
{ USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT },
|
||||
{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT },
|
||||
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
|
||||
|
|
|
|||
|
|
@ -1259,6 +1259,7 @@ static int lm85_probe(struct i2c_client *client,
|
|||
switch (data->type) {
|
||||
case adm1027:
|
||||
case adt7463:
|
||||
case adt7468:
|
||||
case emc6d100:
|
||||
case emc6d102:
|
||||
data->freq_map = adm1027_freq_map;
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ static int __devinit i2c_pca_pf_probe(struct platform_device *pdev)
|
|||
|
||||
if (irq) {
|
||||
ret = request_irq(irq, i2c_pca_pf_handler,
|
||||
IRQF_TRIGGER_FALLING, i2c->adap.name, i2c);
|
||||
IRQF_TRIGGER_FALLING, pdev->name, i2c);
|
||||
if (ret)
|
||||
goto e_reqirq;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ static int intel_idle_probe(void)
|
|||
|
||||
case 0x1C: /* 28 - Atom Processor */
|
||||
case 0x26: /* 38 - Lincroft Atom Processor */
|
||||
lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
|
||||
lapic_timer_reliable_states = (1 << 1); /* C1 */
|
||||
cpuidle_state_table = atom_cstates;
|
||||
break;
|
||||
#ifdef FUTURE_USE
|
||||
|
|
|
|||
|
|
@ -332,6 +332,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Sony Vaio VPCZ122GX */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "VPCZ122GX"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Sony Vaio FS-115b */
|
||||
.matches = {
|
||||
|
|
|
|||
|
|
@ -438,23 +438,27 @@ static void cmd_in_timeout(unsigned long data)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ucs->retry_cmd_in++ < BAS_RETRY) {
|
||||
dev_notice(cs->dev, "control read: timeout, retry %d\n",
|
||||
ucs->retry_cmd_in);
|
||||
rc = atread_submit(cs, BAS_TIMEOUT);
|
||||
if (rc >= 0 || rc == -ENODEV)
|
||||
/* resubmitted or disconnected */
|
||||
/* - bypass regular exit block */
|
||||
return;
|
||||
} else {
|
||||
if (ucs->retry_cmd_in++ >= BAS_RETRY) {
|
||||
dev_err(cs->dev,
|
||||
"control read: timeout, giving up after %d tries\n",
|
||||
ucs->retry_cmd_in);
|
||||
kfree(ucs->rcvbuf);
|
||||
ucs->rcvbuf = NULL;
|
||||
ucs->rcvbuf_size = 0;
|
||||
error_reset(cs);
|
||||
return;
|
||||
}
|
||||
|
||||
gig_dbg(DEBUG_USBREQ, "%s: timeout, retry %d",
|
||||
__func__, ucs->retry_cmd_in);
|
||||
rc = atread_submit(cs, BAS_TIMEOUT);
|
||||
if (rc < 0) {
|
||||
kfree(ucs->rcvbuf);
|
||||
ucs->rcvbuf = NULL;
|
||||
ucs->rcvbuf_size = 0;
|
||||
if (rc != -ENODEV)
|
||||
error_reset(cs);
|
||||
}
|
||||
kfree(ucs->rcvbuf);
|
||||
ucs->rcvbuf = NULL;
|
||||
ucs->rcvbuf_size = 0;
|
||||
error_reset(cs);
|
||||
}
|
||||
|
||||
/* read_ctrl_callback
|
||||
|
|
@ -470,18 +474,11 @@ static void read_ctrl_callback(struct urb *urb)
|
|||
struct cardstate *cs = inbuf->cs;
|
||||
struct bas_cardstate *ucs = cs->hw.bas;
|
||||
int status = urb->status;
|
||||
int have_data = 0;
|
||||
unsigned numbytes;
|
||||
int rc;
|
||||
|
||||
update_basstate(ucs, 0, BS_ATRDPEND);
|
||||
wake_up(&ucs->waitqueue);
|
||||
|
||||
if (!ucs->rcvbuf_size) {
|
||||
dev_warn(cs->dev, "%s: no receive in progress\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
del_timer(&ucs->timer_cmd_in);
|
||||
|
||||
switch (status) {
|
||||
|
|
@ -495,19 +492,10 @@ static void read_ctrl_callback(struct urb *urb)
|
|||
numbytes = ucs->rcvbuf_size;
|
||||
}
|
||||
|
||||
/* copy received bytes to inbuf */
|
||||
have_data = gigaset_fill_inbuf(inbuf, ucs->rcvbuf, numbytes);
|
||||
|
||||
if (unlikely(numbytes < ucs->rcvbuf_size)) {
|
||||
/* incomplete - resubmit for remaining bytes */
|
||||
ucs->rcvbuf_size -= numbytes;
|
||||
ucs->retry_cmd_in = 0;
|
||||
rc = atread_submit(cs, BAS_TIMEOUT);
|
||||
if (rc >= 0 || rc == -ENODEV)
|
||||
/* resubmitted or disconnected */
|
||||
/* - bypass regular exit block */
|
||||
return;
|
||||
error_reset(cs);
|
||||
/* copy received bytes to inbuf, notify event layer */
|
||||
if (gigaset_fill_inbuf(inbuf, ucs->rcvbuf, numbytes)) {
|
||||
gig_dbg(DEBUG_INTR, "%s-->BH", __func__);
|
||||
gigaset_schedule_event(cs);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -516,37 +504,32 @@ static void read_ctrl_callback(struct urb *urb)
|
|||
case -EINPROGRESS: /* pending */
|
||||
case -ENODEV: /* device removed */
|
||||
case -ESHUTDOWN: /* device shut down */
|
||||
/* no action necessary */
|
||||
/* no further action necessary */
|
||||
gig_dbg(DEBUG_USBREQ, "%s: %s",
|
||||
__func__, get_usb_statmsg(status));
|
||||
break;
|
||||
|
||||
default: /* severe trouble */
|
||||
dev_warn(cs->dev, "control read: %s\n",
|
||||
get_usb_statmsg(status));
|
||||
default: /* other errors: retry */
|
||||
if (ucs->retry_cmd_in++ < BAS_RETRY) {
|
||||
dev_notice(cs->dev, "control read: retry %d\n",
|
||||
ucs->retry_cmd_in);
|
||||
gig_dbg(DEBUG_USBREQ, "%s: %s, retry %d", __func__,
|
||||
get_usb_statmsg(status), ucs->retry_cmd_in);
|
||||
rc = atread_submit(cs, BAS_TIMEOUT);
|
||||
if (rc >= 0 || rc == -ENODEV)
|
||||
/* resubmitted or disconnected */
|
||||
/* - bypass regular exit block */
|
||||
if (rc >= 0)
|
||||
/* successfully resubmitted, skip freeing */
|
||||
return;
|
||||
} else {
|
||||
dev_err(cs->dev,
|
||||
"control read: giving up after %d tries\n",
|
||||
ucs->retry_cmd_in);
|
||||
if (rc == -ENODEV)
|
||||
/* disconnect, no further action necessary */
|
||||
break;
|
||||
}
|
||||
dev_err(cs->dev, "control read: %s, giving up after %d tries\n",
|
||||
get_usb_statmsg(status), ucs->retry_cmd_in);
|
||||
error_reset(cs);
|
||||
}
|
||||
|
||||
/* read finished, free buffer */
|
||||
kfree(ucs->rcvbuf);
|
||||
ucs->rcvbuf = NULL;
|
||||
ucs->rcvbuf_size = 0;
|
||||
if (have_data) {
|
||||
gig_dbg(DEBUG_INTR, "%s-->BH", __func__);
|
||||
gigaset_schedule_event(cs);
|
||||
}
|
||||
}
|
||||
|
||||
/* atread_submit
|
||||
|
|
@ -1598,13 +1581,13 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
|
|||
|
||||
ret = starturbs(bcs);
|
||||
if (ret < 0) {
|
||||
spin_unlock_irqrestore(&cs->lock, flags);
|
||||
dev_err(cs->dev,
|
||||
"could not start isochronous I/O for channel B%d: %s\n",
|
||||
bcs->channel + 1,
|
||||
ret == -EFAULT ? "null URB" : get_usb_rcmsg(ret));
|
||||
if (ret != -ENODEV)
|
||||
error_hangup(bcs);
|
||||
spin_unlock_irqrestore(&cs->lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1614,11 +1597,11 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
|
|||
dev_err(cs->dev, "could not open channel B%d\n",
|
||||
bcs->channel + 1);
|
||||
stopurbs(bcs->hw.bas);
|
||||
if (ret != -ENODEV)
|
||||
error_hangup(bcs);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&cs->lock, flags);
|
||||
if (ret < 0 && ret != -ENODEV)
|
||||
error_hangup(bcs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -842,13 +842,14 @@ static inline void trans_receive(unsigned char *src, unsigned count,
|
|||
|
||||
if (unlikely(bcs->ignore)) {
|
||||
bcs->ignore--;
|
||||
hdlc_flush(bcs);
|
||||
return;
|
||||
}
|
||||
skb = bcs->rx_skb;
|
||||
if (skb == NULL)
|
||||
if (skb == NULL) {
|
||||
skb = gigaset_new_rx_skb(bcs);
|
||||
bcs->hw.bas->goodbytes += skb->len;
|
||||
if (skb == NULL)
|
||||
return;
|
||||
}
|
||||
dobytes = bcs->rx_bufsize - skb->len;
|
||||
while (count > 0) {
|
||||
dst = skb_put(skb, count < dobytes ? count : dobytes);
|
||||
|
|
@ -860,6 +861,7 @@ static inline void trans_receive(unsigned char *src, unsigned count,
|
|||
if (dobytes == 0) {
|
||||
dump_bytes(DEBUG_STREAM_DUMP,
|
||||
"rcv data", skb->data, skb->len);
|
||||
bcs->hw.bas->goodbytes += skb->len;
|
||||
gigaset_skb_rcvd(bcs, skb);
|
||||
skb = gigaset_new_rx_skb(bcs);
|
||||
if (skb == NULL)
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ static struct dmi_system_id __initdata nas_led_whitelist[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_VERSION, "1.00.00")
|
||||
}
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1329,7 +1329,7 @@ super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
|
|||
md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
|
||||
rdev->sb_page);
|
||||
md_super_wait(rdev->mddev);
|
||||
return num_sectors / 2; /* kB for sysfs */
|
||||
return num_sectors;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1697,7 +1697,7 @@ super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
|
|||
md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
|
||||
rdev->sb_page);
|
||||
md_super_wait(rdev->mddev);
|
||||
return num_sectors / 2; /* kB for sysfs */
|
||||
return num_sectors;
|
||||
}
|
||||
|
||||
static struct super_type super_types[] = {
|
||||
|
|
@ -2172,6 +2172,8 @@ repeat:
|
|||
if (!mddev->persistent) {
|
||||
clear_bit(MD_CHANGE_CLEAN, &mddev->flags);
|
||||
clear_bit(MD_CHANGE_DEVS, &mddev->flags);
|
||||
if (!mddev->external)
|
||||
clear_bit(MD_CHANGE_PENDING, &mddev->flags);
|
||||
wake_up(&mddev->sb_wait);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue