From patchwork Tue Aug 5 10:47:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 34912 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 98D242397D for ; Tue, 5 Aug 2014 10:49:17 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id a141sf2892757oig.3 for ; Tue, 05 Aug 2014 03:49:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=Q9OXnnWZft0AIZFg/OLtwLpRdWGYZ0aTxRmB6jGWrTI=; b=ig2kQ/sHd8spNO3NLKhJsn+TiE5K289QcqoMzhb7ZOOauxOcBz4L3qEveX5kIy6w3B hfX1Z4wR4LF3rcRGCaEIMxp15gGz/ZYYqlyCU+XuqmDzC1lNSGQoL1aNfIOK29Ax1aMt HziFpeyO3OYPRJuuliSvX95PadHLH2QnTW6QZW4NTfDZDSwpikyBs/KvAMmw9SGy1DL2 +fwr3+Fw3+OaTosPie19w9NZ/d+QzS5sjPh43OXYtVn+Ma1OGcnAXFYV4Nv7Ug1xWwf6 EtbqFnhrj1RktC1cXkeRa0gp+isvxQp8DLT4+mGD+xt7KkCM3OvYeZyz6SqoaudtZ6fX 0yjw== X-Gm-Message-State: ALoCoQn2QITTcoTkyAeRMj6CKD3QC00P31f59Jruo3jA388MkTlPXBv4T2tMFTmwHWzhVmC6++p3 X-Received: by 10.182.81.161 with SMTP id b1mr1426549oby.1.1407235756992; Tue, 05 Aug 2014 03:49:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.77 with SMTP id r71ls208059qga.71.gmail; Tue, 05 Aug 2014 03:49:16 -0700 (PDT) X-Received: by 10.52.238.227 with SMTP id vn3mr1902446vdc.47.1407235756889; Tue, 05 Aug 2014 03:49:16 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id q6si776458vey.71.2014.08.05.03.49.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:49:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so1099797vcb.35 for ; Tue, 05 Aug 2014 03:49:16 -0700 (PDT) X-Received: by 10.220.49.10 with SMTP id t10mr2397967vcf.34.1407235756818; Tue, 05 Aug 2014 03:49:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp374552vcb; Tue, 5 Aug 2014 03:49:16 -0700 (PDT) X-Received: by 10.224.47.6 with SMTP id l6mr4402517qaf.32.1407235756121; Tue, 05 Aug 2014 03:49:16 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id d33si2157934qgf.41.2014.08.05.03.49.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:49:16 -0700 (PDT) Received-SPF: none (google.com: linaro-mm-sig-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEcIs-0005H1-UG; Tue, 05 Aug 2014 10:49:14 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEcIb-0005Ec-9P for linaro-mm-sig@lists.linaro.org; Tue, 05 Aug 2014 10:48:57 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9T008BUY1H9W00@mailout3.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 05 Aug 2014 11:48:53 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-ad-53e0b6966202 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 7C.0C.25543.696B0E35; Tue, 05 Aug 2014 11:48:54 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N9T0057MY17SE80@eusync3.samsung.com>; Tue, 05 Aug 2014 11:48:54 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Tue, 05 Aug 2014 12:47:34 +0200 Message-id: <1407235677-26324-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> References: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOLMWRmVeSWpSXmKPExsVy+t/xq7rTtj0INph3mc3i76Rj7BbNi9ez WUy6P4HFYsF+a4vO2RvYLXoXXGWzONv0ht2ic+ISdosvVx4yWWx6fI3V4vKuOWwWM87vY7JY e+Quu8Wp65/ZLP71HmS0OHP6EqvF/z072C0Ov2lntTjycDe7xapdfxgtbv/mcxD1eHJwHpPH 71+TGD12zrrL7jG7Yyarx6ZVnWwe++euYffYvKTe4/a/x8wek28sZ/S4cqKJ1aO3+R2bx5ar 7SwefVtWMXp83iQXwBfFZZOSmpNZllqkb5fAlbH7u3DBB+6Kg7+vsjQwtnB1MXJySAiYSJy7 focNwhaTuHBvPZDNxSEksJRR4uD1JawQTh+TxI+mm8wgVWwChhJdb7vAqkQEehkl+pt+MIE4 zALrWCX2915nAakSFnCWOPZ6HthcFgFVib5tu1hBbF4BD4m1LQfYIfbJSfx/uYIJxOYU8JQ4 fPMAWI0QUM3PDWvYJzDyLmBkWMUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kREjlfdjAuPmZ1 iFGAg1GJh9fg9N1gIdbEsuLK3EOMEhzMSiK8EmseBAvxpiRWVqUW5ccXleakFh9iZOLglGpg LJrGqLPqFO/cv7U17EqTNfunXPnyaNK/110J3b01Edf+rliyq8XNWGjXlj3+F/1Tl0/awRWf 85DbvvtxcW3rRx8p48lni+f/XuY8eaqc7vkHybtWO/+P27TC49sepiqDeU2fvzKUrAm+dGyJ dN+VRVkXfZKv9fOefNa1PCl53VL74CWaBmxLE5RYijMSDbWYi4oTATjswiV6AgAA Cc: Rob Herring , Thierry Reding , Shaik Ameer Basha , Arnd Bergmann , Inki Dae , Greg Kroah-Hartman , Joerg Roedel , "Rafael J. Wysocki" , Tomasz Figa , linaro-mm-sig@lists.linaro.org, Kyungmin Park , Kukjin Kim , Laurent Pinchart , Sylwester Nawrocki , Olof Johansson , Cho KyongHo Subject: [Linaro-mm-sig] [PATCH 06/29] drivers: iommu: add notify about failed bind X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-mm-sig-bounces@lists.linaro.org Sender: linaro-mm-sig-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds support for forwarding recently introduced BUS_NOTIFY_DRVBIND_FAILED event to iommu groups. This lets us getting a notify for failed device driver bind, so all the items done in IOMMU_GROUP_NOTIFY_BIND_DRIVER event can be cleaned if the driver fails to bind. Signed-off-by: Marek Szyprowski --- drivers/iommu/iommu.c | 3 +++ include/linux/iommu.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 1698360..516e93a 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -758,6 +758,9 @@ static int iommu_bus_notifier(struct notifier_block *nb, case BUS_NOTIFY_UNBOUND_DRIVER: group_action = IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER; break; + case BUS_NOTIFY_DRVBIND_FAILED: + group_action = IOMMU_GROUP_NOTIFY_DRVBIND_FAILED; + break; } if (group_action) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 20f9a52..f9fdae5 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -139,6 +139,7 @@ struct iommu_ops { #define IOMMU_GROUP_NOTIFY_BOUND_DRIVER 4 /* Post Driver bind */ #define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */ #define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */ +#define IOMMU_GROUP_NOTIFY_DRVBIND_FAILED 7 /* Driver failed to bind */ extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops); extern bool iommu_present(struct bus_type *bus);