Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309180
b: refs/heads/master
c: 29cdd4e
h: refs/heads/master
v: v3
  • Loading branch information
Jakub Kicinski authored and Joerg Roedel committed Apr 12, 2012
1 parent 907ffb1 commit a626bff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 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: 3d06fca8d2aa3543030e40b95f1d62f9f5a03540
refs/heads/master: 29cdd4e4ec91aae239192bb122d377d15a9d75e3
37 changes: 10 additions & 27 deletions trunk/drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,27 +450,12 @@ static void dump_command(unsigned long phys_addr)

static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
{
int type, devid, domid, flags;
volatile u32 *event = __evt;
int count = 0;
u64 address;

retry:
type = (event[1] >> EVENT_TYPE_SHIFT) & EVENT_TYPE_MASK;
devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK;
domid = (event[1] >> EVENT_DOMID_SHIFT) & EVENT_DOMID_MASK;
flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK;
address = (u64)(((u64)event[3]) << 32) | event[2];

if (type == 0) {
/* Did we hit the erratum? */
if (++count == LOOP_TIMEOUT) {
pr_err("AMD-Vi: No event written to event log\n");
return;
}
udelay(1);
goto retry;
}
u32 *event = __evt;
int type = (event[1] >> EVENT_TYPE_SHIFT) & EVENT_TYPE_MASK;
int devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK;
int domid = (event[1] >> EVENT_DOMID_SHIFT) & EVENT_DOMID_MASK;
int flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK;
u64 address = (u64)(((u64)event[3]) << 32) | event[2];

printk(KERN_ERR "AMD-Vi: Event logged [");

Expand Down Expand Up @@ -523,8 +508,6 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
default:
printk(KERN_ERR "UNKNOWN type=0x%02x]\n", type);
}

memset(__evt, 0, 4 * sizeof(u32));
}

static void iommu_poll_events(struct amd_iommu *iommu)
Expand Down Expand Up @@ -2052,20 +2035,20 @@ static int pdev_iommuv2_enable(struct pci_dev *pdev)
}

/* FIXME: Move this to PCI code */
#define PCI_PRI_TLP_OFF (1 << 15)
#define PCI_PRI_TLP_OFF (1 << 2)

bool pci_pri_tlp_required(struct pci_dev *pdev)
{
u16 status;
u16 control;
int pos;

pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos)
return false;

pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status);
pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);

return (status & PCI_PRI_TLP_OFF) ? true : false;
return (control & PCI_PRI_TLP_OFF) ? true : false;
}

/*
Expand Down
10 changes: 5 additions & 5 deletions trunk/lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,29 +430,29 @@ static struct dma_debug_entry *__dma_entry_alloc(void)
*/
static struct dma_debug_entry *dma_entry_alloc(void)
{
struct dma_debug_entry *entry = NULL;
struct dma_debug_entry *entry;
unsigned long flags;

spin_lock_irqsave(&free_entries_lock, flags);

if (list_empty(&free_entries)) {
pr_err("DMA-API: debugging out of memory - disabling\n");
global_disable = true;
goto out;
spin_unlock_irqrestore(&free_entries_lock, flags);
return NULL;
}

entry = __dma_entry_alloc();

spin_unlock_irqrestore(&free_entries_lock, flags);

#ifdef CONFIG_STACKTRACE
entry->stacktrace.max_entries = DMA_DEBUG_STACKTRACE_ENTRIES;
entry->stacktrace.entries = entry->st_entries;
entry->stacktrace.skip = 2;
save_stack_trace(&entry->stacktrace);
#endif

out:
spin_unlock_irqrestore(&free_entries_lock, flags);

return entry;
}

Expand Down

0 comments on commit a626bff

Please sign in to comment.