Commit 3ac8c70f authored by Dave Olson's avatar Dave Olson Committed by Roland Dreier

IB/ipath: Minor fix to ordering of freeing and zeroing of tid pages.

Fixed to be the same as everywhere else.  copy and then zero the page *
in the array first, and then pass the copy to the VM routines.
Signed-off-by: default avatarDave Olson <dave.olson@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent bda94e32
...@@ -538,6 +538,9 @@ static int ipath_tid_free(struct ipath_portdata *pd, unsigned subport, ...@@ -538,6 +538,9 @@ static int ipath_tid_free(struct ipath_portdata *pd, unsigned subport,
continue; continue;
cnt++; cnt++;
if (dd->ipath_pageshadow[porttid + tid]) { if (dd->ipath_pageshadow[porttid + tid]) {
struct page *p;
p = dd->ipath_pageshadow[porttid + tid];
dd->ipath_pageshadow[porttid + tid] = NULL;
ipath_cdbg(VERBOSE, "PID %u freeing TID %u\n", ipath_cdbg(VERBOSE, "PID %u freeing TID %u\n",
pd->port_pid, tid); pd->port_pid, tid);
dd->ipath_f_put_tid(dd, &tidbase[tid], dd->ipath_f_put_tid(dd, &tidbase[tid],
...@@ -546,9 +549,7 @@ static int ipath_tid_free(struct ipath_portdata *pd, unsigned subport, ...@@ -546,9 +549,7 @@ static int ipath_tid_free(struct ipath_portdata *pd, unsigned subport,
pci_unmap_page(dd->pcidev, pci_unmap_page(dd->pcidev,
dd->ipath_physshadow[porttid + tid], dd->ipath_physshadow[porttid + tid],
PAGE_SIZE, PCI_DMA_FROMDEVICE); PAGE_SIZE, PCI_DMA_FROMDEVICE);
ipath_release_user_pages( ipath_release_user_pages(&p, 1);
&dd->ipath_pageshadow[porttid + tid], 1);
dd->ipath_pageshadow[porttid + tid] = NULL;
ipath_stats.sps_pageunlocks++; ipath_stats.sps_pageunlocks++;
} else } else
ipath_dbg("Unused tid %u, ignoring\n", tid); ipath_dbg("Unused tid %u, ignoring\n", tid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment