Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65174
b: refs/heads/master
c: d85f579
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Sep 26, 2007
1 parent 9b78baf commit 5d6450a
Show file tree
Hide file tree
Showing 24 changed files with 157 additions and 121 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: 45dfd5b5dd20f17fe23dafc5cfe921474d27f849
refs/heads/master: d85f57938ad1d674dff8077a2e6a36a45dbe0e22
7 changes: 7 additions & 0 deletions trunk/arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
regs->ccr = 0;
regs->gpr[1] = sp;

/*
* We have just cleared all the nonvolatile GPRs, so make
* FULL_REGS(regs) return true. This is necessary to allow
* ptrace to examine the thread immediately after exec.
*/
regs->trap &= ~1UL;

#ifdef CONFIG_PPC32
regs->mq = 0;
regs->nip = start;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/sleep/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-y := wakeup.o
obj-$(CONFIG_ACPI_SLEEP) += main.o
obj-y += main.o
obj-$(CONFIG_ACPI_SLEEP) += proc.o

EXTRA_CFLAGS += $(ACPI_CFLAGS)
46 changes: 25 additions & 21 deletions trunk/drivers/acpi/sleep/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,30 @@

u8 sleep_states[ACPI_S_STATE_COUNT];

#ifdef CONFIG_PM_SLEEP
static u32 acpi_target_sleep_state = ACPI_STATE_S0;
#endif

int acpi_sleep_prepare(u32 acpi_state)
{
#ifdef CONFIG_ACPI_SLEEP
/* do we have a wakeup address for S2 and S3? */
if (acpi_state == ACPI_STATE_S3) {
if (!acpi_wakeup_address) {
return -EFAULT;
}
acpi_set_firmware_waking_vector((acpi_physical_address)
virt_to_phys((void *)
acpi_wakeup_address));

}
ACPI_FLUSH_CPU_CACHE();
acpi_enable_wakeup_device_prep(acpi_state);
#endif
acpi_gpe_sleep_prepare(acpi_state);
acpi_enter_sleep_state_prep(acpi_state);
return 0;
}

#ifdef CONFIG_SUSPEND
static struct pm_ops acpi_pm_ops;
Expand Down Expand Up @@ -60,27 +83,6 @@ static int acpi_pm_set_target(suspend_state_t pm_state)
return error;
}

int acpi_sleep_prepare(u32 acpi_state)
{
#ifdef CONFIG_ACPI_SLEEP
/* do we have a wakeup address for S2 and S3? */
if (acpi_state == ACPI_STATE_S3) {
if (!acpi_wakeup_address) {
return -EFAULT;
}
acpi_set_firmware_waking_vector((acpi_physical_address)
virt_to_phys((void *)
acpi_wakeup_address));

}
ACPI_FLUSH_CPU_CACHE();
acpi_enable_wakeup_device_prep(acpi_state);
#endif
acpi_gpe_sleep_prepare(acpi_state);
acpi_enter_sleep_state_prep(acpi_state);
return 0;
}

/**
* acpi_pm_prepare - Do preliminary suspend work.
* @pm_state: ignored
Expand Down Expand Up @@ -299,6 +301,7 @@ int acpi_suspend(u32 acpi_state)
return -EINVAL;
}

#ifdef CONFIG_PM_SLEEP
/**
* acpi_pm_device_sleep_state - return preferred power state of ACPI device
* in the system sleep state given by %acpi_target_sleep_state
Expand Down Expand Up @@ -373,6 +376,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
*d_min_p = d_min;
return d_max;
}
#endif

static void acpi_power_off_prepare(void)
{
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/ata/pata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,9 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
int drive_pci = sis_old_port_base(adev);
u16 timing;

/* MWDMA 0-2 and UDMA 0-5 */
const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000};
const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000, 0x8000 };

pci_read_config_word(pdev, drive_pci, &timing);

Expand Down
16 changes: 12 additions & 4 deletions trunk/drivers/ata/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,16 +888,23 @@ static inline void sil24_host_intr(struct ata_port *ap)
u32 slot_stat, qc_active;
int rc;

/* If PCIX_IRQ_WOC, there's an inherent race window between
* clearing IRQ pending status and reading PORT_SLOT_STAT
* which may cause spurious interrupts afterwards. This is
* unavoidable and much better than losing interrupts which
* happens if IRQ pending is cleared after reading
* PORT_SLOT_STAT.
*/
if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);

slot_stat = readl(port + PORT_SLOT_STAT);

if (unlikely(slot_stat & HOST_SSTAT_ATTN)) {
sil24_error_intr(ap);
return;
}

if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);

qc_active = slot_stat & ~HOST_SSTAT_ATTN;
rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc);
if (rc > 0)
Expand All @@ -910,7 +917,8 @@ static inline void sil24_host_intr(struct ata_port *ap)
return;
}

if (ata_ratelimit())
/* spurious interrupts are expected if PCIX_IRQ_WOC */
if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit())
ata_port_printk(ap, KERN_INFO, "spurious interrupt "
"(slot_stat 0x%x active_tag %d sactive 0x%x)\n",
slot_stat, ap->active_tag, ap->sactive);
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,10 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
check_disk_change(ip->i_bdev);
return 0;
err_release:
if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) {
cdi->ops->lock_door(cdi, 0);
cdinfo(CD_OPEN, "door unlocked.\n");
}
cdi->ops->release(cdi);
err:
cdi->use_count--;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,14 +943,14 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
printk(KERN_DEBUG "%s: 0x%lx is busy\n",
__FUNCTION__, hdp->hd_phys_address);
iounmap(hdp->hd_address);
return -EBUSY;
return AE_ALREADY_EXISTS;
}
} else if (res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) {
struct acpi_resource_fixed_memory32 *fixmem32;

fixmem32 = &res->data.fixed_memory32;
if (!fixmem32)
return -EINVAL;
return AE_NO_MEMORY;

hdp->hd_phys_address = fixmem32->address;
hdp->hd_address = ioremap(fixmem32->address,
Expand All @@ -960,7 +960,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
printk(KERN_DEBUG "%s: 0x%lx is busy\n",
__FUNCTION__, hdp->hd_phys_address);
iounmap(hdp->hd_address);
return -EBUSY;
return AE_ALREADY_EXISTS;
}
} else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
struct acpi_resource_extended_irq *irqp;
Expand Down
26 changes: 8 additions & 18 deletions trunk/drivers/char/mspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,22 @@ mspec_open(struct vm_area_struct *vma)
* mspec_close
*
* Called when unmapping a device mapping. Frees all mspec pages
* belonging to the vma.
* belonging to all the vma's sharing this vma_data structure.
*/
static void
mspec_close(struct vm_area_struct *vma)
{
struct vma_data *vdata;
int index, last_index, result;
int index, last_index;
unsigned long my_page;

vdata = vma->vm_private_data;

BUG_ON(vma->vm_start < vdata->vm_start || vma->vm_end > vdata->vm_end);
if (!atomic_dec_and_test(&vdata->refcnt))
return;

spin_lock(&vdata->lock);
index = (vma->vm_start - vdata->vm_start) >> PAGE_SHIFT;
last_index = (vma->vm_end - vdata->vm_start) >> PAGE_SHIFT;
for (; index < last_index; index++) {
last_index = (vdata->vm_end - vdata->vm_start) >> PAGE_SHIFT;
for (index = 0; index < last_index; index++) {
if (vdata->maddr[index] == 0)
continue;
/*
Expand All @@ -180,28 +179,19 @@ mspec_close(struct vm_area_struct *vma)
*/
my_page = vdata->maddr[index];
vdata->maddr[index] = 0;
spin_unlock(&vdata->lock);
result = mspec_zero_block(my_page, PAGE_SIZE);
if (!result)
if (!mspec_zero_block(my_page, PAGE_SIZE))
uncached_free_page(my_page);
else
printk(KERN_WARNING "mspec_close(): "
"failed to zero page %i\n",
result);
spin_lock(&vdata->lock);
"failed to zero page %ld\n", my_page);
}
spin_unlock(&vdata->lock);

if (!atomic_dec_and_test(&vdata->refcnt))
return;

if (vdata->flags & VMD_VMALLOCED)
vfree(vdata);
else
kfree(vdata);
}


/*
* mspec_nopfn
*
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/input/mouse/appletouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ static void atp_complete(struct urb* urb)
{
int x, y, x_z, y_z, x_f, y_f;
int retval, i, j;
int key;
struct atp *dev = urb->context;

switch (urb->status) {
Expand Down Expand Up @@ -468,6 +469,7 @@ static void atp_complete(struct urb* urb)
ATP_XFACT, &x_z, &x_f);
y = atp_calculate_abs(dev->xy_acc + ATP_XSENSORS, ATP_YSENSORS,
ATP_YFACT, &y_z, &y_f);
key = dev->data[dev->datalen - 1] & 1;

if (x && y) {
if (dev->x_old != -1) {
Expand Down Expand Up @@ -505,7 +507,7 @@ static void atp_complete(struct urb* urb)
the first touch unless reinitialised. Do so if it's been
idle for a while in order to avoid waking the kernel up
several hundred times a second */
if (atp_is_geyser_3(dev)) {
if (!key && atp_is_geyser_3(dev)) {
dev->idlecount++;
if (dev->idlecount == 10) {
dev->valid = 0;
Expand All @@ -514,7 +516,7 @@ static void atp_complete(struct urb* urb)
}
}

input_report_key(dev->input, BTN_LEFT, dev->data[dev->datalen - 1] & 1);
input_report_key(dev->input, BTN_LEFT, key);
input_sync(dev->input);

exit:
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/lguest/lguest_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
jmp lguest_init

/*G:055 We create a macro which puts the assembler code between lgstart_ and
* lgend_ markers. These templates end up in the .init.text section, so they
* are discarded after boot. */
* lgend_ markers. These templates are put in the .text section: they can't be
* discarded after boot as we may need to patch modules, too. */
.text
#define LGUEST_PATCH(name, insns...) \
lgstart_##name: insns; lgend_##name:; \
.globl lgstart_##name; .globl lgend_##name
Expand All @@ -34,7 +35,6 @@ LGUEST_PATCH(popf, movl %eax, lguest_data+LGUEST_DATA_irq_enabled)
LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax)
/*:*/

.text
/* These demark the EIP range where host should never deliver interrupts. */
.global lguest_noirq_start
.global lguest_noirq_end
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/pcmcia/3c589_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct el3_private {
spinlock_t lock;
};

static const char *if_names[] = { "auto", "10base2", "10baseT", "AUI" };
static const char *if_names[] = { "auto", "10baseT", "10base2", "AUI" };

/*====================================================================*/

Expand Down
14 changes: 13 additions & 1 deletion trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,10 @@ static void rtl8169_hw_phy_config(struct net_device *dev)
return;
}

/* phy config for RTL8169s mac_version C chip */
if ((tp->mac_version != RTL_GIGA_MAC_VER_02) &&
(tp->mac_version != RTL_GIGA_MAC_VER_03))
return;

mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1
mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000
mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7
Expand Down Expand Up @@ -2567,6 +2570,15 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
(TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) {
netif_wake_queue(dev);
}
/*
* 8168 hack: TxPoll requests are lost when the Tx packets are
* too close. Let's kick an extra TxPoll request when a burst
* of start_xmit activity is detected (if it is not detected,
* it is slow enough). -- FR
*/
smp_rmb();
if (tp->cur_tx != dirty_tx)
RTL_W8(TxPoll, NPQ);
}
}

Expand Down
Loading

0 comments on commit 5d6450a

Please sign in to comment.