Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp111458rdb; Wed, 29 Nov 2023 22:56:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQr+XG69Q7OwbnuI5ltFIYUYZJZDr1zrnBMiZorNVcdEKkH1dt1n86m5sUhvlrS1p9o5Vf X-Received: by 2002:a05:6a21:2724:b0:15b:c800:48af with SMTP id rm36-20020a056a21272400b0015bc80048afmr17556091pzb.23.1701327369190; Wed, 29 Nov 2023 22:56:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701327368; cv=none; d=google.com; s=arc-20160816; b=wo1v2eVSXOWKvc8jsCtlC/WxV4WkaDFgnQUfnP6BMjdejp8/ykrllD74ny3Ae7fAN6 ZsN/9sFI7okkJhDuxLL7uilz4BiJbwaXuCqlc5c1ykZPON5CGmM+MjpaJbjpRs8jCBIS IO5nZJ2yGiUPcCdFrUz21XQ0vP+yf+RSbd3NNu4DUZR4nFYaSo7G0NtHvuwjOsSiIwas M4TVkZv4rPFbT48Mhq0H9ELNK/Nf8i7qZuNzYLmU4Aod8YsF/o8Iu56AYQQX1cfVBn6B Sl/0oTmJ944dSkfZMGB0NIrmaCmQdBFsoKLVGxw1pZ+oE/o56vjlkconDSjKPjsc8ONa +zig== 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:in-reply-to :mime-version:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=M3WQo99x16DxEeS8ZvdjBiRfWBfFI96MpCrGA2ivIO8=; fh=/3gjuN7Pq1knTEHRPZGcPnZRb8BPnv3HdTPYhTeUYWw=; b=hEAIhwr6Twfc3IHLAdlRDwYz6nJQXqNluTnCX7cy2at+gY0v+bPVkwGX9rxDacil+O pZEULihxyhHBTXPZUHvOFNtQEf0q4Ey2rGYw8wsZBHEPLSojTXQ2S/h9EcOxICJhlDaJ nIKTmyb+OTNYvClaaeo5BifEZveeXGu1sf3ewrahlGvz5fq2F5pvoVN2FklT1lBrCOK0 /5uV6Xhr+HCsJemUHJu1urZYW+X9jfVTXuIU1x09prO5l6HlvTlqDp5s4NM0klqJT5gj nifynuc1yh8XLwnYHCItJa1iUE8GKZANtyIXnFfhbUxs3s+iWpx5eAXGRvV13PRKCIXa Fraw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YGh7T36I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id lw1-20020a17090b180100b0028596b1c1bbsi3116923pjb.90.2023.11.29.22.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 22:56:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YGh7T36I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 8A21D81F3936; Wed, 29 Nov 2023 22:56:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344635AbjK3Gzr (ORCPT + 99 others); Thu, 30 Nov 2023 01:55:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjK3Gzq (ORCPT ); Thu, 30 Nov 2023 01:55:46 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D67E91AD for ; Wed, 29 Nov 2023 22:55:47 -0800 (PST) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231130065541epoutp04a11682981492da02cda5cf684b37485d~cVDQGXd562703127031epoutp04j for ; Thu, 30 Nov 2023 06:55:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231130065541epoutp04a11682981492da02cda5cf684b37485d~cVDQGXd562703127031epoutp04j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701327341; bh=M3WQo99x16DxEeS8ZvdjBiRfWBfFI96MpCrGA2ivIO8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YGh7T36IrKF7nyHljg331GfZ7dziZriq+0eSq4e3OZevNufjCJ0eUrgpcq34qdz1m zJcngzVUhk0uTBBtSGnxkMWMFbwgpYEBZxnzcwirX9PeN9vdyCV5c6HTohIhCoOmik UCmdIrqdvV6JkN8QTulm0LLPoZQa28vYtvtEwSqQ= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20231130065540epcas2p12b9245d20693a8696c738df3b1839873~cVDO_dT2s1368613686epcas2p1c; Thu, 30 Nov 2023 06:55:40 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.99]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Sgn5R6pjMz4x9QK; Thu, 30 Nov 2023 06:55:39 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 3B.DE.10006.BE138656; Thu, 30 Nov 2023 15:55:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20231130065539epcas2p2b3a7a9a83eed1b37bea7e4bae101287e~cVDOE_zSl0407704077epcas2p2H; Thu, 30 Nov 2023 06:55:39 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231130065539epsmtrp2d57f31985f2487fbb836776a58151707~cVDOEYbyE1048910489epsmtrp2H; Thu, 30 Nov 2023 06:55:39 +0000 (GMT) X-AuditID: b6c32a45-179ff70000002716-ca-656831ebedb9 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D2.E5.08755.BE138656; Thu, 30 Nov 2023 15:55:39 +0900 (KST) Received: from perf (unknown [10.229.95.91]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231130065539epsmtip2f983996f97b3f4870fb03788ce67539e~cVDN1B6Mm1544015440epsmtip2n; Thu, 30 Nov 2023 06:55:39 +0000 (GMT) Date: Thu, 30 Nov 2023 16:30:45 +0900 From: Youngmin Nam To: Sam Protsenko Cc: tomasz.figa@gmail.com, krzysztof.kozlowski@linaro.org, s.nawrocki@samsung.com, alim.akhtar@samsung.com, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] pinctrl: samsung: add irq_set_affinity() for non wake up external gpio interrupt Message-ID: MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEJsWRmVeSWpSXmKPExsWy7bCmqe5rw4xUg0lNxhYP5m1js9j7eiu7 xZQ/y5ksNj2+xmqxef4fRovLu+awWcw4v4/J4vCbdlaL531A1qpdfxgduDx2zrrL7nHn2h42 j81L6j36tqxi9Pi8SS6ANSrbJiM1MSW1SCE1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539epcas2p2b3a7a9a83eed1b37bea7e4bae101287e X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----beKDcrNeaD4oBIFRuchmvdVAwfnDGI5TYPt7fforSuRq9wgD=_42057_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231126091120epcas2p4a1320e3b0f9be8f8a0f575a322981d38 References: <20231126094618.2545116-1-youngmin.nam@samsung.com> <1fd55b36-0837-4bf7-9fde-e573d6cb214a@linaro.org> 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 22:56:05 -0800 (PST) ------beKDcrNeaD4oBIFRuchmvdVAwfnDGI5TYPt7fforSuRq9wgD=_42057_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Wed, Nov 29, 2023 at 12:48:56PM -0600, Sam Protsenko wrote: > On Wed, Nov 29, 2023 at 12:32 AM Youngmin Nam wrote: > > > I tried to test this patch on E850-96, and an attempt to write into > > > smp_affinity (for some GPIO irq) also fails for me: > > > > > > # echo f0 > smp_affinity > > > -bash: echo: write error: Input/output error > > > > > > When I add some pr_err() to exynos_irq_set_affinity(), I can't see > > > those printed in dmesg. So I guess exynos_irq_set_affinity() doesn't > > > get called at all. So the error probably happens before > > > .irq_set_affinity callback gets called. > > > > > > Youngmin, can you please try and test this patch on E850-96? This > > > board is already supported in upstream kernel. For example you can use > > > "Volume Up" interrupt for the test, which is GPIO irq. > > > > > > > I intened this affinity setting would work only on *Non* Wakeup External Interrupt. > > The "Volume Up" on E850-96 board is connected with "gpa0-7" and > > that is Wakeup External interrupt so that we can't test the callback. > > > > Oh no. It was really silly mistake on my part :) But please check my > answer below for good news. > > > I couldn't find out a pin for the test on E850-96 board yet. > > We can test if there is a usage of *Non" Wake up External Interrupt of GPIO > > on E850-96 board. > > > > Do you have any idea ? > > > > Yep, just managed to successfully test your patch on E850-96. My > testing procedure below might appear messy, but I didn't want to do > any extra soldering :) > > Used GPG1[0] pin for testing. As you can see from schematics [1], > GPG1[0] is connected to R196 resistor (which is not installed on the > board). > > I've modified E850-96 dts file like this: > > 8<---------------------------------------------------------------------------->8 > gpio-keys { > compatible = "gpio-keys"; > pinctrl-names = "default"; > - pinctrl-0 = <&key_voldown_pins &key_volup_pins>; > + pinctrl-0 = <&key_voldown_pins &key_volup_pins &key_test_pins>; > > ... > > + test-key { > + label = "Test Key"; > + linux,code = ; > + gpios = <&gpg1 0 GPIO_ACTIVE_LOW>; > + }; > }; > > ... > > +&pinctrl_peri { > + key_test_pins: key-test-pins { > + samsung,pins = "gpg1-0"; > + samsung,pin-function = ; > + samsung,pin-pud = ; > + samsung,pin-drv = ; > + }; > +}; > 8<---------------------------------------------------------------------------->8 > > It appeared in /proc/interrupts as follows: > > 87: 2 0 0 0 0 > 0 0 0 gpg1 0 Edge Test Key > > Then I touched R196 resistor pads with my finger (emulating key press) > and looked again at /proc/interrupts: > > 87: 444 0 0 0 0 > 0 0 0 gpg1 0 Edge Test Key > > Then I reconfigured smp_affinity like so: > > # cat /proc/irq/87/smp_affinity > ff > # echo f0 > /proc/irq/87/smp_affinity > # cat /proc/irq/87/smp_affinity > f0 > > Then I messed with R196 resistor pads with my finger again, and > re-checked /proc/interrupts: > > CPU0 CPU1 CPU2 CPU3 CPU4 > CPU5 CPU6 CPU7 > 87: 444 0 0 0 234 > 0 0 0 gpg1 0 Edge Test Key > > And without this patch that procedure above of course doesn't work. > > So as far as I'm concerned, feel free to add: > > Tested-by: Sam Protsenko > > [1] https://protect2.fireeye.com/v1/url?k=d3eebafe-8c7293d4-d3ef31b1-000babe598f7-06c0db00473e1bca&q=1&e=855a917d-d0f9-49cd-8e05-7cccf44d06a8&u=https%3A%2F%2Fwww.96boards.org%2Fdocumentation%2Fconsumer%2Fe850-96b%2Fhardware-docs%2Ffiles%2Fe850-96b-schematics.pdf > > Thanks! > Thanks for your test Sam. It's really great work. I confirmed the patch did work by following your test sequence as below. * Before CPU0 CPU1 CPU2 CPU3 CPU4 ... 87: 40 0 0 0 0 ... gpg1 0 Edge Test Key * After 87: 40 0 0 0 22 ... gpg1 0 Edge Test Key Krzysztof, Sam and I tested this patch on e850-95 board. Let me update commit message with test result and will update patchset. Thanks. ------beKDcrNeaD4oBIFRuchmvdVAwfnDGI5TYPt7fforSuRq9wgD=_42057_ Content-Type: text/plain; charset="utf-8" ------beKDcrNeaD4oBIFRuchmvdVAwfnDGI5TYPt7fforSuRq9wgD=_42057_--