Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755628Ab0GGRsA (ORCPT ); Wed, 7 Jul 2010 13:48:00 -0400 Received: from mga09.intel.com ([134.134.136.24]:55635 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753537Ab0GGRr6 (ORCPT ); Wed, 7 Jul 2010 13:47:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,554,1272870000"; d="scan'208";a="533308535" Message-ID: <4C34BDCD.9080607@intel.com> Date: Wed, 07 Jul 2010 10:47:57 -0700 From: Dan Williams User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: David Woodhouse CC: Chris Li , linux-kernel Subject: Re: BUG in drivers/dma/ioat/dma_v2.c:314 References: <4C2A8879.8010000@intel.com> <4C2AC55E.3040303@intel.com> <1277923422.16256.8.camel@localhost> <4C2B9DAC.1030806@intel.com> <1277928125.18854.0.camel@localhost> <4C2BBACF.3080405@intel.com> <1277965264.18854.16.camel@localhost> <4C2C3B07.7050200@intel.com> <1277968336.4945.3.camel@localhost> <4C2C4319.6090906@intel.com> <1277972137.12558.2.camel@localhost> <4C2CCE67.6070600@intel.com> <1278324973.16975.68.camel@localhost> <1278463901.20082.34.camel@dwillia2-linux> <1278474039.31393.8.camel@localhost> In-Reply-To: <1278474039.31393.8.camel@localhost> Content-Type: multipart/mixed; boundary="------------020807060301020608080900" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7386 Lines: 125 This is a multi-part message in MIME format. --------------020807060301020608080900 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/6/2010 8:40 PM, David Woodhouse wrote: > On Tue, 2010-07-06 at 17:51 -0700, Dan Williams wrote: >> It should always trigger, and I have verified as much with the attached >> replacement patch (by forcing the error on a working system), but we run >> into a new problem. >> >> IOMMU: can't find DMAR for device 0000:00:0f.0 >> Allocating domain for 0000:00:0f.0 failed > > Yeah, we're actually doing the check in the wrong place. This should > work better, I think. > Ok. Chris this change will make the driver's dma mapping calls succeed which means we once again need to be prepared for the case where the engine's iommu is not configured correctly. Attached is David's latest combined with the driver error handling from v1. The expectation is that this reports the BIOS misconfiguration each boot and the driver fails cleanly if its transactions are blocked. Thanks for going through these iterations. -- Dan --------------020807060301020608080900 Content-Type: text/plain; name="ioat-catch-broken-vtd-v3.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ioat-catch-broken-vtd-v3.patch" ZGlmZiAtLWdpdCBhL2RyaXZlcnMvZG1hL2lvYXQvZG1hLmggYi9kcml2ZXJzL2RtYS9pb2F0 L2RtYS5oCmluZGV4IDZkM2E3M2IuLjUyMTZjOGEgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvZG1h L2lvYXQvZG1hLmgKKysrIGIvZHJpdmVycy9kbWEvaW9hdC9kbWEuaApAQCAtOTcsNiArOTcs NyBAQCBzdHJ1Y3QgaW9hdF9jaGFuX2NvbW1vbiB7CiAJI2RlZmluZSBJT0FUX1JFU0VUX1BF TkRJTkcgMgogCSNkZWZpbmUgSU9BVF9LT0JKX0lOSVRfRkFJTCAzCiAJI2RlZmluZSBJT0FU X1JFU0hBUEVfUEVORElORyA0CisJI2RlZmluZSBJT0FUX1JVTiA1CiAJc3RydWN0IHRpbWVy X2xpc3QgdGltZXI7CiAJI2RlZmluZSBDT01QTEVUSU9OX1RJTUVPVVQgbXNlY3NfdG9famlm ZmllcygxMDApCiAJI2RlZmluZSBJRExFX1RJTUVPVVQgbXNlY3NfdG9famlmZmllcygyMDAw KQpkaWZmIC0tZ2l0IGEvZHJpdmVycy9kbWEvaW9hdC9kbWFfdjIuYyBiL2RyaXZlcnMvZG1h L2lvYXQvZG1hX3YyLmMKaW5kZXggM2M4YjMyYS4uNzc5ZjRkYSAxMDA2NDQKLS0tIGEvZ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kKSB7CisJCWlmICghZHJoZC0+aW5jbHVkZV9hbGwpCisJCQlj b250aW51ZTsKKwkJZm9yIChpID0gMDsgaSA8IGRyaGQtPmRldmljZXNfY250OyBpKyspIHsK KwkJCWlmIChkcmhkLT5kZXZpY2VzW2ldID09IHBkZXYpIHsKKwkJCQlXQVJOX1RBSU5UX09O Q0UoMSwgVEFJTlRfRklSTVdBUkVfV09SS0FST1VORCwKKwkJCQkJCSJCSU9TIHdyb25nbHkg aW5jbHVkZWQgSS9PQVQgZGV2aWNlIHVuZGVyIGNhdGNoLWFsbCBWVC1kIHVuaXRcbiIpOwor CQkJCXBkZXYtPmRldi5hcmNoZGF0YS5pb21tdSA9IERVTU1ZX0RFVklDRV9ET01BSU5fSU5G TzsKKwkJCQlyZXR1cm47CisJCQl9CisJCX0KKwl9Cit9CitERUNMQVJFX1BDSV9GSVhVUF9F TkFCTEUoUENJX1ZFTkRPUl9JRF9JTlRFTCwgUENJX0RFVklDRV9JRF9JTlRFTF9JT0FUX1NO QiwgcXVpcmtfaW9hdF9zbmJfbm9fY2F0Y2hhbGwpOworCiBzdGF0aWMgdm9pZCBfX2luaXQg aW5pdF9ub19yZW1hcHBpbmdfZGV2aWNlcyh2b2lkKQogewogCXN0cnVjdCBkbWFyX2RyaGRf dW5pdCAqZHJoZDsK --------------020807060301020608080900-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/