From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v2 1/2] VT-d: Reduce spin timeout to 1ms, which can be boot-time changed. Date: Fri, 11 Dec 2015 03:01:29 -0700 Message-ID: <566AAD0902000078000BE8C5@prv-mh.provo.novell.com> References: <1449739990-66155-1-git-send-email-quan.xu@intel.com> <1449739990-66155-2-git-send-email-quan.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1449739990-66155-2-git-send-email-quan.xu@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Quan Xu Cc: tim@xen.org, kevin.tian@intel.com, feng.wu@intel.com, george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 10.12.15 at 10:33, wrote: > @@ -167,10 +172,12 @@ static int queue_invalidate_wait(struct iommu *iommu, > start_time = NOW(); > while ( poll_slot != QINVAL_STAT_DONE ) > { > - if ( NOW() > (start_time + DMAR_OPERATION_TIMEOUT) ) > + if ( NOW() > (start_time + IOMMU_QI_TIMEOUT) ) > { > print_qi_regs(iommu); > - panic("queue invalidate wait descriptor was not executed"); > + dprintk(XENLOG_WARNING VTDPREFIX, > + "Queue invalidate wait descriptor was timeout.\n"); > + return -ETIMEDOUT; > } I don't see such a change be valid without making sure callers actually honor errors. For example, no caller of iommu_flush_iec_{global,index}() cares to check. And not even your second patch addresses this (i.e. it's also not just bad patch ordering). If you require errors to be dealt with (and you do here), make use of __must_check all the way up the call trees. Jan