From patchwork Thu Nov 3 19:51:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 15143 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp737609wru; Thu, 3 Nov 2022 12:56:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5aaJrj8WKCbEVQdH0xFtB1eo5R+zxsjI0rRON2cdMPK6/IOOF2uOoJB19YjWgofaXmG124 X-Received: by 2002:a05:6402:4444:b0:458:f355:ce04 with SMTP id o4-20020a056402444400b00458f355ce04mr32719038edb.422.1667505375172; Thu, 03 Nov 2022 12:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505375; cv=none; d=google.com; s=arc-20160816; b=vzqUKqMl7tBLlKbW0hHC8CVu0jQcIy6hg6WGOU0vZQNmi/HWGO088U7KKFqGujKmNn HljA0ijIPpcWE6KWTEQeNYwqG7xVRSAlg5kwd+KYePUInPUfityCMWttcrl9D2NxAJUR QM6L1OhoXjrMxCXU2iLQEpIPRbfMKWvN0JmTEUVqhkBu+3/2Vi+nJGxk/V6Ts1EqcebK yVCrwQMicCm7TaMiJJ2CzaGHWkY1KMt5FC0nRDGcz9Ws40tdJBIaIkDvbj1YI0hl8aIm 9djjfTAae453za0MUaQ38DTDX9BbtImeVZeN2QTq7XJVW4uD2ueAWmGBi7du5yg/d1jn z//A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h+MC8kK4zWQiBOS9TmUZzl813e7Kce9jFI4colJBhao=; b=gMyn2lz3gkieZTdg9to3njpcrKvGNqDG+OBtGiAvwA8ZI6Vm6l/Dnr4I277JJPU6MM dYdqJq11teEbYHdelhM5zlVJX3PrC7tlP2PAqJkhzqx0c7T0Sfq96sLJIDoKuTK7Nngy Aphh7+M5XH+Zjfnef/gUPkJhAVBHNoS/ObCFERjEe9AYhNLjV8hgLTWYNo+hUe4lJI5a 6AiBfrHe6iDd+aAlsvi1XlR1CfAIeojht5VG8S75Bn6J2/rhmMziWqq1x2AzjT+qzQqF o9UmC8Vi9H8ZQVe2dlHB726OnLjdrM0X0T6NNpenSfYUxvnrwiZM3nVhsoqKv6OptLrb 3l0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qA13inhD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg8-20020a170907a40800b0078e1a6fbe12si2538741ejc.16.2022.11.03.12.55.50; Thu, 03 Nov 2022 12:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qA13inhD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230388AbiKCTwC (ORCPT + 99 others); Thu, 3 Nov 2022 15:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiKCTwA (ORCPT ); Thu, 3 Nov 2022 15:52:00 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0850A20183 for ; Thu, 3 Nov 2022 12:51:59 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id l11so4692470edb.4 for ; Thu, 03 Nov 2022 12:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h+MC8kK4zWQiBOS9TmUZzl813e7Kce9jFI4colJBhao=; b=qA13inhD1EP6l24EPFrU95U+zViK6UVln1wnFLBXMzU3guuv5XL87mQ657GGlBJDv5 Ynobk1ef/cexQULn5sXQz2W0DyjHLeN7af3yGWh1e+lEc2Ci2EuKhObBAOHiQw202pbb R0A9SrGxiRDi2/BfD0GbOpeSesGZlhz1/w/9u3MExoFW2+fBs9XPOktTxlaIj5vZ3DA9 wAsSWuQhV1ShmHc74HtGrM/RnLpTzmFNT3bIBaR/+Ty0SC55iaEr0ywSRpT1ZiP9Lele IsDff9Xm4w6mcr2mzhB53onaIFRvURcJExNk1TF372aT5uZ6RbcwgSWVohvYMIrkep41 GRNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h+MC8kK4zWQiBOS9TmUZzl813e7Kce9jFI4colJBhao=; b=LXSxCud5lsmnooufqA1MfmDMTx7SVPrPRKnFnI0JpKi0YOWaE5lhXBd+5HIkoSAW0J xR/BwqWSZ/quLdxgcY4s+pTKf8BCoP5DfHVWchCDye2rfEjsanyGzdneB1THWTEof2qz tACu+vW6G//3/RCzfXZw8ViChaPfa0l1fW68Egj6hoieKmqWEAqVJpczZoqLiRW///xm R9zMOO7n9uEc1sh3UnfrtDS3VsCLAszd82+Wm75J2IxcHCK2gbt/oxt63h52F+chWYOw r+W1YzaKuNQCQ2Y7lYrs2OLLTAENm6Zr9UPYJ4TOozJ0faNZPBosXqHV29JwtK2Keol3 q/1A== X-Gm-Message-State: ACrzQf0VhvEjTXwe/DXjPEkrggvd1soehFC2Rfy4+I/7CgVa2liJBu5M +HmqAA4gAZqUGBru4+jhCNCrEg== X-Received: by 2002:aa7:c1d9:0:b0:463:aeaf:3383 with SMTP id d25-20020aa7c1d9000000b00463aeaf3383mr16737337edp.253.1667505117553; Thu, 03 Nov 2022 12:51:57 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id j1-20020a17090623e100b007030c97ae62sm847433ejg.191.2022.11.03.12.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:51:57 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 1/6] iommu: Export iommu_group_default_domain() API Date: Thu, 3 Nov 2022 20:51:49 +0100 Message-Id: <20221103195154.21495-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103195154.21495-1-semen.protsenko@linaro.org> References: <20221103195154.21495-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506115806068931?= X-GMAIL-MSGID: =?utf-8?q?1748506115806068931?= iommu_group_default_domain() may be needed for module users. E.g. exynos-iommu driver is using it right now, and it's going to be converted to a module soon. Signed-off-by: Sam Protsenko --- Changes in v2: - (none) drivers/iommu/iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 6ca377f4fbf9..006a65411a28 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1675,6 +1675,7 @@ struct iommu_domain *iommu_group_default_domain(struct iommu_group *group) { return group->default_domain; } +EXPORT_SYMBOL_GPL(iommu_group_default_domain); static int probe_iommu_group(struct device *dev, void *data) { From patchwork Thu Nov 3 19:51:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 15129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp736612wru; Thu, 3 Nov 2022 12:54:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61vMSlqFwNcbYDneYhVlbZyK2sybhkVDCsOllyC+sUDh7CABACX0Mr3YUYBrkvhvFZ4AzR X-Received: by 2002:a63:5c56:0:b0:464:85bb:8fd9 with SMTP id n22-20020a635c56000000b0046485bb8fd9mr26670365pgm.188.1667505244802; Thu, 03 Nov 2022 12:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505244; cv=none; d=google.com; s=arc-20160816; b=yQfymk6DFs8Tb2giUfOYcjOr8ICgV76qGVnf3W6qsLPJMt7gI1awOqV7nlg7kYQjhy 3+ftC9fAodB+OMEB7pRuNrwrfoSQTZMNfFj+Qqenc1+EkilUi9EsL2TNU77//7TmmNMn VAFbd4zoJQVIu60mgSDnWZuLAJO9Uh1pGn2OuFE97WV7IgQM+WjU4owm/cIVH+4FsHnv 4nATwtbvjSq/esqB6FIJsbzlVLrc/ZbNQAQzkskTtJtD21yjS6qvPOksSCI4shMDRA1x BJmwmBaLLaks1X+mh1XtUMD249TRdrdSwK5JYfevwkWPx1OvKT6yoRV0voThXkoQKXp5 vHNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C88yKCopssymOAMe7KHFSlCl2Lylr4sF9uZV7UHC95E=; b=uwC1w0Sgge1IC/TvNvqDvTG9xnbDl9174xaO8w2Rz3jKiimtzN+FP0GWHN8VHPGNbl tKEDpqGaSFys6Jlnp0LmzNUSIlhntGZcxNukNr1YrUkGxfjXPAgdGVEfSiylpBPGjc4L gf/XbwxFlrbdTE5c+VkJT5UwFKEIaq5nty4vQyT9qJwjtu4+fHUr2UX85ztKmWEI8uLs J9MaNFE8XHol73iAmFO3m0YtJwRwzI3K5PYY/P5DMWimhY2ykBqDRh98V3EWLfRjaeiv AMpr2MG/hWqKV0253dVu0m5dUs9jkuHH+FhtRJVmupZY6Ya5yLb8Q1t0yrtsFf9coq3X AzTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JNnSWiaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot3-20020a17090b3b4300b002121890521csi1041511pjb.119.2022.11.03.12.53.51; Thu, 03 Nov 2022 12:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JNnSWiaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbiKCTwI (ORCPT + 99 others); Thu, 3 Nov 2022 15:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbiKCTwC (ORCPT ); Thu, 3 Nov 2022 15:52:02 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C0C91E3D8 for ; Thu, 3 Nov 2022 12:52:00 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id z18so4668891edb.9 for ; Thu, 03 Nov 2022 12:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C88yKCopssymOAMe7KHFSlCl2Lylr4sF9uZV7UHC95E=; b=JNnSWiaLPu25KnAyCNpaAD7Ly2+4NcVx1V6Eugxf+ijwsUjrFE9ecgyeuEgPFSEyxz FKf4DWokPxTymvXIRFJCPn0ZpWILr52tu/S0yEzdyMAff5tTSxtHw8Z8xhoPjTDU9tfD bBq9y1xE4YfD8UQu5ZFgRhYzuUzOytWCb9pbu4MovgFkctkLmV/L9dBwQ8vu1/YzszeC qDTCvEwTaxg5dBDp0D1xq8KrSAN8FLdNejgZRNeJu2qKXC7eNNhAdG7mQpbpyk3hnWKF BkgxrumY+6mwjvxtqef2jQAZ7+SHEv/MoZgYdsJWgK7ZznhFuWS87Nv3WmzoQd6o3Z4b Nx5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C88yKCopssymOAMe7KHFSlCl2Lylr4sF9uZV7UHC95E=; b=Hptflq5L5lLHxWN9/xuCl46Aokkbd1xRyMIzAqbCzmlAIuz/LDshFl9CS/bPsUgnDO 4BfrRzmy/FgMnhdTjUnyyHia8gHSeqWapAo/klxRTUQDEgw6hgGGByoaSSpwNLMnHmj4 YqdGGfDG5j6qsjhN3Ip4WGcizzSKu+2lJWz7YMS+a3YsVK4TzRpfV1Z2xF+gQ+NvKYBA qDweLvdDTaXHCWjzHzhgyc6dr0HvfzmwX2VE9wAs/FzP5y+nLmEFRN6nvIiBBtEzQaJE Ix3qnJ5MtBCBHR6M7wkvhgl3dcYBvjjcbvbGMqGER/KFNLZkFAqwJ5U3iAl1VtFy0eni nH4Q== X-Gm-Message-State: ACrzQf04wUCZFWUtU30o/oZb6zvdQ6DjrWheAKmEo2VlZjbdvt1+M5sV MWOf8IYS7bDrDbgiQjujcPHizw== X-Received: by 2002:aa7:de0a:0:b0:462:d2a0:93a with SMTP id h10-20020aa7de0a000000b00462d2a0093amr30786059edv.275.1667505119162; Thu, 03 Nov 2022 12:51:59 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id tz14-20020a170907c78e00b0078ddb518a90sm834227ejc.223.2022.11.03.12.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:51:58 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 2/6] iommu/exynos: Fix retval on getting clocks in probe Date: Thu, 3 Nov 2022 20:51:50 +0100 Message-Id: <20221103195154.21495-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103195154.21495-1-semen.protsenko@linaro.org> References: <20221103195154.21495-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748505979623989723?= X-GMAIL-MSGID: =?utf-8?q?1748505979623989723?= checkpatch reports next warning for clock getting code in probe function: WARNING: ENOSYS means 'invalid syscall nr' and nothing else Replace it with -ENOINT to make checkpatch happy. Signed-off-by: Sam Protsenko Acked-by: Krzysztof Kozlowski --- Changes in v2: - (none) drivers/iommu/exynos-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 45fd4850bacb..0d150b383d04 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -689,7 +689,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) if (!data->clk && (!data->aclk || !data->pclk)) { dev_err(dev, "Failed to get device clock(s)!\n"); - return -ENOSYS; + return -ENOENT; } data->clk_master = devm_clk_get(dev, "master"); From patchwork Thu Nov 3 19:51:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 15145 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp737678wru; Thu, 3 Nov 2022 12:56:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4K7wj2SyZSoqE5U1fXUUWnk7gkFbUwjXU2By28GVDxjRps9UPwKIXRG5HutigNv3DD9vMf X-Received: by 2002:a17:907:6d0b:b0:7ad:f7ce:fad4 with SMTP id sa11-20020a1709076d0b00b007adf7cefad4mr13302689ejc.472.1667505383796; Thu, 03 Nov 2022 12:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505383; cv=none; d=google.com; s=arc-20160816; b=BUz+aM1nv6beK04ee2lFaT1X5HT5E7T2iD2zcVZVRY28+dt2Ch0z9RiuIF/wNwBknq +Ijplg4ok/yRcyNngC/2HjJJ9aFkst9qde7We72JzKliCiqbRkbCiS2pdnt6Six8Vb22 4Zk41B4QRijCi0JeiNqxXnM6dlBujaQrJdGyKEM/7pBEAH7Z7+olgkthmgTj26+dbhnP 93A6J+Ny+MAwW0S/JkmUwBoZFI6Hg5932AoDWOkq7atnzjTonZbGtYTiteVJCa+vzAql BfY63c8XR6yNyXZ37EEWdR4/mSIEo7M927M0D+ExcKNrLW0mGeZ4r0b2ZKNxGNlzwmah fNWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aXCO9a7x2xoJr3hX2LIdzuSb2rVW3qJQzBsWlbB8ZK0=; b=yND6EnU84ZcwbP7YOKr5vkBeME8bXCdUoH4swCfw7qY19lLrKfnbV86QyLHWWgSPbp eOfl+0DduAZ4WtcV1k7q4GD47ujgJLdKqXorbIH8yp/Jfz8eV6TstSTPYF1dHqhBwqO3 8oFEjJXJe7GhxvIpJDNeqmB/3X888B04pY9L16nNG3+ZjML2rE1dEJd1vNeEboAndubt xvM1Rg1noaAHxDRufGSxIO8dA+Kkd32GhMDIB7g6SvhHvZGuN02hmCuQFEH67mpu44DF TToDjZ3kd0Rc6H+z+t1sgaNruig6UnNIhC0o21z2eesuzfBOk06FSeN761/I/FFg62Ep 4Svw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQGsSI60; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd16-20020a170907969000b007adc5c4626bsi2537313ejc.50.2022.11.03.12.55.59; Thu, 03 Nov 2022 12:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQGsSI60; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiKCTwN (ORCPT + 99 others); Thu, 3 Nov 2022 15:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbiKCTwE (ORCPT ); Thu, 3 Nov 2022 15:52:04 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F6EA201BB for ; Thu, 3 Nov 2022 12:52:02 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id i21so4648746edj.10 for ; Thu, 03 Nov 2022 12:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aXCO9a7x2xoJr3hX2LIdzuSb2rVW3qJQzBsWlbB8ZK0=; b=nQGsSI60wh19jmS5rh2BuaBTcb5URMCprPZR1Qt20h8IGzb8IM4pplEyq6DQ3Q+n0C h5qaEV3zI/t4vLs0Je8PEyDomt+aBsAELhfOyIdRwQBWKObdhTH3xshRT9xXWpIwrTjW l5TryGbITzNYIzK155TRxE63/dj/a/V9XNmyzurtcNFQs5g6emh1Mp2+GdixLYxcuJNU hrOdEkVQM6OG83HiAUYRvmpIgGmU8Msf9q5a6Kti8Fnah1eeJ5JWaQgmgO+n2dgM1PIP Uq2NJ6bEBBQFVVXElJ10vvwkVK4BE96g5CeDj+Ro58KWu7BsrOA/CqM/hHL9mbNNkYTP cJkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aXCO9a7x2xoJr3hX2LIdzuSb2rVW3qJQzBsWlbB8ZK0=; b=fPzFERNINg1yj7GH3yBGHu90Dn0U0IaoDMjTEhhCBLSEBD/txh5OsPzwUWdjLgaHge IIZtthbx8mrCHhXK0+3JEp4GdalQ8A/rpyoIzl54lsjKa91RpA3EgerZvT8+0HJQFuAc j78ndLsgbdKirk3yK5wHgmWInixBaQSTMErUpJ7BUwi2R3NtzAm1I37hp/v3AXlDygIk Flln4R1p8sdxNZRztrzDOzK8YQAvYcVKlP6E49k92slJZf8jNI+WlO++Sfq/KA64OKCC 0sk1LdGKZPhciT2gCzYG5tEOL1WOl7nLllQf5KKGYBlehH7pyYSMx4N32fqoMRaRUwfB Mi3A== X-Gm-Message-State: ACrzQf2Jv4SIX8VayPdyVzBBbAXmeGRFQ0lgYIYm1F2uig2V45+5wosy nsMaIAGNYl2pKM7mPxpxdo8rSQ== X-Received: by 2002:a05:6402:440f:b0:45d:297b:c70a with SMTP id y15-20020a056402440f00b0045d297bc70amr31990965eda.187.1667505121017; Thu, 03 Nov 2022 12:52:01 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id g16-20020a170906539000b007ad98918743sm880137ejo.1.2022.11.03.12.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:52:00 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 3/6] iommu/exynos: Modularize the driver Date: Thu, 3 Nov 2022 20:51:51 +0100 Message-Id: <20221103195154.21495-4-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103195154.21495-1-semen.protsenko@linaro.org> References: <20221103195154.21495-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506125461474117?= X-GMAIL-MSGID: =?utf-8?q?1748506125461474117?= Rework the driver so it can be built as a loadable module. That can be useful as not all ARM64 platforms need it. And that's ok for it to be a module because it's not a critical driver (platform can work when it's disabled). Remove method and module exit function are not implemented, as the removal of IOMMUs cannot be done reliably. As Robin Murphy mentioned in [1]: ...it's better not to even pretend that removing an IOMMU's driver while other drivers are using it (usually via DMA ops without even realising) is going to have anything other than catastrophic results. [1] https://lore.kernel.org/lkml/20220702213724.3949-2-semen.protsenko@linaro.org/T/#md7e1e3f5b2c9e7fa5bc28fe33e818b6aa4a7237c Signed-off-by: Sam Protsenko Acked-by: Krzysztof Kozlowski --- Changes in v2: - Add MODULE_DEVICE_TABLE(of, ...) to support hot-plug loading - Add MODULE_ALIAS() line - Extracted "shutdown" driver method adding into a separate patch drivers/iommu/Kconfig | 2 +- drivers/iommu/exynos-iommu.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index dc5f7a156ff5..6f7055606679 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -259,7 +259,7 @@ config TEGRA_IOMMU_SMMU SoCs (Tegra30 up to Tegra210). config EXYNOS_IOMMU - bool "Exynos IOMMU Support" + tristate "Exynos IOMMU Support" depends on ARCH_EXYNOS || COMPILE_TEST depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes select IOMMU_API diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 0d150b383d04..aad845677bda 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -798,8 +799,9 @@ static const struct of_device_id sysmmu_of_match[] = { { .compatible = "samsung,exynos-sysmmu", }, { }, }; +MODULE_DEVICE_TABLE(of, sysmmu_of_match); -static struct platform_driver exynos_sysmmu_driver __refdata = { +static struct platform_driver exynos_sysmmu_driver = { .probe = exynos_sysmmu_probe, .driver = { .name = "exynos-sysmmu", @@ -1404,6 +1406,7 @@ static const struct iommu_ops exynos_iommu_ops = { .release_device = exynos_iommu_release_device, .pgsize_bitmap = SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE, .of_xlate = exynos_iommu_of_xlate, + .owner = THIS_MODULE, .default_domain_ops = &(const struct iommu_domain_ops) { .attach_dev = exynos_iommu_attach_device, .detach_dev = exynos_iommu_detach_device, @@ -1454,3 +1457,7 @@ static int __init exynos_iommu_init(void) return ret; } core_initcall(exynos_iommu_init); + +MODULE_DESCRIPTION("IOMMU driver for Exynos SoCs"); +MODULE_ALIAS("platform:exynos-sysmmu"); +MODULE_LICENSE("GPL"); From patchwork Thu Nov 3 19:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 15130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp736784wru; Thu, 3 Nov 2022 12:54:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fusqWJWRB14se8BIlMaxHBpVlnvkF1v4FOxqvqh9XRuU+mRx8XDn/jmPKwDp8TTpRYEvJ X-Received: by 2002:aa7:c04f:0:b0:457:1b08:d056 with SMTP id k15-20020aa7c04f000000b004571b08d056mr33129514edo.146.1667505266454; Thu, 03 Nov 2022 12:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505266; cv=none; d=google.com; s=arc-20160816; b=U7tOerlQeQd0eiErZ6lS68UsuvdxMa2oy7LIcSYoJHVdP6ZrbI6q5P/w8zspnq6m0H Ta4xHvgpcDFdDouhoo/l2wZ1clEayw8kEnNLbYZe/YyNjuKYwRK4lAj3ve2E38c2Bh9P cU3Rki4cQfFOHWzk/Gwfuyftj1mBg7DTFw4QkupVXc8yQHWNHh1bSpvP+PW6FqKQloli bda7BvyPGkff99j3gl2liJFhVFdW6gPTL2HE00PAbKKRhlMKS3llCWfjyrobkAoLTbpK hjUaaQqcKpEIjVbEts/y9S8YonaUut/f1lZgu6RUezOXWiYgRfJ1klCCGWjCPgVvMSxr FtxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8GteW77xtmVFSxJeOH5lkPz2xCnVHhXZ4689sF4PXr4=; b=l+EswZLKOsLJPv4hTrZz0XjfrXuOT3trYUfpauCoM8bGrsWZdstgi6Yd0D7FNl2z9h nsu7De/6nPASRNC+WcP/qS1WQlaRg5tyFJikBvINApT5lEtMHjPRLPrKZMJPyAcZs2wK OkT8ZOwqEgxQ0n/hoiGW0uhbpgZeuLzzEkECt5laq00S2oY/Y+6u76jmoG0rNzQVb5Yo k1VoFtlwPaGZ6FgJJVooXCMwDswge/sQiIERkpG5DI/B5KfLFSqOCGcopA5RsTl2N6kZ RCtM10FNOEKqZL85XEc54id5UOFTzvmWdvZpcWNizZ17AJiiqMunRCTv8U2VzkrEw7EH vo9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XS+nYmWG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a170907914300b0078de51e1c3dsi1732686ejs.840.2022.11.03.12.54.02; Thu, 03 Nov 2022 12:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XS+nYmWG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbiKCTwQ (ORCPT + 99 others); Thu, 3 Nov 2022 15:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbiKCTwF (ORCPT ); Thu, 3 Nov 2022 15:52:05 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 076ED20358 for ; Thu, 3 Nov 2022 12:52:03 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id x2so4712022edd.2 for ; Thu, 03 Nov 2022 12:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8GteW77xtmVFSxJeOH5lkPz2xCnVHhXZ4689sF4PXr4=; b=XS+nYmWGxVzp8b3+Ikv2y44FFDaFheYgYIbiPVlgn49mfTqtgEsOyaHPJ3r/p5B3tt Nt5dBpQKml2iwalKxnRphnFIG/LSj40LX/DzeEwbsW5Dg19uBCqt/dPpJ2mM/QlxNP0t ViMsoPF0uR0Y3DKOyO063X/SvB/Y+eaqBrfHolnwX/6pjNtDDh3k1wIWEqvSHb7fE5B7 BIhEjckfBLuXmH/TBcTQHGLPIYq+oavrnSOxXg6z7utaTTQs+wYLNmcNTZ/7g3YeuT0q LHdaXBVv5HYmGiczZ9CUEcLy03QRnuty4MISIWcoLtHL7iaGIIQ20TYEJGlpEADAFiA4 Gw+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8GteW77xtmVFSxJeOH5lkPz2xCnVHhXZ4689sF4PXr4=; b=zxPkt69izCMPtW2SBv1j1YQgCdun4bi0tZOFN+nimSq+nc6/3P+5MBufXEfN87d8l4 1xtD2RLPy4q3lujJxjQlBXPfSrkz7uq4Mzg/2zfEMhDi/13mgVuzlzjhiwQhsTDUv/S0 W4oWZrurS8Mix/4TA2yw1IJY9Hsef/cr7H989owwc5sbJe0WLV1MyF1VtDmIEHZTB1oD 2zIw9vvv1gaDgxZYPZt75M81ytJwiSJSfkiGk2c4mQCxxVOwL5JUTNOWjKGXrbIFTQ7q vaeEfxTDcC5fmvPGiF919UppH9AeDCRmM8AKZQ05PuBjJfrC+Njf5Nd9ZP5DLlZVyoJ+ sVww== X-Gm-Message-State: ACrzQf0dXLpvVy3rdRLqRa1ifTkXK2/kjsXIEWx7YgttQoBeYeoAqy5q ECJNaWddl9FKu4HUtjCyy2Q4VA== X-Received: by 2002:a05:6402:1f06:b0:457:149d:beaa with SMTP id b6-20020a0564021f0600b00457149dbeaamr31567406edb.238.1667505122589; Thu, 03 Nov 2022 12:52:02 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id m4-20020a1709062b8400b0078c213ad441sm864087ejg.101.2022.11.03.12.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:52:02 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 4/6] iommu/exynos: Implement shutdown driver method Date: Thu, 3 Nov 2022 20:51:52 +0100 Message-Id: <20221103195154.21495-5-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103195154.21495-1-semen.protsenko@linaro.org> References: <20221103195154.21495-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506002301655567?= X-GMAIL-MSGID: =?utf-8?q?1748506002301655567?= While remove method shouldn't be implemented, as it can't be done reliably, the shutdown method can be useful for performing a kexec. That was inspired by other IOMMU drivers, see commit 1a4e90f25b2c ("iommu/rockchip: Perform a reset on shutdown") for example. Signed-off-by: Sam Protsenko Acked-by: Krzysztof Kozlowski --- Changes in v2: - New patch drivers/iommu/exynos-iommu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index aad845677bda..cd3f74e638f0 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -753,6 +753,16 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) return ret; } +static void exynos_sysmmu_shutdown(struct platform_device *pdev) +{ + struct sysmmu_drvdata *data = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; + int irq = platform_get_irq(pdev, 0); + + devm_free_irq(dev, irq, data); + pm_runtime_force_suspend(dev); +} + static int __maybe_unused exynos_sysmmu_suspend(struct device *dev) { struct sysmmu_drvdata *data = dev_get_drvdata(dev); @@ -803,6 +813,7 @@ MODULE_DEVICE_TABLE(of, sysmmu_of_match); static struct platform_driver exynos_sysmmu_driver = { .probe = exynos_sysmmu_probe, + .shutdown = exynos_sysmmu_shutdown, .driver = { .name = "exynos-sysmmu", .of_match_table = sysmmu_of_match, From patchwork Thu Nov 3 19:51:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 15132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp736853wru; Thu, 3 Nov 2022 12:54:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6L97a1wZ3lUfR8mQAPQSHpkWQaVNHA1w8+bOyMkxNBFdb1nm1tHE8UsjfGEap02duki46U X-Received: by 2002:aa7:d40e:0:b0:463:3844:f160 with SMTP id z14-20020aa7d40e000000b004633844f160mr26662573edq.296.1667505274005; Thu, 03 Nov 2022 12:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505273; cv=none; d=google.com; s=arc-20160816; b=P19aBYKHZmd8UKJAWYRVoKdzw0XaKAxLDt42hu8/ozG3+DHVHkcW5JusYtKQ0mjdiz L6LsYzVKV5iSh0rKODqP72/l3/iCB2o+9rMZ5CdD5zQX41BMbBhHFrtVBTOEapbRhzVL U/bSLyplkk4BoapT8TUSXJOdd456GW2k1iQw+osB4jEyrisxsvgwv+iDmUNtb5XnShXq SAuyHS1hLXO0/wgB2tYtzm+ilMn6oKqJEacPsT/Wn7i+6wjrjNzns2T8SyEMQ00TyYJM NYM9M4cwe9RV7CG6MLsnVpXIbIag1E0XZM6kAbG5EQNjw5+2uvRHJBNlsmwna6z40Z52 6Flg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9AClRHYQmmiljK9Z1RfiVXUSaeI4B4a5JMw83y2hLjc=; b=UM5XvqdI2Qo8mm0MQAuaQhcLcn11Pie1uZqS2lYD4dEm1Syea7PKHApFOXWufhbU0E i9uw6WfFJD56foYSW/Ofd0AHglUZQ/Q9eMBPGRoK+M76jHDkl8+8mQyGfrq2b7GNeP3s 0LcsmFGkKgMWp5ex6rBx96bln6iqrrv4scz+g13m9FtDbX5sGXgpOQZeOo8oECNDqJeJ 8bfjxyhGi7KCX9OyNv79xNeYTJ/NT3CpV7p+UxQyVydy59qPcwlo7lzFbLOgwaDaKYKd NSdmjD/ZT9Wy2hgSJQmIAyJWRu0zJszGo3doafIQq8Cusc6CTYa1v0Dfj2z1RvtODHDF qIwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I+yQTuz7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc17-20020a170907169100b007aa8a5131a3si2330255ejc.181.2022.11.03.12.54.09; Thu, 03 Nov 2022 12:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I+yQTuz7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbiKCTwX (ORCPT + 99 others); Thu, 3 Nov 2022 15:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbiKCTwG (ORCPT ); Thu, 3 Nov 2022 15:52:06 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E226620364 for ; Thu, 3 Nov 2022 12:52:04 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id y14so8137735ejd.9 for ; Thu, 03 Nov 2022 12:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9AClRHYQmmiljK9Z1RfiVXUSaeI4B4a5JMw83y2hLjc=; b=I+yQTuz7Ehdp6gLmvTSiRfW8d7safqQgm6xFo5ffNjn2ymI6ele5uztQfdKB4w4of1 yrdAXb+n5lMSvHrXuRCJOJd+gH8sXRbJpxlOgvSiFHqDtwIDsxml9RVmYOg+GFT8gTrS YTmIBlFiJlnYK8RaSHjXa6bKk3jKG0F1eTZEaQDfUMHldgm3Tt2pxx8HelUqTLOmRBbA uqONeXXZErQ2pmSgLWy+3iRhMLG+GvxowruU7JdfgPlA7i5d3zK1FlR146IqWScRjSN8 Si36SZHhp0LSKvd4jiiwjucmqr3vgbhiGYOGK+03e6QnliPU18z+4wy1nkIopXZtEI/O 05eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9AClRHYQmmiljK9Z1RfiVXUSaeI4B4a5JMw83y2hLjc=; b=Sw4Cf0cu1tDugGB8S8k7uDANATgg0yKtD3Ek7C/mkqdBbisYbdqlv4TmfYcTI+x4mQ l2KAUx3KSwDMafT+3X2xwJ7+8js50ZWowRPlw+VZ/Z8pPN7z+VQlXTsO802XrLWJ0Ffn 2yEtE7jZZ1jMdicUy0G0X4+4rfni008I88TVUA72htYC5eXpDfHRtnbTt5C5VpWhKVSb EGsLayoBr02/daUCehWRhefDqTlVDi7XVXuULG9Xx3xj++rEs0eAgoopJqAncQiikpPN RxrmcCw6mm6b0ICQnWBMW/zVfMp+Q4OFGhb8nBO7IflHERssvX7LKCDzmPDEUFZ9AMCp DJpA== X-Gm-Message-State: ACrzQf34sJ+qmrIeQzEkOEWmNkEbYPj1uvl4j+/QSAydfAkzC8hflCbL S4YiTuEN33QZM9s4/E6wISKAEg== X-Received: by 2002:a17:907:3f26:b0:78d:9c30:4529 with SMTP id hq38-20020a1709073f2600b0078d9c304529mr30510256ejc.195.1667505124242; Thu, 03 Nov 2022 12:52:04 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id br26-20020a170906d15a00b0072af4af2f46sm872441ejb.74.2022.11.03.12.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:52:03 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 5/6] iommu/exynos: Rearrange the platform driver code Date: Thu, 3 Nov 2022 20:51:53 +0100 Message-Id: <20221103195154.21495-6-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103195154.21495-1-semen.protsenko@linaro.org> References: <20221103195154.21495-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506010463486127?= X-GMAIL-MSGID: =?utf-8?q?1748506010463486127?= Move the platform_driver code to the bottom of the driver, as it's a canonical form for that. No functional change. Signed-off-by: Sam Protsenko Acked-by: Krzysztof Kozlowski --- Changes in v2: - Fixed checkpatch style suggestion with "--strict" flag drivers/iommu/exynos-iommu.c | 361 +++++++++++++++++------------------ 1 file changed, 180 insertions(+), 181 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index cd3f74e638f0..c995cf8294cf 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -641,187 +641,6 @@ static void sysmmu_tlb_invalidate_entry(struct sysmmu_drvdata *data, spin_unlock_irqrestore(&data->lock, flags); } -static const struct iommu_ops exynos_iommu_ops; - -static int exynos_sysmmu_probe(struct platform_device *pdev) -{ - int irq, ret; - struct device *dev = &pdev->dev; - struct sysmmu_drvdata *data; - struct resource *res; - - data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); - if (!data) - return -ENOMEM; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->sfrbase = devm_ioremap_resource(dev, res); - if (IS_ERR(data->sfrbase)) - return PTR_ERR(data->sfrbase); - - irq = platform_get_irq(pdev, 0); - if (irq <= 0) - return irq; - - ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0, - dev_name(dev), data); - if (ret) { - dev_err(dev, "Unabled to register handler of irq %d\n", irq); - return ret; - } - - data->clk = devm_clk_get(dev, "sysmmu"); - if (PTR_ERR(data->clk) == -ENOENT) - data->clk = NULL; - else if (IS_ERR(data->clk)) - return PTR_ERR(data->clk); - - data->aclk = devm_clk_get(dev, "aclk"); - if (PTR_ERR(data->aclk) == -ENOENT) - data->aclk = NULL; - else if (IS_ERR(data->aclk)) - return PTR_ERR(data->aclk); - - data->pclk = devm_clk_get(dev, "pclk"); - if (PTR_ERR(data->pclk) == -ENOENT) - data->pclk = NULL; - else if (IS_ERR(data->pclk)) - return PTR_ERR(data->pclk); - - if (!data->clk && (!data->aclk || !data->pclk)) { - dev_err(dev, "Failed to get device clock(s)!\n"); - return -ENOENT; - } - - data->clk_master = devm_clk_get(dev, "master"); - if (PTR_ERR(data->clk_master) == -ENOENT) - data->clk_master = NULL; - else if (IS_ERR(data->clk_master)) - return PTR_ERR(data->clk_master); - - data->sysmmu = dev; - spin_lock_init(&data->lock); - - __sysmmu_get_version(data); - - ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL, - dev_name(data->sysmmu)); - if (ret) - return ret; - - ret = iommu_device_register(&data->iommu, &exynos_iommu_ops, dev); - if (ret) - goto err_iommu_register; - - platform_set_drvdata(pdev, data); - - if (PG_ENT_SHIFT < 0) { - if (MMU_MAJ_VER(data->version) < 5) { - PG_ENT_SHIFT = SYSMMU_PG_ENT_SHIFT; - LV1_PROT = SYSMMU_LV1_PROT; - LV2_PROT = SYSMMU_LV2_PROT; - } else { - PG_ENT_SHIFT = SYSMMU_V5_PG_ENT_SHIFT; - LV1_PROT = SYSMMU_V5_LV1_PROT; - LV2_PROT = SYSMMU_V5_LV2_PROT; - } - } - - if (MMU_MAJ_VER(data->version) >= 5) { - ret = dma_set_mask(dev, DMA_BIT_MASK(36)); - if (ret) { - dev_err(dev, "Unable to set DMA mask: %d\n", ret); - goto err_dma_set_mask; - } - } - - /* - * use the first registered sysmmu device for performing - * dma mapping operations on iommu page tables (cpu cache flush) - */ - if (!dma_dev) - dma_dev = &pdev->dev; - - pm_runtime_enable(dev); - - return 0; - -err_dma_set_mask: - iommu_device_unregister(&data->iommu); -err_iommu_register: - iommu_device_sysfs_remove(&data->iommu); - return ret; -} - -static void exynos_sysmmu_shutdown(struct platform_device *pdev) -{ - struct sysmmu_drvdata *data = platform_get_drvdata(pdev); - struct device *dev = &pdev->dev; - int irq = platform_get_irq(pdev, 0); - - devm_free_irq(dev, irq, data); - pm_runtime_force_suspend(dev); -} - -static int __maybe_unused exynos_sysmmu_suspend(struct device *dev) -{ - struct sysmmu_drvdata *data = dev_get_drvdata(dev); - struct device *master = data->master; - - if (master) { - struct exynos_iommu_owner *owner = dev_iommu_priv_get(master); - - mutex_lock(&owner->rpm_lock); - if (data->domain) { - dev_dbg(data->sysmmu, "saving state\n"); - __sysmmu_disable(data); - } - mutex_unlock(&owner->rpm_lock); - } - return 0; -} - -static int __maybe_unused exynos_sysmmu_resume(struct device *dev) -{ - struct sysmmu_drvdata *data = dev_get_drvdata(dev); - struct device *master = data->master; - - if (master) { - struct exynos_iommu_owner *owner = dev_iommu_priv_get(master); - - mutex_lock(&owner->rpm_lock); - if (data->domain) { - dev_dbg(data->sysmmu, "restoring state\n"); - __sysmmu_enable(data); - } - mutex_unlock(&owner->rpm_lock); - } - return 0; -} - -static const struct dev_pm_ops sysmmu_pm_ops = { - SET_RUNTIME_PM_OPS(exynos_sysmmu_suspend, exynos_sysmmu_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -}; - -static const struct of_device_id sysmmu_of_match[] = { - { .compatible = "samsung,exynos-sysmmu", }, - { }, -}; -MODULE_DEVICE_TABLE(of, sysmmu_of_match); - -static struct platform_driver exynos_sysmmu_driver = { - .probe = exynos_sysmmu_probe, - .shutdown = exynos_sysmmu_shutdown, - .driver = { - .name = "exynos-sysmmu", - .of_match_table = sysmmu_of_match, - .pm = &sysmmu_pm_ops, - .suppress_bind_attrs = true, - } -}; - static inline void exynos_iommu_set_pte(sysmmu_pte_t *ent, sysmmu_pte_t val) { dma_sync_single_for_cpu(dma_dev, virt_to_phys(ent), sizeof(*ent), @@ -1428,6 +1247,185 @@ static const struct iommu_ops exynos_iommu_ops = { } }; +static int exynos_sysmmu_probe(struct platform_device *pdev) +{ + int irq, ret; + struct device *dev = &pdev->dev; + struct sysmmu_drvdata *data; + struct resource *res; + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + data->sfrbase = devm_ioremap_resource(dev, res); + if (IS_ERR(data->sfrbase)) + return PTR_ERR(data->sfrbase); + + irq = platform_get_irq(pdev, 0); + if (irq <= 0) + return irq; + + ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0, dev_name(dev), + data); + if (ret) { + dev_err(dev, "Unabled to register handler of irq %d\n", irq); + return ret; + } + + data->clk = devm_clk_get(dev, "sysmmu"); + if (PTR_ERR(data->clk) == -ENOENT) + data->clk = NULL; + else if (IS_ERR(data->clk)) + return PTR_ERR(data->clk); + + data->aclk = devm_clk_get(dev, "aclk"); + if (PTR_ERR(data->aclk) == -ENOENT) + data->aclk = NULL; + else if (IS_ERR(data->aclk)) + return PTR_ERR(data->aclk); + + data->pclk = devm_clk_get(dev, "pclk"); + if (PTR_ERR(data->pclk) == -ENOENT) + data->pclk = NULL; + else if (IS_ERR(data->pclk)) + return PTR_ERR(data->pclk); + + if (!data->clk && (!data->aclk || !data->pclk)) { + dev_err(dev, "Failed to get device clock(s)!\n"); + return -ENOENT; + } + + data->clk_master = devm_clk_get(dev, "master"); + if (PTR_ERR(data->clk_master) == -ENOENT) + data->clk_master = NULL; + else if (IS_ERR(data->clk_master)) + return PTR_ERR(data->clk_master); + + data->sysmmu = dev; + spin_lock_init(&data->lock); + + __sysmmu_get_version(data); + + ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL, + dev_name(data->sysmmu)); + if (ret) + return ret; + + ret = iommu_device_register(&data->iommu, &exynos_iommu_ops, dev); + if (ret) + goto err_iommu_register; + + platform_set_drvdata(pdev, data); + + if (PG_ENT_SHIFT < 0) { + if (MMU_MAJ_VER(data->version) < 5) { + PG_ENT_SHIFT = SYSMMU_PG_ENT_SHIFT; + LV1_PROT = SYSMMU_LV1_PROT; + LV2_PROT = SYSMMU_LV2_PROT; + } else { + PG_ENT_SHIFT = SYSMMU_V5_PG_ENT_SHIFT; + LV1_PROT = SYSMMU_V5_LV1_PROT; + LV2_PROT = SYSMMU_V5_LV2_PROT; + } + } + + if (MMU_MAJ_VER(data->version) >= 5) { + ret = dma_set_mask(dev, DMA_BIT_MASK(36)); + if (ret) { + dev_err(dev, "Unable to set DMA mask: %d\n", ret); + goto err_dma_set_mask; + } + } + + /* + * use the first registered sysmmu device for performing + * dma mapping operations on iommu page tables (cpu cache flush) + */ + if (!dma_dev) + dma_dev = &pdev->dev; + + pm_runtime_enable(dev); + + return 0; + +err_dma_set_mask: + iommu_device_unregister(&data->iommu); +err_iommu_register: + iommu_device_sysfs_remove(&data->iommu); + return ret; +} + +static void exynos_sysmmu_shutdown(struct platform_device *pdev) +{ + struct sysmmu_drvdata *data = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; + int irq = platform_get_irq(pdev, 0); + + devm_free_irq(dev, irq, data); + pm_runtime_force_suspend(dev); +} + +static int __maybe_unused exynos_sysmmu_suspend(struct device *dev) +{ + struct sysmmu_drvdata *data = dev_get_drvdata(dev); + struct device *master = data->master; + + if (master) { + struct exynos_iommu_owner *owner = dev_iommu_priv_get(master); + + mutex_lock(&owner->rpm_lock); + if (data->domain) { + dev_dbg(data->sysmmu, "saving state\n"); + __sysmmu_disable(data); + } + mutex_unlock(&owner->rpm_lock); + } + return 0; +} + +static int __maybe_unused exynos_sysmmu_resume(struct device *dev) +{ + struct sysmmu_drvdata *data = dev_get_drvdata(dev); + struct device *master = data->master; + + if (master) { + struct exynos_iommu_owner *owner = dev_iommu_priv_get(master); + + mutex_lock(&owner->rpm_lock); + if (data->domain) { + dev_dbg(data->sysmmu, "restoring state\n"); + __sysmmu_enable(data); + } + mutex_unlock(&owner->rpm_lock); + } + return 0; +} + +static const struct dev_pm_ops sysmmu_pm_ops = { + SET_RUNTIME_PM_OPS(exynos_sysmmu_suspend, exynos_sysmmu_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +}; + +static const struct of_device_id sysmmu_of_match[] = { + { .compatible = "samsung,exynos-sysmmu", }, + { }, +}; +MODULE_DEVICE_TABLE(of, sysmmu_of_match); + +static struct platform_driver exynos_sysmmu_driver = { + .probe = exynos_sysmmu_probe, + .shutdown = exynos_sysmmu_shutdown, + .driver = { + .name = "exynos-sysmmu", + .of_match_table = sysmmu_of_match, + .pm = &sysmmu_pm_ops, + .suppress_bind_attrs = true, + } +}; + static int __init exynos_iommu_init(void) { struct device_node *np; @@ -1461,6 +1459,7 @@ static int __init exynos_iommu_init(void) } return 0; + err_zero_lv2: platform_driver_unregister(&exynos_sysmmu_driver); err_reg_driver: From patchwork Thu Nov 3 19:51:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 15131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp736806wru; Thu, 3 Nov 2022 12:54:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5tdYDyY898qSLeN5W94lpVo2F69GNifBbi5rF2fX8pTj9Bl7xf5UtseV7VvN8mQlPiX5d5 X-Received: by 2002:a17:906:ee89:b0:73d:70c5:1a4e with SMTP id wt9-20020a170906ee8900b0073d70c51a4emr29913960ejb.683.1667505268912; Thu, 03 Nov 2022 12:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505268; cv=none; d=google.com; s=arc-20160816; b=e9ly1IpJAAlpv8bWZBmj3ubtXUr+w/mSi0Kz6Xh2Wz98pp3wEFYk7m915Rvjawdge5 s5pl2QeepNEOoeYnC1ZyG0QbPaQqD4JZxlhfWG+nPpiJ036DF2uVfTiG0YRYrn/xfPt6 ydR6MdJ/hrJeRprgBaNPNi0W82Po5Pvj0sOEDFyvFEBBcGt7HO68c0DZZF2MzyBnXkPZ MhBPG2a6beAMsdfEZWUkcta0Yo9LPzWSSW+sUQFCjqQBL5OvZ7seVnmq51BGva1IeUfa LDupfALb4YQ91qk8j27gXnANr+P6PW5LdjpMNr0mJIF9EXXa4pxbYbZ8u7yxrU43Aywq DXwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oVK/kV0R0vkenb2LDbscFxA0X0dByuia1tz97ff80yM=; b=l5dwDjf71Rh0a0730vqax7YAvUAe/KdX9HX7m++lywsmf0DhfRdvW2ZSqKZB6XPfpQ 8PItjhGuuUs4Khrntup1jrR4wMhudHyozJpkdHv5qPg060hsPi8w/HyN0XB9/9XiwoG9 3KVG6hesag8UX7cCjhUUwmIXcTvmegPvWPFR6x4daFT1ehFnS1CrS+Wovc9tEOJB9xlV TS9t8b7pZ/OFG52fJGHVMfvNNsxy3qehw4iOgN3SY2V3NvIOYRfBu8u2WYHRE6Ds4gej ixm5ZrzfVXdx6uyz//uuu7jZKC9qdLCmcMaZ/U5tQr/nGEQ1R24DT/39eaZCGV2UAYU5 DZaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yjqdzBc5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170906640c00b007ae2dfe020bsi293945ejm.783.2022.11.03.12.54.05; Thu, 03 Nov 2022 12:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yjqdzBc5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230405AbiKCTwT (ORCPT + 99 others); Thu, 3 Nov 2022 15:52:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbiKCTwG (ORCPT ); Thu, 3 Nov 2022 15:52:06 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35C5E20358 for ; Thu, 3 Nov 2022 12:52:06 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id v27so4718211eda.1 for ; Thu, 03 Nov 2022 12:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oVK/kV0R0vkenb2LDbscFxA0X0dByuia1tz97ff80yM=; b=yjqdzBc5QkyWO8tIOpyy1HtXjyZWn0cIpOjMTkb96S3bxh24aATJ8xyBB1R/B77CcN NObHEXqX95u/z65/XPcAc2WpVxQKcNaxILUDOynzEmr1ML60iu9C07+LqmPtznkychUZ U9kL90pOsziktU0wt5b2868dOA9QSFgj2X/BX+G6yE/NYEQYIYBP/r/DhrDopUiHidb2 c39d5XT8elagWGepDKVNz/nymSi2onmOLUbPW85gTrTHZd6MnqlK+lVA2WT/cxSGl82j l9XHJYIoXhBrnlmf27/QcKjQSI8RtSLMN87uzifXjW670JH8PGoZxwEFBkTmWPyXeMLy F8Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oVK/kV0R0vkenb2LDbscFxA0X0dByuia1tz97ff80yM=; b=XynQxUIUFWZDvWPjOCNITzFbMRwTm2RHuCaa3gqhBFwCb+4hZfHx9sv6b8dUGHmYsz w/WNDo78v6guKbuLHLeY4/Y6hFeXaOlQF5YyTCaNBPhL//A6DbI2aC3fynzlqxbCFH5p 5jF4XtyNOUWk0tFqlvgEG0d0UssmLBCwEWlUa7/ggo17VE9QSYDv2LACaL+sgrgW4Wkq AzcG2ew8nIEKuAmswPl89Iy2UW6UoP+vVl0re0F/efKpFFc3y58B2Cz7FBND20vCBKnR 8RBBUHZZGaYlHvkn3pc1yOtcNhc8ABq7qBN4P/0xlo5p9WollEB0ZFn26PE8Y1U4nAYn Tlmw== X-Gm-Message-State: ACrzQf0Wn21oLCQYYnZ/0Jmjq+ppevGbRFkTizd3Qrv+dpSK6/hkceX2 feQ5d2aH+qKunYYzIl9g8hq5Ow== X-Received: by 2002:a05:6402:1c0a:b0:463:3cda:3750 with SMTP id ck10-20020a0564021c0a00b004633cda3750mr26374259edb.341.1667505125822; Thu, 03 Nov 2022 12:52:05 -0700 (PDT) Received: from localhost (cgw.msart-bajzova4.ke.cust.o2bs.sk. [90.176.4.227]) by smtp.gmail.com with ESMTPSA id n19-20020a170906165300b0078907275a44sm863484ejd.42.2022.11.03.12.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 12:52:05 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Sumit Semwal , Alim Akhtar , Janghyuck Kim , Cho KyongHo , Daniel Mentz , David Virag , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 6/6] media: platform: Use IS_ENABLED() to check EXYNOS_IOMMU in s5p_mfc Date: Thu, 3 Nov 2022 20:51:54 +0100 Message-Id: <20221103195154.21495-7-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103195154.21495-1-semen.protsenko@linaro.org> References: <20221103195154.21495-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506004837699127?= X-GMAIL-MSGID: =?utf-8?q?1748506004837699127?= Now that CONFIG_EXYNOS_IOMMU can be built as a module, it's not correct anymore to check whether it's enabled or not just with #ifdef. Use proper IS_ENABLED() macro to handle both built-in and module cases. Signed-off-by: Sam Protsenko Acked-by: Krzysztof Kozlowski --- Changes in v2: - New patch drivers/media/platform/samsung/s5p-mfc/s5p_mfc_iommu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_iommu.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_iommu.h index 1a32266b7ddc..a8b48692d128 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_iommu.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_iommu.h @@ -7,7 +7,9 @@ #ifndef S5P_MFC_IOMMU_H_ #define S5P_MFC_IOMMU_H_ -#if defined(CONFIG_EXYNOS_IOMMU) +#include + +#if IS_ENABLED(CONFIG_EXYNOS_IOMMU) #include