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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 AD32CC433DB for ; Thu, 14 Jan 2021 00:29:32 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 039CE23343 for ; Thu, 14 Jan 2021 00:29:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 039CE23343 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DGQDT6pVyzDrqQ for ; Thu, 14 Jan 2021 11:29:29 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aj.id.au (client-ip=66.111.4.25; helo=out1-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.a=rsa-sha256 header.s=fm1 header.b=A+n0WcIo; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=RiHIcnZN; dkim-atps=neutral Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DGQBg6zs7zDqL0; Thu, 14 Jan 2021 11:27:54 +1100 (AEDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 843DE5C00F7; Wed, 13 Jan 2021 19:27:50 -0500 (EST) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Wed, 13 Jan 2021 19:27:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm1; bh=ryfvk2k2wQcDt6+nGId872DiRJw7DhY PHXP5E70CfEg=; b=A+n0WcIoUsUZSSwJUDKSbWQjSV7hDEsBdKGPqEMOSbD1aes P3BMm4GcyKY5AK9gUv52XevM83JAHapiK1DMgw4zfFNfrqCLJHzZ/Xr8Q1cvGQnf diKmIp7Cime5HAlcEETnADT1n5kOvctuR+N73ASsnq0Ha6Fzk7sUNLFQuCOsywFq GgLXWUcGYTwqKydEekggjJ/fbyTMSqIUJ3ueNSMJthizOp2raeg2+qtAUnFRLVda 8bC6IMlp9nQ+ZfHSIrMxtZF2GpOUcloIKsh9QB2VC6KeqSZZI5Lk2kAHqRvhoKfW W/x5vhCgWvyBHX6cm1mJdL4GUiIIVsxyo8bo4dg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ryfvk2 k2wQcDt6+nGId872DiRJw7DhYPHXP5E70CfEg=; b=RiHIcnZNDLtKSJfO8saxuB DpiQGP/R2rvSnHDSmOEp+fvNUObV143TtRu4+59Rq7uTz+iDmuj+6dcTrTx5s2Xw JZijcKbhJPYqLBNXmp+YwHnRZVaOwY0LCBCHuWbyoVT+Z4qL3Pn5Pw3iRDQwoM7h oujOIsCjnyfZS4B0m8GEB6BWO8oI9xj3M/lsGawrJ+fF+bcIzcpYKqDG0QwzN53r o1W/X9njVgtZ01tr/qp0uhYIjEKqJRcxpzACWQDB4M03kIQPjwdyo8GW/s10UNgq rEKiNdAavpYE/SxBhQ2qwfW1NfGcXJYYHnMzPuAPhTVR/qSOYbBOn2Ys6dZT+BHQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedukedrtdeggddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedftehnughr vgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucggtffrrg htthgvrhhnpeehhfefkefgkeduveehffehieehudejfeejveejfedugfefuedtuedvhefh veeuffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 943F9E00C9; Wed, 13 Jan 2021 19:27:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-45-g4839256-fm-20210104.001-g48392560 Mime-Version: 1.0 Message-Id: <775b31f0-c74c-4ebe-9588-bca3ee423383@www.fastmail.com> In-Reply-To: <20210113223808.31626-2-hongweiz@ami.com> References: <20210113223808.31626-1-hongweiz@ami.com> <20210113223808.31626-2-hongweiz@ami.com> Date: Thu, 14 Jan 2021 10:57:13 +1030 From: "Andrew Jeffery" To: "Hongwei Zhang" , "Linus Walleij" , "Bartosz Golaszewski" , "Joel Stanley" , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH, v1 1/1] gpio: aspeed: Add gpio base address reading Content-Type: text/plain X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" Hello, On Thu, 14 Jan 2021, at 09:08, Hongwei Zhang wrote: > Add gpio base address reading in the driver; in old code, it just > returns -1 to gpio->chip.base. Why do you want to do this? It feels hacky. The base address only affects the legacy sysfs number-space, and even then if you're using the sysfs interface you can discover the base address for a specific gpiochip via the associated attribute. For example: # cat /sys/bus/platform/devices/1e780000.gpio/gpio/gpiochip*/base 816 I feel that you should instead be changing your userspace not to assume a fixed value. Finally, the base value is a linux-specific thing and doesn't belong in the devicetree, and if it did, you would also need to update the devicetree binding in Documentation/. Cheers, Andrew