From patchwork Thu Nov 17 11:20:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 9434105 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1DD0B60469 for ; Thu, 17 Nov 2016 11:21:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EE6129409 for ; Thu, 17 Nov 2016 11:21:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03B8F2940B; Thu, 17 Nov 2016 11:21:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8766929409 for ; Thu, 17 Nov 2016 11:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbcKQLVG (ORCPT ); Thu, 17 Nov 2016 06:21:06 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:51078 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbcKQLVE (ORCPT ); Thu, 17 Nov 2016 06:21:04 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4960B61655; Thu, 17 Nov 2016 11:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479381664; bh=M/fSwj68AcVyMHy6Bx6CnVCXDaR1yYBTWG9bpPR8+58=; h=From:To:Cc:Subject:Date:From; b=nwD7DxZ2Y1hyRqsrIeXRNdYsav3NmK77990dn+1yVhlp8VrypT0ISK1oDAwdw637J eufaDE0bQmlTGXBEaThE3774YSf2DGLKKPgmieM/rKi1ymJx9Q4k5bzCB/H/SI3hhf 1op++p8JqHAsgYIS1WJrE35ZtrFQ1yxJbTnB+voE= Received: from blr-ubuntu-32.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C0D9961635; Thu, 17 Nov 2016 11:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479381663; bh=M/fSwj68AcVyMHy6Bx6CnVCXDaR1yYBTWG9bpPR8+58=; h=From:To:Cc:Subject:Date:From; b=ZWFi0iZsKCe9SzPB7raSVQGRqj0r4xrui+TxF7GYq/mXqYNkYasDRwPBfq2kZULaP 9s8+S3o6YaF7+JUr+56apwZ3AM+exnjwHKWmeFPLjciAYgvWusk7UxmjOZardYDGUJ 2ltgBVIaqO8Qxt9a6M86aEfrrWw0t3FX0ImWDduY= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org C0D9961635 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sricharan@codeaurora.org From: Sricharan R To: rmk+kernel@armlinux.org.uk, robin.murphy@arm.com, will.deacon@arm.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: sricharan@codeaurora.org Subject: [PATCH] arm: dma-mapping: Reset the device's dma_ops Date: Thu, 17 Nov 2016 16:50:45 +0530 Message-Id: <1479381645-3230-1-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arch_teardown_dma_ops() being the inverse of arch_setup_dma_ops() ,dma_ops should be cleared in the teardown path. Otherwise this causes problem when the probe of device is retried after being deferred. The device's iommu structures are cleared after EPROBEDEFER error, but on the next try dma_ops will still be set to old value, which is not right. Signed-off-by: Sricharan R Reviewed-by: Robin Murphy Acked-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index ab4f745..a40f03e 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -2358,6 +2358,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) __arm_iommu_detach_device(dev); arm_iommu_release_mapping(mapping); + set_dma_ops(dev, NULL); } #else