Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2818441pxb; Mon, 1 Nov 2021 02:26:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Ss4Yt2EYEhq8grxxFlOFefGoueEklJLBjyCJsxeP1nb9nsVvUmgvGFCA057WOqrpuYqg X-Received: by 2002:a17:907:2da3:: with SMTP id gt35mr27164270ejc.314.1635758778539; Mon, 01 Nov 2021 02:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635758778; cv=none; d=google.com; s=arc-20160816; b=F25iwng3SCZgX2QMNqMikMG4NYq4KyKU/cWGQi4KMFdoHVmxFQojHtTimvK9/HFM6h 57NIw13KDNigLPFE0YbX8X8ZBzF+D6hSS7GrhoJH/yjCH/wWQIn21hrKS3cEmQRoFI86 r/5o4yj576MhM6kRK2K/zo5zSXKLBCj2yM8OK1iZt0uE4za9N8TnjMfOUsMfcDhmpaPO 9GM5K4BhFtTvO7N2Or/D7VPdbCqEZZ4wtC7vCGAniOGZqogDK0JsJiE+Uan0+8bFkolA djTBcgos6Hh/7nks3smYPwIB0Cs7GLL8Dry1h8bAXdqPOYOn+V1DOI6QoS+RvuB73LB/ Rbpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=KGDkbx/l+IZiwdRXM63eR+DKBn3Qr8IH3zK8+wPRnZQ=; b=yC9qOkWwUg+qMoY5SzI2ejKOMt8ZrDh77wU9xO/ST6c6ywi3t50uLtFElvqF0pwMQj oDKLsdDwQLdf8EepUFbooF5KtOYFVRu02mCuJGxlHzrgUra30kI59y0KAYc2C8yebbdI nSjE8w8Kq/ZhT1EoQObfCvwmrYcc7/vl2rkHMSViWn7wHPAl1MolzlrLPUM2R+gQxrqD fZxBwLFDLMaWMX9zmZl1LkP17/f7UeNk7VVIKMC09gVsoOid9/uKL1yTTarCc5Y3DNVk T5o3iR/JIhWut/1APx4A63pPPVsdrCkLO5sSiLLsqXJ+25J0u4KzAinFY6i2Cr118VsN vYdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y21si13651770edu.475.2021.11.01.02.25.55; Mon, 01 Nov 2021 02:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232252AbhKAJ0s (ORCPT + 99 others); Mon, 1 Nov 2021 05:26:48 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:4043 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232209AbhKAJX5 (ORCPT ); Mon, 1 Nov 2021 05:23:57 -0400 Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HjS8p4P2Kz67PwL; Mon, 1 Nov 2021 17:16:58 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 1 Nov 2021 10:21:22 +0100 Received: from [10.202.227.179] (10.202.227.179) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 1 Nov 2021 09:21:21 +0000 Subject: Re: [PATCH] iommu/dma: fix incorrect error return on iommu deferred attach To: Logan Gunthorpe , , , Christoph Hellwig CC: Will Deacon , Marshall Midden References: <20211027174757.119755-1-logang@deltatee.com> From: John Garry Message-ID: <0ad0367d-1242-1c41-ad7c-6c4cc4f70983@huawei.com> Date: Mon, 1 Nov 2021 09:21:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20211027174757.119755-1-logang@deltatee.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.179] X-ClientProxiedBy: lhreml719-chm.china.huawei.com (10.201.108.70) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/10/2021 18:47, Logan Gunthorpe wrote: > scsi_dma_map() was reporting a failure during boot on an AMD machine > with the IOMMU enabled. > > scsi_dma_map failed: request for 36 bytes! > > The issue was tracked down to a mistake in logic: should not return > an error if iommu_deferred_attach() returns zero. > > Reported-by: Marshall Midden > Fixes: dabb16f67215 ("iommu/dma: return error code from iommu_dma_map_sg()") > Link:https://lore.kernel.org/all/CAD2CkAWjS8=kKwEEN4cgVNjyFORUibzEiCUA-X+SMtbo0JoMmA@mail.gmail.com > Signed-off-by: Logan Gunthorpe > Cc: Joerg Roedel > Cc: Will Deacon Seems reasonable, FWIW: Reviewed-by: John Garry