Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp51107pxb; Wed, 18 Aug 2021 15:44:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd+YKzFdGyrPSa9mbysVGDadNWOtOwsMRYBeAY764FnUhSnx3CHle1luzcCQVq5ZOsIGF0 X-Received: by 2002:a17:906:b10:: with SMTP id u16mr12342838ejg.315.1629326657443; Wed, 18 Aug 2021 15:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629326657; cv=none; d=google.com; s=arc-20160816; b=0UHwEhnuvNpg78AbndLw15WopuqRhXCKoCrcGU523mUM0Fu356ba6BCw6qM450jNFx LGDMD/MzikijamDH8KHb/MbUeYvJY5OMs5JUvMZuZbLG/VAH9eIo5GiTwpJftYB1QmZY t8hPdd0BEd6ksjN07ITZHDDUEeYPMnRAzLpI1nIuzJpQ1A5q4ztwTWCB4hmWH+tsmQqb l237/l8lnpw5oIjmYU/0S6ddKaxUHu5QgR37Ztec3TozF19ckP0xwtSSIQ2swf19A0tG Zj9jKMoQ6iLtfArFo7UXWVJiWFPuo0+9v5Kk9ZwxolLcoU9yGOrcFcsb8Rh9Sh3aUa73 Kclg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BHFLjbPCLCF1K1tPIACjXdBhCncOYyQo371Fy8IXvtg=; b=n3xDQM2oee6RVwLuGkVAALL/fN0kppn5ftB2l+VPk9FMAU1q5A0PeOK8zVg0Vc9P9d gncIH6JxEfgcHz1/GIlPyEABfmKUs3wACSJ8gw8urfXq2BdZG8cgttYFZ9mWp/NXeLf/ JK4yFMm5sPnzCq9wvFmiHffCBRMVR19juwrvY3G3Djw0JE+7aIq30zARHNmiX8AlC2qh QbwqsVr17YDsDLeyn9GoLf1jgEkSQOwsbyVPXADdzO8u8oBckYuHt31OKuWokTz9eCXw BL5TjHbGrlGCoozw4MZD5URYvCrHmHjirxKApcRTqo/AAaj1/5R0x357EsyEctJ81wC6 QhFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Fbn0t2ac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si1411699ejo.68.2021.08.18.15.43.53; Wed, 18 Aug 2021 15:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Fbn0t2ac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234771AbhHRWlD (ORCPT + 99 others); Wed, 18 Aug 2021 18:41:03 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:57370 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234624AbhHRWlC (ORCPT ); Wed, 18 Aug 2021 18:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=BHFLjbPCLCF1K1tPIACjXdBhCncOYyQo371Fy8IXvtg=; b=Fbn0t2acIk7bR7DR7/L5OCuExR OCdkGwfBUkianTpnsEMDrU69r24nZ84+Q4Xy5xFve1y5ME+ZAzwU1K7NHoXSS85pseA7kFCCbt4rG ar8lgBDGuFuO0TiEJ1ir4lN4/0Q4R2kYIlZtKNQtb/FPWnSumNa04mKkZ5F7l6xzSPsw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mGUER-000rcy-DR; Thu, 19 Aug 2021 00:40:23 +0200 Date: Thu, 19 Aug 2021 00:40:23 +0200 From: Andrew Lunn To: Andy Shevchenko Cc: Asmaa Mnebhi , David Thompson , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-acpi@vger.kernel.org" , Linus Walleij , Bartosz Golaszewski , "David S. Miller" , Jakub Kicinski , "Rafael J. Wysocki" , Liming Sun Subject: Re: [PATCH v1 5/6] TODO: gpio: mlxbf2: Introduce IRQ support Message-ID: References: <20210816115953.72533-1-andriy.shevchenko@linux.intel.com> <20210816115953.72533-6-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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