IB/ipath: use arch_phys_wc_add() and require PAT disabled
Subsystems (2)
PATCH 1/1 IB/ipath: use arch_phys_wc_add() and require PAT disabled
From: "Luis R. Rodriguez" <[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of ioremap_nocache() to use strong UC, use of mtrr_add() on those systems would make write-combining void.
In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to arch_phys_wc_add() and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.
This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
--- drivers/infiniband/hw/ipath/Kconfig | 3 ++ drivers/infiniband/hw/ipath/ipath_driver.c | 18 +++++++---- drivers/infiniband/hw/ipath/ipath_kernel.h | 4 +-- drivers/infiniband/hw/ipath/ipath_wc_x86_64.c | 43 ++++++--------------------- 4 files changed, 26 insertions(+), 42 deletions(-)
drivers/infiniband/hw/ipath/Kconfig +3 -0
@@ -9,3 +9,6 @@ config INFINIBAND_IPATH as IP-over-InfiniBand as well as with userspace applications (in conjunction with InfiniBand userspace access). For QLogic PCIe QLE based cards, use the QIB driver instead. + + If you have this hardware you will need to boot with PAT disabled + on your x86-64 systems, use the nopat kernel parameter.
drivers/infiniband/hw/ipath/ipath_driver.c +13 -5
@@ -42,6 +42,9 @@#include <linux/bitmap.h> #include <linux/slab.h> #include <linux/module.h> +#ifdef CONFIG_X86_64 +#include <asm/pat.h> +#endif #include "ipath_kernel.h" #include "ipath_verbs.h"
@@ -395,6 +398,14 @@ static int ipath_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)unsigned long long addr;u32 bar0 =0 , bar1 =0 ; +#ifdef CONFIG_X86_64 +if (WARN (pat_enabled, +"ipath needs PAT disabled, boot with nopat kernel parameter\n" )) { + ret =EINVAL ; + goto bail; + } +#endif + dd =ipath_alloc_devdata (pdev);if (IS_ERR (dd)) { ret =PTR_ERR (dd);
@@ -542,6 +553,7 @@ static int ipath_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dd->ipath_kregbase =__ioremap (addr, len, (_PAGE_NO_CACHE|_PAGE_WRITETHRU));#else +/* XXX: split this properly to enable on PAT */ dd->ipath_kregbase =ioremap_nocache (addr, len);#endif
@@ -587,12 +599,8 @@ static int ipath_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ret =ipath_enable_wc (dd); -if (ret) { -ipath_dev_err (dd,"Write combining not enabled " -"(err %d): performance may be poor\n" , - -ret); +if (ret) ret =0 ; - }ipath_verify_pioperf (dd);
drivers/infiniband/hw/ipath/ipath_kernel.h +1 -3
@@ -463,9 +463,7 @@ struct ipath_devdata {/* offset in HT config space of slave/primary interface block */ u8 ipath_ht_slave_off;/* for write combining settings */ -unsigned long ipath_wc_cookie; -unsigned long ipath_wc_base; -unsigned long ipath_wc_len; +int wc_cookie;/* ref count for each pkey */ atomic_t ipath_pkeyrefs[4 ];/* shadow copy of struct page *'s for exp tid pages */
drivers/infiniband/hw/ipath/ipath_wc_x86_64.c +9 -34
59 lines not on this page · raw message
Signature · 1 line
2.3.2.209.gd67f9d5.dirty
Quoted 14 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of
ioremap_nocache()to use strong UC, use ofmtrr_add()on those systems would make write-combining void.In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to
arch_phys_wc_add()and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.
Quoted 7 lines
This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
Hey folks, I realize its being discussed whether or not to remove the driver entirely from the kernel but in the meantime, is this a reasonable compromise ?
Luis
A message that is not in the archive (sent off-list or not yet received): CAB=NE6UHnEuMHfFaXBNr4F=RcDcEC3z6rX8-B_10Sbpr7kHkiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 24 lines · Luis R. Rodriguez
Quoted 14 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of
ioremap_nocache()to use strong UC, use ofmtrr_add()on those systems would make write-combining void.In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to
arch_phys_wc_add()and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.Quoted 7 lines
This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
Quoted 3 lines
Hey folks, I realize its being discussed whether or not to remove the driver entirely from the kernel but in the meantime, is this a reasonable compromise ?
[ trimmed Cc: list to probably the only people that care ]
I would think so. I think we might as well mark this driver as deprecated and put a tentative date on removal while we are at it.
Mike, any specific input here? I would suggest mark it deprecated with a planned removal sometime in late 2015/early 2016.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD
A message that is not in the archive (sent off-list or not yet received): 1430159932.44548.20.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Quoted 25 lines · Doug Ledford
Quoted 24 lines · Luis R. Rodriguez
Quoted 21 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of
ioremap_nocache()to use strong UC, use ofmtrr_add()on those systems would make write-combining void.In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to
arch_phys_wc_add()and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
Quoted 7 lines
Quoted 3 lines
Hey folks, I realize its being discussed whether or not to remove the driver entirely from the kernel but in the meantime, is this a reasonable compromise ?
[ trimmed Cc: list to probably the only people that care ]
I would think so.
OK great, can this be merged then? I am waiting for this patch to help move forward with deprecating MTRR upstream.
Quoted 2 lines
I think we might as well mark this driver as
deprecated and put a tentative date on removal while we are at it.
OK great, that can be done as a separate patch.
Quoted 2 lines
Mike, any specific input here? I would suggest mark it deprecated with a planned removal sometime in late 2015/early 2016.
I will note that feature-removal file was removed from Linux so if we want to deprecate something now we just do it.
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAB=NE6Xe1GxDRdXHBu_rk6HScebNwFWoCPQe1CMH5gDC=ESfEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 30 lines · Luis R. Rodriguez
Quoted 29 lines · Doug Ledford
Quoted 27 lines · Luis R. Rodriguez
Quoted 14 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of
ioremap_nocache()to use strong UC, use ofmtrr_add()on those systems would make write-combining void.In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to
arch_phys_wc_add()and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.Quoted 7 lines
This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
Hey folks, I realize its being discussed whether or not to remove the driver entirely from the kernel but in the meantime, is this a reasonable compromise ?
Quoted 6 lines
Quoted 3 lines
[ trimmed Cc: list to probably the only people that care ]
I would think so.
OK great, can this be merged then? I am waiting for this patch to help move forward with deprecating MTRR upstream.
I'm generally OK with picking this up and merging it in. However, it relies on pat_enabled being an exported symbol, and that isn't the case. Are you submitting an additional patch via a different tree to make that symbol exported to modules?
Quoted 16 lines
Quoted 2 lines
I think we might as well mark this driver as
deprecated and put a tentative date on removal while we are at it.OK great, that can be done as a separate patch.
Quoted 2 lines
Mike, any specific input here? I would suggest mark it deprecated with a planned removal sometime in late 2015/early 2016.
I will note that feature-removal file was removed from Linux so if we want to deprecate something now we just do it.
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD
A message that is not in the archive (sent off-list or not yet received): 1430326665.102408.25.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Quoted 35 lines · Doug Ledford
Quoted 34 lines · Luis R. Rodriguez
Quoted 32 lines · Doug Ledford
Quoted 24 lines · Luis R. Rodriguez
Quoted 14 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of
ioremap_nocache()to use strong UC, use ofmtrr_add()on those systems would make write-combining void.In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to
arch_phys_wc_add()and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.Quoted 7 lines
This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
Quoted 3 lines
Hey folks, I realize its being discussed whether or not to remove the driver entirely from the kernel but in the meantime, is this a reasonable compromise ?
[ trimmed Cc: list to probably the only people that care ]
I would think so.
Quoted 7 lines
Quoted 2 lines
OK great, can this be merged then? I am waiting for this patch to help move forward with deprecating MTRR upstream.
I'm generally OK with picking this up and merging it in. However, it relies on
pat_enabledbeing an exported symbol, and that isn't the case. Are you submitting an additional patch via a different tree to make that symbol exported to modules?
Thanks for spotting that I had not but I will do so as it is also needed for ivtv. I'll submit that. This might need to go through another tree then, can I add your Acked-by ?
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAB=NE6Uf-fO=iqvvdJ6QONZuMW_OWD-dUaqF2hcspYFg2zZiig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Yes, you can add my ack
Sent from my iPhone
Quoted 46 lines · Luis R. Rodriguez
Quoted 37 lines · Doug Ledford
Quoted 35 lines · Luis R. Rodriguez
Quoted 33 lines · Doug Ledford
Quoted 25 lines · Luis R. Rodriguez
Quoted 14 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>
We are burrying direct access to MTRR code support on x86 in order to take advantage of PAT. In the future we also want to make the default behaviour of
ioremap_nocache()to use strong UC, use ofmtrr_add()on those systems would make write-combining void.In order to help both enable us to later make strong UC default and in order to phase out direct MTRR access code port the driver over to
arch_phys_wc_add()and annotate that the device driver requires systems to boot with PAT disabled, with the nopat kernel parameter.Quoted 7 lines
This is a worthy compromise given that the ipath device driver powers the old HTX bus cards that only work in AMD systems, while the newer IB/qib device driver powers all PCI-e cards. The ipath device driver is obsolete, hardware hard to find and because of this this its a reasonable compromise to make to require users of ipath to boot with nopat.
Quoted 3 lines
Hey folks, I realize its being discussed whether or not to remove the driver entirely from the kernel but in the meantime, is this a reasonable compromise ?
[ trimmed Cc: list to probably the only people that care ]
I would think so.
Quoted 7 lines
Quoted 2 lines
OK great, can this be merged then? I am waiting for this patch to help move forward with deprecating MTRR upstream.
I'm generally OK with picking this up and merging it in. However, it relies on
pat_enabledbeing an exported symbol, and that isn't the case. Are you submitting an additional patch via a different tree to make that symbol exported to modules?
Quoted 5 lines
Thanks for spotting that I had not but I will do so as it is also needed for ivtv. I'll submit that. This might need to go through another tree then, can I add your Acked-by ?
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html