Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206718
b: refs/heads/master
c: dccb816
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and Roland Dreier committed Jul 21, 2010
1 parent 93adf91 commit 1d89cbc
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 44 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: 2db00321815e20f4a7ff9df43f7cf2073085683d
refs/heads/master: dccb816de38efe72becc5d7f90a5dfedcd6fd053
8 changes: 4 additions & 4 deletions trunk/drivers/infiniband/hw/ehca/ehca_eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,21 @@ int ehca_create_eq(struct ehca_shca *shca,

/* register interrupt handlers and initialize work queues */
if (type == EHCA_EQ) {
tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);

ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
IRQF_DISABLED, "ehca_eq",
(void *)shca);
if (ret < 0)
ehca_err(ib_dev, "Can't map interrupt handler.");
} else if (type == EHCA_NEQ) {
tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);

tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
} else if (type == EHCA_NEQ) {
ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
IRQF_DISABLED, "ehca_neq",
(void *)shca);
if (ret < 0)
ehca_err(ib_dev, "Can't map interrupt handler.");

tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
}

eq->is_initialized = 1;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/infiniband/hw/ehca/ehca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
* a firmware property, so it's valid across all adapters
*/
if (ehca_lock_hcalls == -1)
ehca_lock_hcalls = !EHCA_BMASK_GET(HCA_CAP_H_ALLOC_RES_SYNC,
shca->hca_cap);
ehca_lock_hcalls = !(shca->hca_cap & HCA_CAP_H_ALLOC_RES_SYNC);

/* translate supported MR page sizes; always support 4K */
shca->hca_cap_mr_pgsize = EHCA_PAGESIZE;
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/infiniband/hw/ehca/ehca_mrmw.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,11 @@ int ehca_unmap_fmr(struct list_head *fmr_list)
/* check all FMR belong to same SHCA, and check internal flag */
list_for_each_entry(ib_fmr, fmr_list, list) {
prev_shca = shca;
if (!ib_fmr) {
ehca_gen_err("bad fmr=%p in list", ib_fmr);
ret = -EINVAL;
goto unmap_fmr_exit0;
}
shca = container_of(ib_fmr->device, struct ehca_shca,
ib_device);
e_fmr = container_of(ib_fmr, struct ehca_mr, ib.ib_fmr);
Expand Down
32 changes: 4 additions & 28 deletions trunk/drivers/infiniband/hw/ehca/hcp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle,
struct ehca_cq *cq,
struct ehca_alloc_cq_parms *param)
{
int rc;
u64 ret;
unsigned long outs[PLPAR_HCALL9_BUFSIZE];

Expand All @@ -284,19 +283,8 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle,
param->act_nr_of_entries = (u32)outs[3];
param->act_pages = (u32)outs[4];

if (ret == H_SUCCESS) {
rc = hcp_galpas_ctor(&cq->galpas, 0, outs[5], outs[6]);
if (rc) {
ehca_gen_err("Could not establish HW access. rc=%d paddr=%#lx",
rc, outs[5]);

ehca_plpar_hcall_norets(H_FREE_RESOURCE,
adapter_handle.handle, /* r4 */
cq->ipz_cq_handle.handle, /* r5 */
0, 0, 0, 0, 0);
ret = H_NO_MEM;
}
}
if (ret == H_SUCCESS)
hcp_galpas_ctor(&cq->galpas, 0, outs[5], outs[6]);

if (ret == H_NOT_ENOUGH_RESOURCES)
ehca_gen_err("Not enough resources. ret=%lli", ret);
Expand All @@ -307,7 +295,6 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle,
u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle,
struct ehca_alloc_qp_parms *parms, int is_user)
{
int rc;
u64 ret;
u64 allocate_controls, max_r10_reg, r11, r12;
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
Expand Down Expand Up @@ -371,19 +358,8 @@ u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle,
parms->rqueue.queue_size =
(u32)EHCA_BMASK_GET(H_ALL_RES_QP_RQUEUE_SIZE_PAGES, outs[4]);

if (ret == H_SUCCESS) {
rc = hcp_galpas_ctor(&parms->galpas, is_user, outs[6], outs[6]);
if (rc) {
ehca_gen_err("Could not establish HW access. rc=%d paddr=%#lx",
rc, outs[6]);

ehca_plpar_hcall_norets(H_FREE_RESOURCE,
adapter_handle.handle, /* r4 */
parms->qp_handle.handle, /* r5 */
0, 0, 0, 0, 0);
ret = H_NO_MEM;
}
}
if (ret == H_SUCCESS)
hcp_galpas_ctor(&parms->galpas, is_user, outs[6], outs[6]);

if (ret == H_NOT_ENOUGH_RESOURCES)
ehca_gen_err("Not enough resources. ret=%lli", ret);
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/infiniband/hw/ehca/hcp_phyp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@
#include "ehca_classes.h"
#include "hipz_hw.h"

u64 hcall_map_page(u64 physaddr)
int hcall_map_page(u64 physaddr, u64 *mapaddr)
{
return (u64)ioremap(physaddr, EHCA_PAGESIZE);
*mapaddr = (u64)(ioremap(physaddr, EHCA_PAGESIZE));
return 0;
}

int hcall_unmap_page(u64 mapaddr)
Expand All @@ -57,9 +58,9 @@ int hcp_galpas_ctor(struct h_galpas *galpas, int is_user,
u64 paddr_kernel, u64 paddr_user)
{
if (!is_user) {
galpas->kernel.fw_handle = hcall_map_page(paddr_kernel);
if (!galpas->kernel.fw_handle)
return -ENOMEM;
int ret = hcall_map_page(paddr_kernel, &galpas->kernel.fw_handle);
if (ret)
return ret;
} else
galpas->kernel.fw_handle = 0;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/ehca/hcp_phyp.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int hcp_galpas_ctor(struct h_galpas *galpas, int is_user,

int hcp_galpas_dtor(struct h_galpas *galpas);

u64 hcall_map_page(u64 physaddr);
int hcall_map_page(u64 physaddr, u64 * mapaddr);

int hcall_unmap_page(u64 mapaddr);

Expand Down
13 changes: 10 additions & 3 deletions trunk/drivers/infiniband/hw/ipath/ipath_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ static void ipath_verify_pioperf(struct ipath_devdata *dd)
ipath_enable_armlaunch(dd);
}

static void cleanup_device(struct ipath_devdata *dd);

static int __devinit ipath_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
Expand Down Expand Up @@ -616,8 +618,13 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
goto bail;

bail_irqsetup:
if (pdev->irq)
free_irq(pdev->irq, dd);
cleanup_device(dd);

if (dd->ipath_irq)
dd->ipath_f_free_irq(dd);

if (dd->ipath_f_cleanup)
dd->ipath_f_cleanup(dd);

bail_iounmap:
iounmap((volatile void __iomem *) dd->ipath_kregbase);
Expand All @@ -635,7 +642,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
return ret;
}

static void __devexit cleanup_device(struct ipath_devdata *dd)
static void cleanup_device(struct ipath_devdata *dd)
{
int port;
struct ipath_portdata **tmp;
Expand Down

0 comments on commit 1d89cbc

Please sign in to comment.