Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300282
b: refs/heads/master
c: 7ef4e98
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Graf committed May 16, 2012
1 parent 4a3064a commit 7fe99b0
Show file tree
Hide file tree
Showing 34 changed files with 129 additions and 267 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b724cc199bc8e889569e85301e6e56b5be25b986
refs/heads/master: 7ef4e985d54bad2773f260da38530f858a9a8491
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/kvm/book3s_segment.S
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
beq ld_last_prev_inst
cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT
beq- ld_last_inst
#ifdef CONFIG_PPC64
BEGIN_FTR_SECTION
cmpwi r12, BOOK3S_INTERRUPT_H_EMUL_ASSIST
beq- ld_last_inst
END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
#endif

b no_ld_last_inst

Expand Down
9 changes: 2 additions & 7 deletions trunk/arch/tile/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,9 @@ extern void cpu_idle_on_new_stack(struct thread_info *old_ti,

#else /* __ASSEMBLY__ */

/*
* How to get the thread information struct from assembly.
* Note that we use different macros since different architectures
* have different semantics in their "mm" instruction and we would
* like to guarantee that the macro expands to exactly one instruction.
*/
/* how to get the thread information struct from ASM */
#ifdef __tilegx__
#define EXTRACT_THREAD_INFO(reg) mm reg, zero, LOG2_THREAD_SIZE, 63
#define GET_THREAD_INFO(reg) move reg, sp; mm reg, zero, LOG2_THREAD_SIZE, 63
#else
#define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31
#endif
Expand Down
12 changes: 7 additions & 5 deletions trunk/arch/tile/kernel/compat_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,19 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
* Set up registers for signal handler.
* Registers that we don't modify keep the value they had from
* user-space at the time we took the signal.
* We always pass siginfo and mcontext, regardless of SA_SIGINFO,
* since some things rely on this (e.g. glibc's debug/segfault.c).
*/
regs->pc = ptr_to_compat_reg(ka->sa.sa_handler);
regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
regs->sp = ptr_to_compat_reg(frame);
regs->lr = restorer;
regs->regs[0] = (unsigned long) usig;
regs->regs[1] = ptr_to_compat_reg(&frame->info);
regs->regs[2] = ptr_to_compat_reg(&frame->uc);
regs->flags |= PT_FLAGS_CALLER_SAVES;

if (ka->sa.sa_flags & SA_SIGINFO) {
/* Need extra arguments, so mark to restore caller-saves. */
regs->regs[1] = ptr_to_compat_reg(&frame->info);
regs->regs[2] = ptr_to_compat_reg(&frame->uc);
regs->flags |= PT_FLAGS_CALLER_SAVES;
}

/*
* Notify any tracer that was single-stepping it.
Expand Down
41 changes: 13 additions & 28 deletions trunk/arch/tile/kernel/intvec_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -838,18 +838,6 @@ STD_ENTRY(interrupt_return)
.Lresume_userspace:
FEEDBACK_REENTER(interrupt_return)

/*
* Use r33 to hold whether we have already loaded the callee-saves
* into ptregs. We don't want to do it twice in this loop, since
* then we'd clobber whatever changes are made by ptrace, etc.
* Get base of stack in r32.
*/
{
GET_THREAD_INFO(r32)
movei r33, 0
}

.Lretry_work_pending:
/*
* Disable interrupts so as to make sure we don't
* miss an interrupt that sets any of the thread flags (like
Expand All @@ -860,6 +848,9 @@ STD_ENTRY(interrupt_return)
IRQ_DISABLE(r20, r21)
TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */

/* Get base of stack in r32; note r30/31 are used as arguments here. */
GET_THREAD_INFO(r32)


/* Check to see if there is any work to do before returning to user. */
{
Expand All @@ -875,18 +866,16 @@ STD_ENTRY(interrupt_return)

/*
* Make sure we have all the registers saved for signal
* handling, notify-resume, or single-step. Call out to C
* code to figure out exactly what we need to do for each flag bit,
* then if necessary, reload the flags and recheck.
* handling or single-step. Call out to C code to figure out
* exactly what we need to do for each flag bit, then if
* necessary, reload the flags and recheck.
*/
push_extra_callee_saves r0
{
PTREGS_PTR(r0, PTREGS_OFFSET_BASE)
bnz r33, 1f
jal do_work_pending
}
push_extra_callee_saves r0
movei r33, 1
1: jal do_work_pending
bnz r0, .Lretry_work_pending
bnz r0, .Lresume_userspace

/*
* In the NMI case we
Expand Down Expand Up @@ -1191,12 +1180,10 @@ handle_syscall:
add r20, r20, tp
lw r21, r20
addi r21, r21, 1
{
sw r20, r21
GET_THREAD_INFO(r31)
}
sw r20, r21

/* Trace syscalls, if requested. */
GET_THREAD_INFO(r31)
addi r31, r31, THREAD_INFO_FLAGS_OFFSET
lw r30, r31
andi r30, r30, _TIF_SYSCALL_TRACE
Expand Down Expand Up @@ -1375,17 +1362,15 @@ handle_ill:
3:
/* set PC and continue */
lw r26, r24
{
sw r28, r26
GET_THREAD_INFO(r0)
}
sw r28, r26

/*
* Clear TIF_SINGLESTEP to prevent recursion if we execute an ill.
* The normal non-arch flow redundantly clears TIF_SINGLESTEP, but we
* need to clear it here and can't really impose on all other arches.
* So what's another write between friends?
*/
GET_THREAD_INFO(r0)

addi r1, r0, THREAD_INFO_FLAGS_OFFSET
{
Expand Down
38 changes: 10 additions & 28 deletions trunk/arch/tile/kernel/intvec_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -646,20 +646,6 @@ STD_ENTRY(interrupt_return)
.Lresume_userspace:
FEEDBACK_REENTER(interrupt_return)

/*
* Use r33 to hold whether we have already loaded the callee-saves
* into ptregs. We don't want to do it twice in this loop, since
* then we'd clobber whatever changes are made by ptrace, etc.
*/
{
movei r33, 0
move r32, sp
}

/* Get base of stack in r32. */
EXTRACT_THREAD_INFO(r32)

.Lretry_work_pending:
/*
* Disable interrupts so as to make sure we don't
* miss an interrupt that sets any of the thread flags (like
Expand All @@ -670,6 +656,9 @@ STD_ENTRY(interrupt_return)
IRQ_DISABLE(r20, r21)
TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */

/* Get base of stack in r32; note r30/31 are used as arguments here. */
GET_THREAD_INFO(r32)


/* Check to see if there is any work to do before returning to user. */
{
Expand All @@ -685,18 +674,16 @@ STD_ENTRY(interrupt_return)

/*
* Make sure we have all the registers saved for signal
* handling or notify-resume. Call out to C code to figure out
* handling or single-step. Call out to C code to figure out
* exactly what we need to do for each flag bit, then if
* necessary, reload the flags and recheck.
*/
push_extra_callee_saves r0
{
PTREGS_PTR(r0, PTREGS_OFFSET_BASE)
bnez r33, 1f
jal do_work_pending
}
push_extra_callee_saves r0
movei r33, 1
1: jal do_work_pending
bnez r0, .Lretry_work_pending
bnez r0, .Lresume_userspace

/*
* In the NMI case we
Expand Down Expand Up @@ -981,16 +968,11 @@ handle_syscall:
shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET)
add r20, r20, tp
ld4s r21, r20
{
addi r21, r21, 1
move r31, sp
}
{
st4 r20, r21
EXTRACT_THREAD_INFO(r31)
}
addi r21, r21, 1
st4 r20, r21

/* Trace syscalls, if requested. */
GET_THREAD_INFO(r31)
addi r31, r31, THREAD_INFO_FLAGS_OFFSET
ld r30, r31
andi r30, r30, _TIF_SYSCALL_TRACE
Expand Down
7 changes: 2 additions & 5 deletions trunk/arch/tile/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,6 @@ struct task_struct *__sched _switch_to(struct task_struct *prev,
*/
int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
{
/* If we enter in kernel mode, do nothing and exit the caller loop. */
if (!user_mode(regs))
return 0;

if (thread_info_flags & _TIF_NEED_RESCHED) {
schedule();
return 1;
Expand All @@ -593,7 +589,8 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
return 1;
}
if (thread_info_flags & _TIF_SINGLESTEP) {
single_step_once(regs);
if ((regs->ex1 & SPR_EX_CONTEXT_1_1__PL_MASK) == 0)
single_step_once(regs);
return 0;
}
panic("work_pending: bad flags %#x\n", thread_info_flags);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ struct pch_gbe_hw_stats {
/**
* struct pch_gbe_adapter - board specific private data structure
* @stats_lock: Spinlock structure for status
* @tx_queue_lock: Spinlock structure for transmit
* @ethtool_lock: Spinlock structure for ethtool
* @irq_sem: Semaphore for interrupt
* @netdev: Pointer of network device structure
Expand All @@ -608,6 +609,7 @@ struct pch_gbe_hw_stats {

struct pch_gbe_adapter {
spinlock_t stats_lock;
spinlock_t tx_queue_lock;
spinlock_t ethtool_lock;
atomic_t irq_sem;
struct net_device *netdev;
Expand Down
25 changes: 14 additions & 11 deletions trunk/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,14 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
*/
static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter)
{
adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL);
int size;

size = (int)sizeof(struct pch_gbe_tx_ring);
adapter->tx_ring = kzalloc(size, GFP_KERNEL);
if (!adapter->tx_ring)
return -ENOMEM;

adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL);
size = (int)sizeof(struct pch_gbe_rx_ring);
adapter->rx_ring = kzalloc(size, GFP_KERNEL);
if (!adapter->rx_ring) {
kfree(adapter->tx_ring);
return -ENOMEM;
Expand Down Expand Up @@ -1159,6 +1162,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
struct sk_buff *tmp_skb;
unsigned int frame_ctrl;
unsigned int ring_num;
unsigned long flags;

/*-- Set frame control --*/
frame_ctrl = 0;
Expand Down Expand Up @@ -1207,14 +1211,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
}
}
}

spin_lock_irqsave(&tx_ring->tx_lock, flags);
ring_num = tx_ring->next_to_use;
if (unlikely((ring_num + 1) == tx_ring->count))
tx_ring->next_to_use = 0;
else
tx_ring->next_to_use = ring_num + 1;


spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
buffer_info = &tx_ring->buffer_info[ring_num];
tmp_skb = buffer_info->skb;

Expand Down Expand Up @@ -1514,7 +1518,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
&rx_ring->rx_buff_pool_logic,
GFP_KERNEL);
if (!rx_ring->rx_buff_pool) {
pr_err("Unable to allocate memory for the receive pool buffer\n");
pr_err("Unable to allocate memory for the receive poll buffer\n");
return -ENOMEM;
}
memset(rx_ring->rx_buff_pool, 0, size);
Expand Down Expand Up @@ -1633,17 +1637,15 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n",
cleaned_count);
/* Recover from running out of Tx resources in xmit_frame */
spin_lock(&tx_ring->tx_lock);
if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) {
netif_wake_queue(adapter->netdev);
adapter->stats.tx_restart_count++;
pr_debug("Tx wake queue\n");
}

spin_lock(&adapter->tx_queue_lock);
tx_ring->next_to_clean = i;

spin_unlock(&adapter->tx_queue_lock);
pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);
spin_unlock(&tx_ring->tx_lock);
return cleaned;
}

Expand Down Expand Up @@ -2035,6 +2037,7 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter)
return -ENOMEM;
}
spin_lock_init(&adapter->hw.miim_lock);
spin_lock_init(&adapter->tx_queue_lock);
spin_lock_init(&adapter->stats_lock);
spin_lock_init(&adapter->ethtool_lock);
atomic_set(&adapter->irq_sem, 0);
Expand Down Expand Up @@ -2139,10 +2142,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
tx_ring->next_to_use, tx_ring->next_to_clean);
return NETDEV_TX_BUSY;
}
spin_unlock_irqrestore(&tx_ring->tx_lock, flags);

/* CRC,ITAG no support */
pch_gbe_tx_queue(adapter, tx_ring, skb);
spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
return NETDEV_TX_OK;
}

Expand Down
16 changes: 0 additions & 16 deletions trunk/drivers/net/usb/cdc_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ static const struct driver_info wwan_info = {
/*-------------------------------------------------------------------------*/

#define HUAWEI_VENDOR_ID 0x12D1
#define NOVATEL_VENDOR_ID 0x1410

static const struct usb_device_id products [] = {
/*
Expand Down Expand Up @@ -603,21 +602,6 @@ static const struct usb_device_id products [] = {
* because of bugs/quirks in a given product (like Zaurus, above).
*/
{
/* Novatel USB551L */
/* This match must come *before* the generic CDC-ETHER match so that
* we get FLAG_WWAN set on the device, since it's descriptors are
* generic CDC-ETHER.
*/
.match_flags = USB_DEVICE_ID_MATCH_VENDOR
| USB_DEVICE_ID_MATCH_PRODUCT
| USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = NOVATEL_VENDOR_ID,
.idProduct = 0xB001,
.bInterfaceClass = USB_CLASS_COMM,
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
.bInterfaceProtocol = USB_CDC_PROTO_NONE,
.driver_info = (unsigned long)&wwan_info,
}, {
USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
Expand Down
Loading

0 comments on commit 7fe99b0

Please sign in to comment.