Message ID | 20180917030006.245495-22-alexander.levin@microsoft.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3267470ljw; Sun, 16 Sep 2018 20:00:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9NWtL/Kzl0QULwOc0l/wHLdBZ8l1rs3tJs1osXphRf/RUFMrye0b/GMYmIZDr4pTaa4nZ X-Received: by 2002:a17:902:bd95:: with SMTP id q21-v6mr22821070pls.284.1537153241052; Sun, 16 Sep 2018 20:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537153241; cv=none; d=google.com; s=arc-20160816; b=WJG68GqMqC5QFY6GBgqChA4zXr7/uktmfsONbI1uj6DoFoRUPyFpWlMUyngPS3wFef LenwoNJ1SHMFR9oqbeSkzbjNpYavyQeL88lsrT5XcWgoqMib/gluU4+C9ABdb1drdXt2 95uKDLL91HDdiKrWEJb57sTC39/wIwm6h1yBv0X+pr+mCxqo9onxmYBnVhml6QrMZBHt 9yKd9C4BzERjU5p3KUle16zayBvkCFCjjwBijLMctgd+c1QyURVcZtPF9eApgU2UKFxo HDkDXAULd6CqS+vLFONlEvHJIA7GV96Q3ycdCPCq/+qCVT9fwIqs2R9sZqYmlQCIFzrf 8zWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=GrV6RP7izp2Szf+NaQCfJM/2vbaKonKyyaux3vW7Ww0=; b=k0yb9gJqmnVxvmPxiiBeel6AghyWMfJldf+Jnn9OqZbCONBd6dl8IpVhCmlGy4V/Mv VHJhp3iqwJUA8g7QMnJrfrIwqDjWVUfJP6DaCEjuI+UFnrKUxZcCU57e2JZIw5+obU0F 4utfl13OsFoTBQLOuyOFux6BVSyf8NFZTUlgHEoKaGCwVNsX36j776gymybYyBTqEHSi 1PxKjbIjsJP4SJDHAkH95ePGIUT7ReTj5toKQnaENwM5wNS3Y4sRqR0uwuJyymnE8X+b SEcNEjPtnBEcQ/lxVt7vK4Cp7rUqoYuj0/TSQ1XOMgpiCOkvuq1YxYa2oJamdasKTWmo bBiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Y+rIsDN+; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: <stable-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k189-v6si15341338pgc.321.2018.09.16.20.00.40; Sun, 16 Sep 2018 20:00:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Y+rIsDN+; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728659AbeIQIZx (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Mon, 17 Sep 2018 04:25:53 -0400 Received: from mail-by2nam03on0137.outbound.protection.outlook.com ([104.47.42.137]:35861 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728603AbeIQIZw (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 17 Sep 2018 04:25:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GrV6RP7izp2Szf+NaQCfJM/2vbaKonKyyaux3vW7Ww0=; b=Y+rIsDN+idjl7vYLSiP0CPweOf8NZv6lLllnIXD2wQeclkUzHg4pJYJ7j4yQf/9QGp/cGSg8YvKS5g3CCRZchdPYOBbUiVc99EWIb3k4brrp6PGpY+8bHNa8rsatKD8wQJ/gyDtLAta2MS5zM8oGbiIznxqgLZ1jMZohuLPEqck= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0277.namprd21.prod.outlook.com (10.173.193.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.4; Mon, 17 Sep 2018 03:00:26 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1185.003; Mon, 17 Sep 2018 03:00:26 +0000 From: Sasha Levin <Alexander.Levin@microsoft.com> To: "stable@vger.kernel.org" <stable@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> CC: Niklas Cassel <niklas.cassel@linaro.org>, Joerg Roedel <jroedel@suse.de>, Sasha Levin <Alexander.Levin@microsoft.com> Subject: [PATCH AUTOSEL 4.18 022/136] iommu/msm: Don't call iommu_device_{,un}link from atomic context Thread-Topic: [PATCH AUTOSEL 4.18 022/136] iommu/msm: Don't call iommu_device_{,un}link from atomic context Thread-Index: AQHUTjKUi34qJdL9Yk+m/1q8eMFKIg== Date: Mon, 17 Sep 2018 03:00:25 +0000 Message-ID: <20180917030006.245495-22-alexander.levin@microsoft.com> References: <20180917030006.245495-1-alexander.levin@microsoft.com> In-Reply-To: <20180917030006.245495-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR21MB0277; 6:+xvcczahC1wg0cvVqjZBEVhqsxnTfLMaN/lOVD0zl84G4ewds+TapQm5mzGjzzYAyJ973g8/RoeoEUj5/nhCViZmSQuiyLWiN5vRxcmx/OPVi+J5te0hEfIvZ3VU+B0qi49i0HXyXBYcgNJjLmydd8JIiE+ulY+cZVWX4j+vg0gwWVnRox8Oga4w0IfXFhuLYGfid0he4NM7i49I8t2GPcnMAHlIzJjsJTxpt/Dxlr8XDPN741OpGHiGnAT6a/8nEdlmMck5a41Bw/lKatgU4QUOH4NV+C5V6bw8kfoGO0afeMxNgzQy0+DmCtE0b45uS8IWtPMTp2OfD3ZTm3gRDIBE2fV/VFDJqmdW4kZkW5Nj+0nZ2IwPQ3Nv7XODIh2MKIC+JqT+XMjFJ7O/NdZjTgzxB4WbskY56JubwcxPvw6PHqs0KCQFj+vo9DLC10H9yglULL90K/w9r+bq6XrDYw==; 5:jjCei3ZQ9xXfDYba5ur8XXWDdvFUJvR3FH/MmTma+M7a0KtV6imOBbhmzAte/Fz/m1gocGHH8R2qZcwHbFaTUJd1it/tegW4AKe0PGSsbjyxdV0T2dKHW8Inp5NupAqRdVUDGRk4aPBcvelQcvXnPu1GPI0UC6uBvlt4vcENR7A=; 7:XAAASJ+QVPWpCtxaT9xcAJgMRG2L3C6erRhgMRUjdkAoHJGCz6B1qEPUQrpMEzUR24y0OGFt9CocthA8aqCH8H+WI+6iVyLME+zqj1xsqAbmc1i5qxjCvgrXohTYsLpcz4Aa64xJBOqmBsqHkwBv20iH+nvsBdhq/hZaaGMb5IGNcu0o1xK8zJ8HZxUZrGyRQIgNvXJQu1A1f1Na+0yNBtGWlqizVDk5Oo0M0PxfXW+Zt1AcnFdk1xUVYuLGcTEq x-ms-office365-filtering-correlation-id: 0cd61067-d5cf-4225-12e0-08d61c49b81e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0277; x-ms-traffictypediagnostic: CY4PR21MB0277: x-microsoft-antispam-prvs: <CY4PR21MB0277719E6A7C5DE65C77FFD4FB1E0@CY4PR21MB0277.namprd21.prod.outlook.com> x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231355)(944501410)(52105095)(2018427008)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050)(76991041); SRVR:CY4PR21MB0277; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0277; x-forefront-prvs: 0798146F16 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(396003)(376002)(136003)(39860400002)(51234002)(199004)(189003)(446003)(4326008)(2616005)(53936002)(107886003)(11346002)(22452003)(68736007)(486006)(316002)(14454004)(106356001)(476003)(217873002)(25786009)(105586002)(10290500003)(14444005)(5024004)(97736004)(66066001)(6486002)(6436002)(5660300001)(256004)(5250100002)(6512007)(2906002)(2501003)(6346003)(99286004)(72206003)(2900100001)(26005)(6116002)(186003)(1076002)(36756003)(81166006)(6506007)(10090500001)(81156014)(86612001)(102836004)(575784001)(86362001)(8676002)(54906003)(8936002)(110136005)(305945005)(76176011)(478600001)(7736002)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0277; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: imsiGgwppUrdCIyLU+mq5KMl7ak1611Z+SJ13WiNMCRgsEaiMJ5OJ1BE6IWFdQ77hPH35TvkWz+u9oLzGHdVW2iSHSH6k/Kt2aAf10DHjfrK5zfBBTQuQeb0I1iecbotNloivF8y+KV0qYYF6IQw9fHzLUaGYWdqO4a+fFMzrauM0kVgcaXL9QvF1ns7AayrIXWUA9wlL2tAFBHeha8EtUECYc92DWaEzpQMPny/rdYA9sbmA5mrDmML7MxfyghrJJvTbsZg5t9Xp4RYMgmVGobiD/tIBeqUpQZmNaN93VjYSQ7QBDGH2yXx7jABI5nK9WqAPi7OhvNjci2XvQ/i3QFZiIJcnofGpUqY/t7THmA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cd61067-d5cf-4225-12e0-08d61c49b81e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2018 03:00:25.1048 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0277 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 0d3350463a3f..9a95c9b9d0d8 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -395,20 +395,15 @@ static int msm_iommu_add_device(struct device *dev) struct msm_iommu_dev *iommu; struct iommu_group *group; unsigned long flags; - int ret = 0; spin_lock_irqsave(&msm_iommu_lock, flags); - iommu = find_iommu_for_dev(dev); + spin_unlock_irqrestore(&msm_iommu_lock, flags); + if (iommu) iommu_device_link(&iommu->iommu, dev); else - ret = -ENODEV; - - spin_unlock_irqrestore(&msm_iommu_lock, flags); - - if (ret) - return ret; + return -ENODEV; group = iommu_group_get_for_dev(dev); if (IS_ERR(group)) @@ -425,13 +420,12 @@ static void msm_iommu_remove_device(struct device *dev) unsigned long flags; spin_lock_irqsave(&msm_iommu_lock, flags); - iommu = find_iommu_for_dev(dev); + spin_unlock_irqrestore(&msm_iommu_lock, flags); + if (iommu) iommu_device_unlink(&iommu->iommu, dev); - spin_unlock_irqrestore(&msm_iommu_lock, flags); - iommu_group_remove_device(dev); }