From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:690d:0:0:0:0:0 with SMTP id e13csp1341820lfc; Wed, 10 Feb 2021 06:32:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwW4TOFnxVOv+kUAbeGPXYCqyShVsxpk09LgY2Rc1LyYMitIOn2VGBrLm5yb0tWp+7XqIeF X-Received: by 2002:a25:6d8a:: with SMTP id i132mr4710635ybc.337.1612967576100; Wed, 10 Feb 2021 06:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612967576; cv=none; d=google.com; s=arc-20160816; b=PehYfYNSzEcdK9Ljisar0ijBSHMrU0lIh3+gJiC+Sn3tTIN/iqJK+FyXZrv9bJDqLy 0oQKcdkKALa9zUXlN5VNODPrHRyf85eF+c7SEIVnnSjWzK41L1wAwp0uHF8R4bmdeN8E uVi9uaf7bmU3gQ35UQsNpwC91NBOIuxx9SntVAJPeW8C5EsEbHbcbRyXtr3IyRkAfEoc BGXdJN3ZpKoJ3hHDGh2MA+uIPqdEWgbW40sQgtprXldnY1fjIDyiMC/0r4PqRwHKSE4j 8KXCdJIFg6vFJqCela8bajfiAsfWcaw6GEcTwOgAHyamaMzbQ+TSfpmYUmQYmZiO+tCp a/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=l6LZ6aM2GsCm8qIVLfFuDOqLW3QUaWdw+Cv85kJu8CQ=; b=FQtAkbuKU2FJRaK1DwwNXhSmYg6nMKXG4nhIP2+jHQxcSn0EbETzd+FoRrok7Hc/9x IqK759AFKKrvaGKyL1pdXuK6+kYLJZk2pAo1/R7FU+gTjxNP3Lia46W7s9wuBJ1WrfSp 8rPcdE+S7xrOCaxEiwwF0LUDN3VDjxJR6JFxbonC4vgt6VM9ryiAPfjThwhBzbaBOFXB 5DTvjYqQ4TPo2JbwrjJTEGToQjgAOVH+qFnNGc5Q+CLQkIzF1awKBH1/QpQHTEdKIz1D c2EM0T7Rwgt4S69AjW0LoPXNQfD+hhnK2kxBGpVxGjcxwwsp4OJQgDbwpeVbh9ZlEPVq II3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kYsMsGHK; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k3si2051125ybp.64.2021.02.10.06.32.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Feb 2021 06:32:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kYsMsGHK; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1]:49848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9qY3-00034D-GE for alex.bennee@linaro.org; Wed, 10 Feb 2021 09:32:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9qXc-00031x-NH; Wed, 10 Feb 2021 09:32:28 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:35475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9qXa-00024O-St; Wed, 10 Feb 2021 09:32:28 -0500 Received: by mail-wm1-x332.google.com with SMTP id n10so148496wmq.0; Wed, 10 Feb 2021 06:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=l6LZ6aM2GsCm8qIVLfFuDOqLW3QUaWdw+Cv85kJu8CQ=; b=kYsMsGHK8gzNzQ1rBBtV4LhrUsEeb4NFd7QB9BB2LRuUgGyXBb7pu1u0DYqF0EQOjk 0kOsfLqU5zlN4RF6xlO/v0P/FP0dptazzLUgRC6+Aqnb+rjOLMC8vigJG26btC4fNsyF 1Mw2XN+Hv2GkBtkgQTsdsSPZZAISqOTxTqypteuSc77oePI76s1mHsQJ2wT+rwSo/8Pt c615IoVJ7anQN/KtYXCl7aSbKCtz1iIeQlOAcW1krM2pUD4DDUt0dYGgd5wsgckYeeSJ 2e/h59WBW8CSV9b9GKDInaohWhZIPEsJrfL8Xm0jFI9Pkel49ndo2HYDqBnzTZVlND+c W93Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=l6LZ6aM2GsCm8qIVLfFuDOqLW3QUaWdw+Cv85kJu8CQ=; b=izDJZoNXMKXt+A148VutZRHvMAgClTfaY/cjdoFkY3HJRHRbW76euA9VkLHE3v5vMW oR1OkQLFnsU0zb5blhqVI/mJzzmoPhDCmamVCUj6iZSH04edJiAUQof/DNtOgxMHCTeh SZCz5ly7S0PM0y7zXCcM6rw7LGm+WXxVA8kMA5/uXQyxgUJjEv3+meI0JRJsROpJv2io vwozY9cCyGrYS4pyU2ascdTiaxTSc5uyEJrPc/2XlRk2P/ZcPY+IHlBbfXFm3sKOq9eP URsUFJTifJxg1MNxarl0LzNiD8h9xG0umWw6MJ14Mg8vWRq7Gu+ebsKj3ZDLHxi8DwgA BTRA== X-Gm-Message-State: AOAM532F5YOn0EMn2KPn+DH/iersnoeOxxmNznOgJn825MnyJPiKLGy4 b/Z64YSKYtw9C9aXt768TH0= X-Received: by 2002:a05:600c:d9:: with SMTP id u25mr3261931wmm.49.1612967544230; Wed, 10 Feb 2021 06:32:24 -0800 (PST) Received: from localhost ([37.162.14.172]) by smtp.gmail.com with ESMTPSA id 64sm4117249wrc.50.2021.02.10.06.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 06:32:23 -0800 (PST) Date: Wed, 10 Feb 2021 15:32:19 +0100 From: Davide Berardi To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Subject: Re: [PATCH] Raspberry PI GPIO interrupt support Message-ID: <20210210143219.GA95384@carpenter.lan> References: <20210209110252.GA14409@carpenter.lan> <355f1271-09c9-715a-a909-c0f05060dfe5@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <355f1271-09c9-715a-a909-c0f05060dfe5@amsat.org> Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=berardi.dav@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Andrew Baumann Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: 88FtjPsM3D7W Dear Philippe, thank you for your kind response. I will send a new version for the patch with the modifications you've highlighted, but first I've some question on the best way to implement them. On Tue, Feb 09, 2021 at 12:30:32PM +0100, Philippe Mathieu-Daud=E9 wrote: >Hi Davide, >On 2/9/21 12:02 PM, Davide Berardi wrote: >> The bcm2835 GPIOs now generate interrupts. >> This modification enables QTEST clients to trigger interrupt-based >> interfaces. > >Thanks for your patch! > >Can you provide QTEST client example? Even better would be a qtest! > The minimal client I've developed can be found at https://github.com/berdav/qemu-rpi-gpio As I have introduced, I'm building a qtest but I've found a problem: In my test, I want to check if the IRQs of the named GPIOs /machine/soc/peripherals/ic/gpu-irq are correctly handled by the controller. I was thinking to use irq_intercept_in to get the status of the IRQ lines using something similar to the following: qtest_irq_intercept_in(s, "/machine/soc/peripherals/ic"); And then check it using qtest_get_irq(s, 49 + irqline); But it isn't triggering. Looking in the source of qtest I've found this check in the qtest_irq_intercept_in function: QLIST_FOREACH(ngl, &dev->gpios, node) { /* We don't support intercept of named GPIOs yet */ if (ngl->name) { continue; } I've removed the if and the qtests seems to work just fine. Is there particular caveats or details to implement this part of the framework? I can send separated patches if you have some details on the desiderata of the support, or maybe start a new thread with this question. Otherwise, I can remove the part of my qtest to not check the IRQs, but I don't know if it would be the best choice. > >I wonder how you generated your patch, it doesn't apply: > >Applying: Raspberry PI GPIO interrupt support >error: patch failed: hw/arm/bcm2835_peripherals.c:114 >error: hw/arm/bcm2835_peripherals.c: patch does not apply >error: patch failed: hw/gpio/bcm2835_gpio.c:7 >error: hw/gpio/bcm2835_gpio.c: patch does not apply >error: patch failed: hw/intc/bcm2835_ic.c:57 >error: hw/intc/bcm2835_ic.c: patch does not apply >error: patch failed: include/hw/gpio/bcm2835_gpio.h:7 >error: include/hw/gpio/bcm2835_gpio.h: patch does not apply >Patch failed at 0001 Raspberry PI GPIO interrupt support > >You can find the guidelines here: >https://wiki.qemu.org/Contribute/SubmitAPatch#Submitting_your_Patches > I have just created the patch using git format patch -s , it does not give me any error applying it over the master branch on https://github.com/qemu/QEMU . I will take more care and apply it on the master branch of https://git.qemu.org/git/qemu.git/ , thank you. > [... cut ...] > >Regards, > >Phil. I'm adapting the patch using the Coding style script now. I've also introduced a new costant for the number of GPIOs. Thank you for your time, D.