From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiang Liu Subject: Re: [Patch Part1 V2 07/20] iommu/vt-d, trivial: check suitable flag in function detect_intel_iommu() Date: Mon, 06 Jan 2014 13:52:17 +0800 Message-ID: <52CA4491.6020009@linux.intel.com> References: <1386300083-6882-1-git-send-email-jiang.liu@linux.intel.com> <1386300083-6882-8-git-send-email-jiang.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6560950962842730092==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Kai Huang Cc: Tony Luck , Jiri Kosina , Vinod Koul , Yinghai Lu , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dan Williams , David Woodhouse List-Id: iommu@lists.linux-foundation.org This is a multi-part message in MIME format. --===============6560950962842730092== Content-Type: multipart/alternative; boundary="------------010107020308070504060302" This is a multi-part message in MIME format. --------------010107020308070504060302 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > On Fri, Dec 6, 2013 at 11:21 AM, Jiang Liu > wrote: > > Flag irq_remapping_enabled is only set by > intel_enable_irq_remapping(), > which is called after detect_intel_iommu(). So we should check flag > disable_irq_remap instead of irq_remapping_enabled in function > detect_intel_iommu(). > > Reviewed-by: Yijing Wang > > Signed-off-by: Jiang Liu > > --- > drivers/iommu/dmar.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c > index c17dbf7..70612a9 100644 > --- a/drivers/iommu/dmar.c > +++ b/drivers/iommu/dmar.c > @@ -560,7 +560,7 @@ int __init detect_intel_iommu(void) > > dmar = (struct acpi_table_dmar *) dmar_tbl; > > - if (ret && irq_remapping_enabled && cpu_has_x2apic && > + if (ret && !disable_irq_remap && cpu_has_x2apic && > dmar->flags & 0x1) > pr_info("Queued invalidation will be > enabled to support x2apic and Intr-remapping.\n"); > > > Then is it better to move this pr_info code > to intel_enable_irq_remapping? Hi Kai, Good suggestion! Will try it. Thanks! Gerry > > > -- > 1.7.10.4 > > -- > To unsubscribe from this list: send the line "unsubscribe > linux-pci" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > --------------010107020308070504060302 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On Fri, Dec 6, 2013 at 11:21 AM, Jiang Liu <jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
Flag irq_remapping_enabled is only set by intel_enable_irq_remapping(),
which is called after detect_intel_iommu(). So we should check flag
disable_irq_remap instead of irq_remapping_enabled in function
detect_intel_iommu().

Reviewed-by: Yijing Wang <wangyijing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jiang Liu <jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/iommu/dmar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index c17dbf7..70612a9 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -560,7 +560,7 @@ int __init detect_intel_iommu(void)

                dmar = (struct acpi_table_dmar *) dmar_tbl;

-               if (ret && irq_remapping_enabled && cpu_has_x2apic &&
+               if (ret && !disable_irq_remap && cpu_has_x2apic &&
                    dmar->flags & 0x1)
                        pr_info("Queued invalidation will be enabled to support x2apic and Intr-remapping.\n");

Then is it better to move this pr_info code to intel_enable_irq_remapping?
Hi Kai,
    Good suggestion! Will try it.
Thanks!
Gerry



--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--------------010107020308070504060302-- --===============6560950962842730092== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6560950962842730092==--