Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263679
b: refs/heads/master
c: 3d0283e
h: refs/heads/master
i:
  263677: 901d748
  263675: c926da7
  263671: ffed1a8
  263663: 975bbad
  263647: 3f53963
  263615: 12199e5
  263551: 484d3ce
  263423: 7c8c78e
  263167: b80f9c7
v: v3
  • Loading branch information
Linus Torvalds committed Sep 8, 2011
1 parent c6f7ae2 commit 9b318b9
Show file tree
Hide file tree
Showing 31 changed files with 495 additions and 210 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: 882aba01052476cbe3cd7339a3e6784b2437f18d
refs/heads/master: 3d0283ebc8718f793a14971041b1c99afce714ac
7 changes: 7 additions & 0 deletions trunk/Documentation/hwmon/max16065
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ can be safely used to identify the chip. You will have to instantiate
the devices explicitly. Please see Documentation/i2c/instantiating-devices for
details.

WARNING: Do not access chip registers using the i2cdump command, and do not use
any of the i2ctools commands on a command register (0xa5 to 0xac). The chips
supported by this driver interpret any access to a command register (including
read commands) as request to execute the command in question. This may result in
power loss, board resets, and/or Flash corruption. Worst case, your board may
turn into a brick.


Sysfs entries
-------------
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/pvclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
#elif defined(__x86_64__)
__asm__ (
"mul %[mul_frac] ; shrd $32, %[hi], %[lo]"
"mulq %[mul_frac] ; shrd $32, %[hi], %[lo]"
: [lo]"=a"(product),
[hi]"=d"(tmp)
: "0"(delta),
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,9 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)

perf_callchain_store(entry, regs->ip);

if (!current->mm)
return;

if (perf_callchain_user32(regs, entry))
return;

Expand Down
19 changes: 19 additions & 0 deletions trunk/arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ static unsigned long __init xen_set_identity(const struct e820entry *list,
PFN_UP(start_pci), PFN_DOWN(last));
return identity;
}

static unsigned long __init xen_get_max_pages(void)
{
unsigned long max_pages = MAX_DOMAIN_PAGES;
domid_t domid = DOMID_SELF;
int ret;

ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
if (ret > 0)
max_pages = ret;
return min(max_pages, MAX_DOMAIN_PAGES);
}

/**
* machine_specific_memory_setup - Hook for machine specific memory setup.
**/
Expand Down Expand Up @@ -292,6 +305,12 @@ char * __init xen_memory_setup(void)

sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);

extra_limit = xen_get_max_pages();
if (extra_limit >= max_pfn)
extra_pages = extra_limit - max_pfn;
else
extra_pages = 0;

extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820);

/*
Expand Down
10 changes: 10 additions & 0 deletions trunk/arch/x86/xen/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <xen/page.h>
#include <xen/events.h>

#include <xen/hvc-console.h>
#include "xen-ops.h"
#include "mmu.h"

Expand Down Expand Up @@ -207,6 +208,15 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
unsigned cpu;
unsigned int i;

if (skip_ioapic_setup) {
char *m = (max_cpus == 0) ?
"The nosmp parameter is incompatible with Xen; " \
"use Xen dom0_max_vcpus=1 parameter" :
"The noapic parameter is incompatible with Xen";

xen_raw_printk(m);
panic(m);
}
xen_init_lock_cpu(0);

smp_store_cpu_info(0);
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/x86/xen/xen-asm_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ xen_iret_start_crit:

/*
* If there's something pending, mask events again so we can
* jump back into xen_hypervisor_callback
* jump back into xen_hypervisor_callback. Otherwise do not
* touch XEN_vcpu_info_mask.
*/
sete XEN_vcpu_info_mask(%eax)
jne 1f
movb $1, XEN_vcpu_info_mask(%eax)

popl %eax
1: popl %eax

/*
* From this point on the registers are restored and the stack
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/hwmon/max16065.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static inline int MV_TO_LIMIT(int mv, int range)

static inline int ADC_TO_CURR(int adc, int gain)
{
return adc * 1400000 / gain * 255;
return adc * 1400000 / (gain * 255);
}

/*
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/hwmon/pmbus/ucd9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,11 @@ static int ucd9000_probe(struct i2c_client *client,
block_buffer[ret] = '\0';
dev_info(&client->dev, "Device ID %s\n", block_buffer);

mid = NULL;
for (i = 0; i < ARRAY_SIZE(ucd9000_id); i++) {
mid = &ucd9000_id[i];
for (mid = ucd9000_id; mid->name[0]; mid++) {
if (!strncasecmp(mid->name, block_buffer, strlen(mid->name)))
break;
}
if (!mid || !strlen(mid->name)) {
if (!mid->name[0]) {
dev_err(&client->dev, "Unsupported device\n");
return -ENODEV;
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/hwmon/pmbus/ucd9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ static int ucd9200_probe(struct i2c_client *client,
block_buffer[ret] = '\0';
dev_info(&client->dev, "Device ID %s\n", block_buffer);

mid = NULL;
for (i = 0; i < ARRAY_SIZE(ucd9200_id); i++) {
mid = &ucd9200_id[i];
for (mid = ucd9200_id; mid->name[0]; mid++) {
if (!strncasecmp(mid->name, block_buffer, strlen(mid->name)))
break;
}
if (!mid || !strlen(mid->name)) {
if (!mid->name[0]) {
dev_err(&client->dev, "Unsupported device\n");
return -ENODEV;
}
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/i2c/busses/i2c-pxa-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev,
return -EINVAL;
}
sds = kzalloc(sizeof(*sds), GFP_KERNEL);
if (!sds)
if (!sds) {
ret = -ENOMEM;
goto err_mem;
}

for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
sds->pdev[i] = add_i2c_device(dev, i);
if (IS_ERR(sds->pdev[i])) {
ret = PTR_ERR(sds->pdev[i]);
while (--i >= 0)
platform_device_unregister(sds->pdev[i]);
goto err_dev_add;
Expand Down
60 changes: 45 additions & 15 deletions trunk/drivers/i2c/busses/i2c-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,30 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)

/* Rounds down to not include partial word at the end of buf */
words_to_transfer = buf_remaining / BYTES_PER_FIFO_WORD;
if (words_to_transfer > tx_fifo_avail)
words_to_transfer = tx_fifo_avail;

i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);

buf += words_to_transfer * BYTES_PER_FIFO_WORD;
buf_remaining -= words_to_transfer * BYTES_PER_FIFO_WORD;
tx_fifo_avail -= words_to_transfer;
/* It's very common to have < 4 bytes, so optimize that case. */
if (words_to_transfer) {
if (words_to_transfer > tx_fifo_avail)
words_to_transfer = tx_fifo_avail;

/*
* Update state before writing to FIFO. If this casues us
* to finish writing all bytes (AKA buf_remaining goes to 0) we
* have a potential for an interrupt (PACKET_XFER_COMPLETE is
* not maskable). We need to make sure that the isr sees
* buf_remaining as 0 and doesn't call us back re-entrantly.
*/
buf_remaining -= words_to_transfer * BYTES_PER_FIFO_WORD;
tx_fifo_avail -= words_to_transfer;
i2c_dev->msg_buf_remaining = buf_remaining;
i2c_dev->msg_buf = buf +
words_to_transfer * BYTES_PER_FIFO_WORD;
barrier();

i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);

buf += words_to_transfer * BYTES_PER_FIFO_WORD;
}

/*
* If there is a partial word at the end of buf, handle it manually to
Expand All @@ -287,14 +303,15 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)
if (tx_fifo_avail > 0 && buf_remaining > 0) {
BUG_ON(buf_remaining > 3);
memcpy(&val, buf, buf_remaining);

/* Again update before writing to FIFO to make sure isr sees. */
i2c_dev->msg_buf_remaining = 0;
i2c_dev->msg_buf = NULL;
barrier();

i2c_writel(i2c_dev, val, I2C_TX_FIFO);
buf_remaining = 0;
tx_fifo_avail--;
}

BUG_ON(tx_fifo_avail > 0 && buf_remaining > 0);
i2c_dev->msg_buf_remaining = buf_remaining;
i2c_dev->msg_buf = buf;
return 0;
}

Expand Down Expand Up @@ -411,9 +428,10 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
tegra_i2c_mask_irq(i2c_dev, I2C_INT_TX_FIFO_DATA_REQ);
}

if ((status & I2C_INT_PACKET_XFER_COMPLETE) &&
!i2c_dev->msg_buf_remaining)
if (status & I2C_INT_PACKET_XFER_COMPLETE) {
BUG_ON(i2c_dev->msg_buf_remaining);
complete(&i2c_dev->msg_complete);
}

i2c_writel(i2c_dev, status, I2C_INT_STATUS);
if (i2c_dev->is_dvc)
Expand Down Expand Up @@ -531,7 +549,7 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],

static u32 tegra_i2c_func(struct i2c_adapter *adap)
{
return I2C_FUNC_I2C;
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
}

static const struct i2c_algorithm tegra_i2c_algo = {
Expand Down Expand Up @@ -719,6 +737,17 @@ static int tegra_i2c_resume(struct platform_device *pdev)
}
#endif

#if defined(CONFIG_OF)
/* Match table for of_platform binding */
static const struct of_device_id tegra_i2c_of_match[] __devinitconst = {
{ .compatible = "nvidia,tegra20-i2c", },
{},
};
MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);
#else
#define tegra_i2c_of_match NULL
#endif

static struct platform_driver tegra_i2c_driver = {
.probe = tegra_i2c_probe,
.remove = tegra_i2c_remove,
Expand All @@ -729,6 +758,7 @@ static struct platform_driver tegra_i2c_driver = {
.driver = {
.name = "tegra-i2c",
.owner = THIS_MODULE,
.of_match_table = tegra_i2c_of_match,
},
};

Expand Down
18 changes: 10 additions & 8 deletions trunk/drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,9 @@ static void build_inv_all(struct iommu_cmd *cmd)
* Writes the command to the IOMMUs command buffer and informs the
* hardware about the new command.
*/
static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
static int iommu_queue_command_sync(struct amd_iommu *iommu,
struct iommu_cmd *cmd,
bool sync)
{
u32 left, tail, head, next_tail;
unsigned long flags;
Expand Down Expand Up @@ -639,13 +641,18 @@ static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
copy_cmd_to_buffer(iommu, cmd, tail);

/* We need to sync now to make sure all commands are processed */
iommu->need_sync = true;
iommu->need_sync = sync;

spin_unlock_irqrestore(&iommu->lock, flags);

return 0;
}

static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
{
return iommu_queue_command_sync(iommu, cmd, true);
}

/*
* This function queues a completion wait command into the command
* buffer of an IOMMU
Expand All @@ -661,7 +668,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu)

build_completion_wait(&cmd, (u64)&sem);

ret = iommu_queue_command(iommu, &cmd);
ret = iommu_queue_command_sync(iommu, &cmd, false);
if (ret)
return ret;

Expand Down Expand Up @@ -840,14 +847,9 @@ static void domain_flush_complete(struct protection_domain *domain)
static void domain_flush_devices(struct protection_domain *domain)
{
struct iommu_dev_data *dev_data;
unsigned long flags;

spin_lock_irqsave(&domain->lock, flags);

list_for_each_entry(dev_data, &domain->dev_list, list)
device_flush_dte(dev_data);

spin_unlock_irqrestore(&domain->lock, flags);
}

/****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mtd/ubi/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static inline int ubi_dbg_is_erase_failure(const struct ubi_device *ubi)

#define ubi_dbg_msg(fmt, ...) do { \
if (0) \
pr_debug(fmt "\n", ##__VA_ARGS__); \
printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
} while (0)

#define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/rtc/rtc-ep93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
*/
struct ep93xx_rtc {
void __iomem *mmio_base;
struct rtc_device *rtc;
};

static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload,
Expand Down Expand Up @@ -130,7 +131,6 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
{
struct ep93xx_rtc *ep93xx_rtc;
struct resource *res;
struct rtc_device *rtc;
int err;

ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL);
Expand All @@ -151,12 +151,12 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return -ENXIO;

pdev->dev.platform_data = ep93xx_rtc;
platform_set_drvdata(pdev, rtc);
platform_set_drvdata(pdev, ep93xx_rtc);

rtc = rtc_device_register(pdev->name,
ep93xx_rtc->rtc = rtc_device_register(pdev->name,
&pdev->dev, &ep93xx_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) {
err = PTR_ERR(rtc);
if (IS_ERR(ep93xx_rtc->rtc)) {
err = PTR_ERR(ep93xx_rtc->rtc);
goto exit;
}

Expand All @@ -167,7 +167,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return 0;

fail:
rtc_device_unregister(rtc);
rtc_device_unregister(ep93xx_rtc->rtc);
exit:
platform_set_drvdata(pdev, NULL);
pdev->dev.platform_data = NULL;
Expand All @@ -176,11 +176,11 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)

static int __exit ep93xx_rtc_remove(struct platform_device *pdev)
{
struct rtc_device *rtc = platform_get_drvdata(pdev);
struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);

sysfs_remove_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
platform_set_drvdata(pdev, NULL);
rtc_device_unregister(rtc);
rtc_device_unregister(ep93xx_rtc->rtc);
pdev->dev.platform_data = NULL;

return 0;
Expand Down
Loading

0 comments on commit 9b318b9

Please sign in to comment.