Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1563848rdb; Sun, 19 Nov 2023 00:55:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEp9ALzKQVm+gy02Fde8ctGIvFqLgIuLDT6NeU4KA0oee4cE7JDdSn6KpMrZCJrxs1r00hQ X-Received: by 2002:a05:6870:e2d0:b0:1d6:5b09:1584 with SMTP id w16-20020a056870e2d000b001d65b091584mr5591165oad.5.1700384103148; Sun, 19 Nov 2023 00:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700384103; cv=none; d=google.com; s=arc-20160816; b=YpJNnwlFEvUkulXNAwXtNdxOsE+x/RJ3zPegx9tmN7o8z+Y5bib9EMkNEOKKV1mFe6 5G/sECZ+qdcChQT7za1RYKA7xQFYBGdrwBlVDYuLSDbnInaQE22hIZw5xlOyroZnkHPR KMesJls4M+OOOHp2UyzQBmZU7fgFe2J3BGHT/I1sEYljZa4nLeT53SrOOkH481OxQg+Y Rx5e50V9XkAmNo4fx6ebTFt06zoJ2L0nSzUFtp0M6ZHl+uyGdFj62PtBxHbbzWYeiP2p DwxMoxlKIVnTOeGAzzkYO5tkwKNcBEm8nbeUCVzg+4R7r5VaG0+vhpodmikqjru+5IH1 N8BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=aUl24Gac6V4qeYPQFo9QasuwMm4N5iU9VP5YIzb5kFs=; fh=UOWUHydFlZyUEt6ulKh2rg45KKSpuCfCDZgfOZ7i+EU=; b=bZPl5Ec4T5awMwJiz/y2BsY8MHCeKr5i8a6aMQiH0G14dP/BGJlE6E2Na613JW0Q3L 96sTVwKJaPZpSgfquywCpJiB+AQ9L1QYxXX79fvWk9+5Si5pWcL/1/YPGiEZCE7rlX2c wP8N5KHY23CSgtYHKZWm31vwqjEL7aV6DHzUBinx6l0qlt4OTc0d3lFqJQKaILzGCyNn du9wIeWYEj7nBVDT/sG1h0QAYlmceovhubGIgf0UHidIzIKbEqJoUkQbYmsXCQ4H3BkG AvGV6Ip+7/SX5Zikplc51cZXJtE6ffmIg1XA+sUbrVv4ABc7P4Qz8/esCCRFXrJaAVew Hl5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sCuuYSSy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id f36-20020a17090a702700b0027ce6cd3144si7791019pjk.126.2023.11.19.00.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 00:55:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sCuuYSSy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 266468056A34; Sun, 19 Nov 2023 00:55:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjKSIyy (ORCPT + 99 others); Sun, 19 Nov 2023 03:54:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjKSIyx (ORCPT ); Sun, 19 Nov 2023 03:54:53 -0500 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC0BE5 for ; Sun, 19 Nov 2023 00:54:48 -0800 (PST) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20231119085443epoutp022f23a6f1f3616becbe28c2b1aa5218b6~Y_lCm_Vvm2602726027epoutp02R for ; Sun, 19 Nov 2023 08:54:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20231119085443epoutp022f23a6f1f3616becbe28c2b1aa5218b6~Y_lCm_Vvm2602726027epoutp02R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700384083; bh=aUl24Gac6V4qeYPQFo9QasuwMm4N5iU9VP5YIzb5kFs=; h=From:To:Cc:Subject:Date:References:From; b=sCuuYSSydd5RKckJ43Qr6SeMmEBAD4LV1ReXNhDZMAPdyE5GABAxJLsDA8mBvbPiU nXJ9sj8M71m2MM5FLozUfza57FtBjiGW2xAN9wLwh2pqnNj+Tkx8DsOTdTt007AzGU YASC24rqoBy+4IJTV3jF8LwadXitnnaMfvOqcwjI= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20231119085442epcas2p370350440fbfcf488feb10a8e309a2ac4~Y_lBUYAx71040310403epcas2p3y; Sun, 19 Nov 2023 08:54:42 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.89]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4SY4Fs6ncwz4x9Pp; Sun, 19 Nov 2023 08:54:41 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 1A.9C.10022.15DC9556; Sun, 19 Nov 2023 17:54:41 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20231119085440epcas2p375fa3b2999e1a3ceeff9949136db7e28~Y_k-zOBqs1033410334epcas2p35; Sun, 19 Nov 2023 08:54:40 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231119085440epsmtrp1dbac461351964514c6477a126c1ee07d~Y_k-yeKgU2939629396epsmtrp1h; Sun, 19 Nov 2023 08:54:40 +0000 (GMT) X-AuditID: b6c32a47-9a3ff70000002726-ba-6559cd5151cd Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 63.0A.18939.05DC9556; Sun, 19 Nov 2023 17:54:40 +0900 (KST) Received: from perf.dsn.sec.samsung.com (unknown [10.229.95.91]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231119085440epsmtip2c458c7eef622a9fabea8b8d2e7842d12~Y_k-kPdsJ3102631026epsmtip2t; Sun, 19 Nov 2023 08:54:40 +0000 (GMT) From: Youngmin Nam To: tomasz.figa@gmail.com, krzysztof.kozlowski@linaro.org, s.nawrocki@samsung.com, alim.akhtar@samsung.com, linus.walleij@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, semen.protsenko@linaro.org, Youngmin Nam Subject: [PATCH] pinctrl: samsung: add irq_set_affinity() for non wake up external gpio interrupt Date: Sun, 19 Nov 2023 18:29:09 +0900 Message-Id: <20231119092909.3018578-1-youngmin.nam@samsung.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjk+LIzCtJLcpLzFFi42LZdljTXDfwbGSq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4kQAcY1Q7M8CAAA= X-CMS-MailID: 20231119085440epcas2p375fa3b2999e1a3ceeff9949136db7e28 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231119085440epcas2p375fa3b2999e1a3ceeff9949136db7e28 References: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 19 Nov 2023 00:55:00 -0800 (PST) To support affinity setting for non wake up external gpio interrupt, we add a new irq_set_affinity callback using irq number which is in pinctrl driver data. Before applying this patch, we couldn't change irq affinity of gpio interrupt. * before erd9945:/proc/irq/418 # cat smp_affinity 3ff erd9945:/proc/irq/418 # echo 00f > smp_affinity erd9945:/proc/irq/418 # cat smp_affinity 3ff erd9945:/proc/irq/418 # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 CPU8 CPU9 418: 3631 0 0 0 0 0 0 0 0 0 gpg2 0 Edge 19100000.drmdecon After applying this patch, we can change irq affinity of gpio interrupt as below. * after erd9945:/proc/irq/418 # cat smp_affinity 3ff erd9945:/proc/irq/418 # echo 00f > smp_affinity erd9945:/proc/irq/418 # cat smp_affinity 00f erd9945:/proc/irq/418 # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 CPU8 CPU9 418: 3893 201 181 188 0 0 0 0 0 0 gpg2 0 Edge 19100000.drmdecon Signed-off-by: Youngmin Nam --- drivers/pinctrl/samsung/pinctrl-exynos.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 6b58ec84e34b..5d7b788282e9 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -147,6 +147,19 @@ static int exynos_irq_set_type(struct irq_data *irqd, unsigned int type) return 0; } +static int exynos_irq_set_affinity(struct irq_data *irqd, + const struct cpumask *dest, bool force) +{ + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); + struct samsung_pinctrl_drv_data *d = bank->drvdata; + struct irq_data *parent = irq_get_irq_data(d->irq); + + if (parent) + return parent->chip->irq_set_affinity(parent, dest, force); + + return -EINVAL; +} + static int exynos_irq_request_resources(struct irq_data *irqd) { struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); @@ -212,6 +225,7 @@ static const struct exynos_irq_chip exynos_gpio_irq_chip __initconst = { .irq_mask = exynos_irq_mask, .irq_ack = exynos_irq_ack, .irq_set_type = exynos_irq_set_type, + .irq_set_affinity = exynos_irq_set_affinity, .irq_request_resources = exynos_irq_request_resources, .irq_release_resources = exynos_irq_release_resources, }, -- 2.39.2