infiniband: few MTRR fixes and conversions
Subsystems (2)
v3 cover infiniband: few MTRR fixes and conversions
From: "Luis R. Rodriguez" <[email protected]>
Infiniband has a few MTRR uses which from the looks of it was first written on the ipath driver, later copied and pasted on the qib driver. The behaviour of not counting is matched on both drivers but with no good reason, since we want to generalize use of MTRR in order to actually phase it, fix the driver to use accounting as all other kernel users and also convert the qib driver to arch_phys_wc_add().
The ipath driver is left without conversion to arch_phys_wc_add().
Luis R. Rodriguez (3):
IB/qib: add acounting for MTRR
IB/qib: use arch_phys_wc_add()
IB/ipath: add counting for MTRR
drivers/infiniband/hw/ipath/ipath_wc_x86_64.c | 2 +- drivers/infiniband/hw/qib/qib_wc_x86_64.c | 31 ++++----------------------- 2 files changed, 5 insertions(+), 28 deletions(-)
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
PATCH v3 1/3 IB/qib: add acounting for MTRR
From: "Luis R. Rodriguez" <[email protected]>
There is no good reason not to, we eventually delete it as well.
--- drivers/infiniband/hw/qib/qib_wc_x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qib/qib_wc_x86_64.c +1 -1
@@ -118,7 +118,7 @@ int qib_enable_wc(struct qib_devdata *dd)if (!ret) {int cookie; - cookie =mtrr_add (pioaddr, piolen,MTRR_TYPE_WRCOMB ,0 ); + cookie =mtrr_add (pioaddr, piolen,MTRR_TYPE_WRCOMB ,1 );if (cookie <0 ) { { qib_devinfo(dd->pcidev,
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
PATCH v3 2/3 IB/qib: use arch_phys_wc_add()
In reply to Luis R. RodriguezFrom: "Luis R. Rodriguez" <[email protected]>
This driver already makes use of ioremap_wc() on PIO buffers, so convert it to use arch_phys_wc_add().
--- drivers/infiniband/hw/qib/qib_wc_x86_64.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-)
drivers/infiniband/hw/qib/qib_wc_x86_64.c +4 -27
@@ -116,21 +116,9 @@ int qib_enable_wc(struct qib_devdata *dd) }if (!ret) { -int cookie; - - cookie =mtrr_add (pioaddr, piolen,MTRR_TYPE_WRCOMB ,1 ); -if (cookie <0 ) { - { -qib_devinfo (dd->pcidev, -"mtrr_add() WC for PIO bufs failed (%d)\n" , - cookie); - ret = -EINVAL ; - } - }else { - dd->wc_cookie = cookie; - dd->wc_base = (unsigned long ) pioaddr; - dd->wc_len = (unsigned long ) piolen; - } + dd->wc_cookie =arch_phys_wc_add (pioaddr, piolen); +if (dd->wc_cookie <0 ) + ret = -EINVAL ; }return ret;
@@ -142,18 +130,7 @@ int qib_enable_wc(struct qib_devdata *dd)*/ void qib_disable_wc (struct qib_devdata *dd) { -if (dd->wc_cookie) { -int r; - - r =mtrr_del (dd->wc_cookie, dd->wc_base, - dd->wc_len); -if (r <0 ) -qib_devinfo (dd->pcidev, -"mtrr_del(%lx, %lx, %lx) failed: %d\n" , - dd->wc_cookie, dd->wc_base, - dd->wc_len, r); - dd->wc_cookie =0 ;/* even on failure */ - } +arch_phys_wc_del (dd->wc_cookie); }/**
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
PATCH v3 3/3 IB/ipath: add counting for MTRR
In reply to Luis R. RodriguezFrom: "Luis R. Rodriguez" <[email protected]>
There is no good reason not to, we eventually delete it as well.
--- drivers/infiniband/hw/ipath/ipath_wc_x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ipath/ipath_wc_x86_64.c +1 -1
@@ -127,7 +127,7 @@ int ipath_enable_wc(struct ipath_devdata *dd)"(addr %llx, len=0x%llx)\n" , (unsigned long long ) pioaddr, (unsigned long long) piolen); - cookie =mtrr_add (pioaddr, piolen,MTRR_TYPE_WRCOMB ,0 ); + cookie =mtrr_add (pioaddr, piolen,MTRR_TYPE_WRCOMB ,1 );if (cookie <0 ) { { dev_info(&dd->pcidev->dev,
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
Re: [PATCH v3 2/3] IB/qib: use arch_phys_wc_add()
In reply to Luis R. RodriguezQuoted 4 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <[email protected]>
This driver already makes use of
ioremap_wc()on PIO buffers, so convert it to usearch_phys_wc_add().
This is probably OK, but I think you should also remove the qib_wc_pat module parameter.
Jason
RE: [PATCH v3 2/3] IB/qib: use arch_phys_wc_add()
Quoted 7 lines
Quoted 2 lines
This driver already makes use of
ioremap_wc()on PIO buffers, so convert it to usearch_phys_wc_add().This is probably OK, but I think you should also remove the
qib_wc_patmodule parameter.Jason
Revise based on Jason's request and I will do some testing.
Mike
Re: [PATCH v3 2/3] IB/qib: use arch_phys_wc_add()
Quoted 9 lines · Mike
Quoted 7 lines
Quoted 2 lines
This driver already makes use of
ioremap_wc()on PIO buffers, so convert it to usearch_phys_wc_add().This is probably OK, but I think you should also remove the
qib_wc_patmodule parameter.Jason
Revise based on Jason's request and I will do some testing.
I did thiink about this -- but removal of module parameters can often times break users of the module parameter, I figured its best to leave it to you guys to decide what to do with that, so this leaves it as a no-op. Can this series be applied and then you can decide what to do to not affect your users on top of this?
Luis
Re: [PATCH v3 2/3] IB/qib: use arch_phys_wc_add()
Quoted 10 lines · Luis R. Rodriguez
Quoted 8 lines · Mike
Quoted 7 lines
Quoted 2 lines
This driver already makes use of
ioremap_wc()on PIO buffers, so convert it to usearch_phys_wc_add().This is probably OK, but I think you should also remove the
qib_wc_patmodule parameter.Jason
Quoted 7 lines
Quoted 1 line
Revise based on Jason's request and I will do some testing.
I did thiink about this -- but removal of module parameters can often times break users of the module parameter, I figured its best to leave it to you guys to decide what to do with that, so this leaves it as a no-op. Can this series be applied and then you can decide what to do to not affect your users on top of this?
As of a few kernel versions ago, unrecognized module parameters no longer cause the module to refuse to load.
--Andy
Quoted 2 lines
Luis
Signature · 2 lines
Andy Lutomirski AMA Capital Management, LLC
Re: [PATCH v3 2/3] IB/qib: use arch_phys_wc_add()
Quoted 14 lines · Andy Lutomirski
Quoted 12 lines · Luis R. Rodriguez
Quoted 9 lines · Mike
Quoted 7 lines
Quoted 2 lines
This driver already makes use of
ioremap_wc()on PIO buffers, so convert it to usearch_phys_wc_add().This is probably OK, but I think you should also remove the
qib_wc_patmodule parameter.Jason
Revise based on Jason's request and I will do some testing.
Quoted 8 lines
Quoted 5 lines
I did thiink about this -- but removal of module parameters can often times break users of the module parameter, I figured its best to leave it to you guys to decide what to do with that, so this leaves it as a no-op. Can this series be applied and then you can decide what to do to not affect your users on top of this?
As of a few kernel versions ago, unrecognized module parameters no longer cause the module to refuse to load.
Sexy, I'll respin the changes only to the qib driver. Can the changes to ipath still be applied?
Luis