From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9DC5C4338F for ; Tue, 3 Aug 2021 09:53:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FEC160F8F for ; Tue, 3 Aug 2021 09:53:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6FEC160F8F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Bzn91KjJcFNb5CtZDWeGyxIiSBaZWgtCM8aXayxkOC4=; b=14F7JusvzfAbvPKAFTBMtL0oFG +8jWX5Zn+I7Hf+wpeMYW9XLIM5hCM+ct4s1vk/d7npNeSCl3eNoarT3mkyrikn0kkgtu8/cRa0CU0 iqi+Ea7VeDdW6Iqn0Y2f41zlb8nb4N/Ken6gwkf3eaT6H1cilIz+IAob7fA7rQ0EQV7v2iQeY1Ta7 w3toHOHiXN4sXOHhrUTGNEL4Py4l1DCNFlL1csvMxQoOQZxbncnecm6BWsOTgydY252S2CRVsytll rXnGOyUtm7UGrwFaDXIYARPzSoFIqp56F1KQ1QTdiHMyiqbEdETC0me1WU9CQNXg/9LO1TsQn7SXm R/lJLyKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAr5j-001t1p-NA; Tue, 03 Aug 2021 09:52:07 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAr5e-001szx-RV for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 09:52:05 +0000 Received: by mail-wr1-x431.google.com with SMTP id z4so24666559wrv.11 for ; Tue, 03 Aug 2021 02:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4gQJBKlzRibFbCxRwc6BlJ20DMbJbZxNp2rWsHTFOQE=; b=TmTzGbUM4+f5CoXJvTPUMFGksh0sJGXwGL0TxO4qQmG61cUKZaXxauAnSCavkGiPPm tUdqVOUy1gh5Cbhr1NMiBnbt7rBOBhZfBl5Rnk3aIyYn9AdP1xWXWvjmVpoHlocvf07O G8fBHnSSmEdA/dUE3zQTMYInuIpMb8yHT7zh0mT2fQ0CM7T5CSPQPwjGRvtz4eFrG1Xi WcYAft/5DKYktu5gDkE9lT2ySiYZ/IBSOfB3vE4RD+pFZ6jklAuN3+QS3a1Qi+/N+mPL RJqnntqRiZoJATG1l7ITZntDvlHHWGXK9oRlm93/5GQtl7MwcAKkVy4Rlrtc6cxDN2/P A+Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=4gQJBKlzRibFbCxRwc6BlJ20DMbJbZxNp2rWsHTFOQE=; b=fzb0OlVbZgL4Zk8YbTQTHqIdJ+4vbgwIv4lhfyK0kUAqFmlj5+q8E2Cd6QQ7XR4jTa L7hPzeQ0V89Fvfn+bdxewP+qJD2r1/G2lRe9kf8It3nZKnIS++vj/Kvr4ZCJpgj9ffU6 lcPqNQBIAPETY8Uy68B5mFI2Mk+8A6Ici/a3TOTm0oS1kPMrlf8TxGWiP7R1vJG8h7sx IjhBgE2G7i/VMu/z5c3j7tTJB8l5Rqy99jst+JAhoMIrjSbwwj7LtWbnJKrFL/UXvvlK CSXCOXAaCkCEluXRJJp70cIwbO9Kd3zv+cEUp7L7M+EtGR/o9o0+2JwNN8gCs2ZXa/Ll 3mGw== X-Gm-Message-State: AOAM533KpFg+vpc1tKZa1XOQYjadeM1klC/hJxAineFkTtAfHDW5Wwhm cYj15ezCSSyU0gmRX1W1SJXdYw== X-Google-Smtp-Source: ABdhPJzIYDMM/ya7SaDr9xxc7OGvCr7NyH8MwD14oMOWDzZ0u6nlb2wmEiH5s0LoEr1s7qe7Dkj9mA== X-Received: by 2002:adf:f351:: with SMTP id e17mr22230429wrp.360.1627984320337; Tue, 03 Aug 2021 02:52:00 -0700 (PDT) Received: from ?IPv6:2001:861:44c0:66c0:97a4:5347:fbdb:4cb7? ([2001:861:44c0:66c0:97a4:5347:fbdb:4cb7]) by smtp.gmail.com with ESMTPSA id j14sm14123968wru.58.2021.08.03.02.51.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Aug 2021 02:51:59 -0700 (PDT) Subject: Re: [PATCH 1/2] irqchip: irq-meson-gpio: make it possible to build as a module To: Marc Zyngier , Kevin Hilman Cc: Lee Jones , Jerome Brunet , linux-amlogic@lists.infradead.org, linux-arm-kernel , open list , Saravana Kannan References: <20201020072532.949137-1-narmstrong@baylibre.com> <20201020072532.949137-2-narmstrong@baylibre.com> <7hsga8kb8z.fsf@baylibre.com> <87r1hwwier.wl-maz@kernel.org> <7h7diwgjup.fsf@baylibre.com> <87im0m277h.wl-maz@kernel.org> From: Neil Armstrong Organization: Baylibre Message-ID: Date: Tue, 3 Aug 2021 11:51:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87im0m277h.wl-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_025202_995165_CC3B9E3F X-CRM114-Status: GOOD ( 31.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03/08/2021 11:44, Marc Zyngier wrote: > On Mon, 14 Jun 2021 23:30:22 +0100, > Kevin Hilman wrote: >> >> Marc Zyngier writes: >> >>> On Fri, 21 May 2021 10:47:48 +0100, >>> Lee Jones wrote: >>>> >>>> [1 ] >>>> On Tue, 20 Oct 2020 at 19:23, Kevin Hilman wrote: >>>> >>>>> Neil Armstrong writes: >>>>> >>>>>> In order to reduce the kernel Image size on multi-platform distributions, >>>>>> make it possible to build the Amlogic GPIO IRQ controller as a module >>>>>> by switching it to a platform driver. >>>>>> >>>>>> Signed-off-by: Neil Armstrong >>>>> >>>>> Reviewed-by: Kevin Hilman >>>>> Tested-by: Kevin Hilman >>>>> >>>>> Tested as a module on meson-sm1-khadas-vim3l where the wired networking >>>>> uses GPIO IRQs. >>>>> >>>> >>>> Good morning Neil, Kevin, >>>> >>>> What happened to this set in the end? I still don't see it in Mainline. >>> >>> Last time I tried this patch, it broke my test setup in non-obvious >>> ways. Has someone checked that the issue I reported back then has been >>> resolved now that fw_devlink is more usable? >> >> OK, after much anticipation (and much delay due to me forgetting about >> this), I just gave this series a spin again on top of v5.13-rc6, and it >> seems to work fine with `fw_devlink=on` >> >> I started with your config[1] and accepting all the defaults of any new >> configs. IOW, I ran: yes '' | make oldconfig after copying your config >> to .config. >> >> With that it seems to be working fine for me. >> >> Right after boot (and before network probes) I see module loaded, but no >> users yet in /proc/interrupts: >> >> / # uname -a >> Linux buildroot 5.13.0-rc6-00002-g679c8e852942 #5 SMP PREEMPT Mon Jun 14 15:08:40 PDT 2021 aarch64 GNU/Linux >> / # lsmod |grep gpio >> irq_meson_gpio 20480 0 >> leds_gpio 16384 0 >> / # cat /proc/interrupts >> CPU0 CPU1 CPU2 CPU3 >> 9: 0 0 0 0 GICv2 25 Level vgic >> 11: 0 0 0 0 GICv2 30 Level kvm guest ptimer >> 12: 0 0 0 0 GICv2 27 Level kvm guest vtimer >> 13: 1416 916 534 1421 GICv2 26 Level arch_timer >> 15: 5 0 0 0 GICv2 89 Edge dw_hdmi_top_irq, ff600000.hdmi-tx >> 22: 38 0 0 0 GICv2 225 Edge ttyAML0 >> 23: 20 0 0 0 GICv2 227 Edge ff805000.i2c >> 25: 2 0 0 0 GICv2 232 Edge ff809000.adc >> 28: 322 0 0 0 GICv2 35 Edge meson >> 31: 0 0 0 0 GICv2 222 Edge ffe05000.sd >> 32: 787 0 0 0 GICv2 223 Edge ffe07000.mmc >> 34: 0 0 0 0 GICv2 194 Level panfrost-job >> 35: 0 0 0 0 GICv2 193 Level panfrost-mmu >> 36: 3 0 0 0 GICv2 192 Level panfrost-gpu >> 39: 0 0 0 0 GICv2 63 Level ff400000.usb, ff400000.usb >> 40: 32 0 0 0 GICv2 62 Level xhci-hcd:usb1 >> IPI0: 425 544 664 925 Rescheduling interrupts >> IPI1: 86 166 269 136 Function call interrupts >> IPI2: 0 0 0 0 CPU stop interrupts >> IPI3: 0 0 0 0 CPU stop (for crash dump) interrupts >> IPI4: 0 0 0 0 Timer broadcast interrupts >> IPI5: 0 0 0 0 IRQ work interrupts >> IPI6: 0 0 0 0 CPU wake-up interrupts >> Err: 0 >> >> So then I init the network interface and PHY works, DHCP works etc. >> >> / # udhcpc >> udhcpc: started, v1.31.1 >> [ 102.250449] meson8b-dwmac ff3f0000.ethernet eth0: PHY [0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=37) >> [ 102.256413] meson8b-dwmac ff3f0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 >> [ 102.269433] meson8b-dwmac ff3f0000.ethernet eth0: No Safety Features support found >> [ 102.271357] meson8b-dwmac ff3f0000.ethernet eth0: PTP not supported by HW >> [ 102.278493] meson8b-dwmac ff3f0000.ethernet eth0: configuring for phy/rgmii link mode >> udhcpc: sending discover >> [ 104.743301] meson8b-dwmac ff3f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx >> [ 104.746470] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready >> udhcpc: sending discover >> udhcpc: sending select for 192.168.0.122 >> udhcpc: lease of 192.168.0.122 obtained, lease time 600 >> deleting routers >> adding dns 192.168.0.254 >> adding dns 192.168.0.254 >> / # cat /proc/interrupts >> CPU0 CPU1 CPU2 CPU3 >> 9: 0 0 0 0 GICv2 25 Level vgic >> 11: 0 0 0 0 GICv2 30 Level kvm guest ptimer >> 12: 0 0 0 0 GICv2 27 Level kvm guest vtimer >> 13: 1575 1018 604 1588 GICv2 26 Level arch_timer >> 14: 8 0 0 0 GICv2 40 Level eth0 >> 15: 5 0 0 0 GICv2 89 Edge dw_hdmi_top_irq, ff600000.hdmi-tx >> 22: 132 0 0 0 GICv2 225 Edge ttyAML0 >> 23: 20 0 0 0 GICv2 227 Edge ff805000.i2c >> 25: 2 0 0 0 GICv2 232 Edge ff809000.adc >> 28: 322 0 0 0 GICv2 35 Edge meson >> 31: 0 0 0 0 GICv2 222 Edge ffe05000.sd >> 32: 787 0 0 0 GICv2 223 Edge ffe07000.mmc >> 34: 0 0 0 0 GICv2 194 Level panfrost-job >> 35: 0 0 0 0 GICv2 193 Level panfrost-mmu >> 36: 3 0 0 0 GICv2 192 Level panfrost-gpu >> 37: 2 0 0 0 meson-gpio-irqchip 26 Level 0.0:00 >> 39: 0 0 0 0 GICv2 63 Level ff400000.usb, ff400000.usb >> 40: 32 0 0 0 GICv2 62 Level xhci-hcd:usb1 >> IPI0: 476 567 720 956 Rescheduling interrupts >> IPI1: 93 166 270 137 Function call interrupts >> IPI2: 0 0 0 0 CPU stop interrupts >> IPI3: 0 0 0 0 CPU stop (for crash dump) interrupts >> IPI4: 0 0 0 0 Timer broadcast interrupts >> IPI5: 0 0 0 0 IRQ work interrupts >> IPI6: 0 0 0 0 CPU wake-up interrupts >> Err: 0 >> / # > > This thing keeps failing on my end. It only works if I force the > irqchip module to be present before the MDIO module is loaded. Here's > an example: > > root@tiger-roach:~# modprobe mdio_mux_meson_g12a > [ 125.871544] libphy: mdio_mux: probed > [ 125.882575] g12a-mdio_mux ff64c000.mdio-multiplexer: Error: Failed to register MDIO bus for child /soc/bus@ff600000/mdio-multiplexer@4c000/mdio@0 > [ 125.892630] libphy: mdio_mux: probed This error is caused because the PHY in the mdio@0 sub-bus cannot get the IRQ from the irq-meson-gpio driver, so it may be a dependency issue causing the PHY not probing the irq-meson-gpio node. IRQ management from PHY drivers is weird, because the core request the IRQ instead of the PHY driver. maybe causing fw_devlink issue not detecting the link. Neil > > Trying to bring up the Ethernet interface will fail. Note that there > was no attempt to load the irqchip driver. > > root@tiger-roach:~# modprobe -r mdio_mux_meson_g12a > root@tiger-roach:~# modprobe irq-meson-gpio > [ 144.983344] meson-gpio-intc ffd0f080.interrupt-controller: 100 to 8 gpio interrupt mux initialized > root@tiger-roach:~# modprobe mdio_mux_meson_g12a > [ 150.376464] libphy: mdio_mux: probed > [ 150.391039] libphy: mdio_mux: probed > > And it now works. > > Is it a MDIO issue? a fw_devlink issue? No idea. But I'd really like > to see this addressed before taking this patch, as everything works > just fine as long as the irqchip is built in (which on its own could > well pure luck). > > Saravana, could you please have a look from a fw_devlink perspective? > > Thanks, > > M. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel