linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Asmaa Mnebhi <asmaa@nvidia.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: David Thompson <davthompson@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Liming Sun <limings@nvidia.com>
Subject: RE: [PATCH v1 5/6] TODO: gpio: mlxbf2: Introduce IRQ support
Date: Thu, 19 Aug 2021 12:28:34 +0000	[thread overview]
Message-ID: <CH2PR12MB38954F84310BE1D749CBECAAD7C09@CH2PR12MB3895.namprd12.prod.outlook.com> (raw)
In-Reply-To: <YR2MV6+uQjjhueoS@lunn.ch>

Thank you Andrew and Andy! I will prepare 2 patches (one for gpio-mlxbf2.c and one for mlxbf-gige) and send it your way.

-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch> 
Sent: Wednesday, August 18, 2021 6:40 PM
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Asmaa Mnebhi <asmaa@nvidia.com>; David Thompson <davthompson@nvidia.com>; linux-kernel@vger.kernel.org; linux-gpio@vger.kernel.org; netdev@vger.kernel.org; linux-acpi@vger.kernel.org; Linus Walleij <linus.walleij@linaro.org>; Bartosz Golaszewski <bgolaszewski@baylibre.com>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Rafael J. Wysocki <rjw@rjwysocki.net>; Liming Sun <limings@nvidia.com>
Subject: Re: [PATCH v1 5/6] TODO: gpio: mlxbf2: Introduce IRQ support
Importance: High

Hi Asmaa

> > And I will need to add GpioInt to the GPI0 ACPI table as follows:
> 
> But you told me that it's already on the market, how are you suppose 
> to change existing tables?

BIOSes have as many bugs a the kernel. So your product should be designed so you can upgrade the kernel and upgrade the BIOS.

phylib itself does not care if there is an interrupt or not. It will fall back to polling. So if your driver finds itself running with old tables, it does not matter. Just print a warning to the kernel logs suggesting the user upgrades their BIOS firmware.

> > // GPIO Controller
> >       Device(GPI0) {
> >        Name(_HID, "MLNXBF22")
> >         Name(_UID, Zero)
> >         Name(_CCA, 1)
> >         Name(_CRS, ResourceTemplate() {
> >           // for gpio[0] yu block
> >          Memory32Fixed(ReadWrite, 0x0280c000, 0x00000100)
> >          GpioInt (Level, ActiveLow, Exclusive, PullDefault, , " \\_SB.GPI0") {9}
> >         })
> >         Name(_DSD, Package() {
> >           ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> >           Package() {
> >             Package () { "phy-gpios", Package() {^GPI0, 0, 0, 0 }},
> >             Package () { "rst-pin", 32 }, // GPIO pin triggering soft reset on BlueSphere and PRIS
> >           }
> >         })
> >       }
> 
> No, it's completely wrong. The resources are provided by GPIO 
> controller and consumed by devices.

In the device tree world, you list the interrupt in the PHY node.
Documentation/devicetree/bindings/net/ethernet-phy.yaml gives an
example:

    ethernet {
        #address-cells = <1>;
        #size-cells = <0>;

        ethernet-phy@0 {
            compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c45";
            interrupt-parent = <&PIC>;
            interrupts = <35 1>;
            reg = <0>;

            resets = <&rst 8>;
            reset-names = "phy";
            reset-gpios = <&gpio1 4 1>;
            reset-assert-us = <1000>;
            reset-deassert-us = <2000>;
        };
    };

You need to do something similar in the ACPI world. There was a very long discussion in this area recently, and some patches merged. You probably need to build on that. See:

firmware-guide/acpi/dsd/phy.rst

	Andrew

  reply	other threads:[~2021-08-19 12:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 11:59 [PATCH v1 0/6] gpio: mlxbf2: Introduce proper interrupt handling Andy Shevchenko
2021-08-16 11:59 ` [PATCH v1 1/6] gpio: mlxbf2: Convert to device PM ops Andy Shevchenko
2021-08-16 13:04   ` Asmaa Mnebhi
2021-08-16 11:59 ` [PATCH v1 2/6] gpio: mlxbf2: Drop wrong use of ACPI_PTR() Andy Shevchenko
2021-08-16 13:05   ` Asmaa Mnebhi
2021-08-16 19:20   ` Bartosz Golaszewski
2021-08-16 19:33     ` Andy Shevchenko
2021-08-16 11:59 ` [PATCH v1 3/6] gpio: mlxbf2: Use devm_platform_ioremap_resource() Andy Shevchenko
2021-08-16 13:05   ` Asmaa Mnebhi
2021-08-16 11:59 ` [PATCH v1 4/6] gpio: mlxbf2: Use DEFINE_RES_MEM_NAMED() helper macro Andy Shevchenko
2021-08-16 13:07   ` Asmaa Mnebhi
2021-08-16 11:59 ` [PATCH v1 5/6] TODO: gpio: mlxbf2: Introduce IRQ support Andy Shevchenko
2021-08-16 21:34   ` Asmaa Mnebhi
2021-08-18 14:07     ` Andy Shevchenko
2021-08-18 22:40       ` Andrew Lunn
2021-08-19 12:28         ` Asmaa Mnebhi [this message]
2021-09-15 19:27       ` Asmaa Mnebhi
2021-09-15 20:19         ` Andrew Lunn
2021-08-16 11:59 ` [PATCH v1 6/6] TODO: net: mellanox: mlxbf_gige: Replace non-standard interrupt handling Andy Shevchenko
2021-08-16 23:06   ` Linus Walleij
2021-08-17  9:05     ` Andy Shevchenko
2021-08-16 12:06 ` [PATCH v1 0/6] gpio: mlxbf2: Introduce proper " Andy Shevchenko
2021-08-16 19:22 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR12MB38954F84310BE1D749CBECAAD7C09@CH2PR12MB3895.namprd12.prod.outlook.com \
    --to=asmaa@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=davthompson@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=limings@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).