From patchwork Tue Oct 18 19:30:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Naulls X-Patchwork-Id: 1691678 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=eGupGvIx; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=chocky-org.20210112.gappssmtp.com header.i=@chocky-org.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=ooI7cfaN; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MsPGF0Dszz1ygT for ; Wed, 19 Oct 2022 06:35:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:From:To:MIME-Version:Date:Message-ID: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jne0J3KKbRhrHMlFmoXgHyeYVOlJ/F0ynSACtBmKVPA=; b=eGupGvIxdlyIyv jHCyMGrwbMiiypS8+09xGJjwubgHhuiJWhQzj5gE6Cw3Z2AodHOOexcEs4r6q1zSDIMWxFt79l/h1 XYHe+FvIYia8DGbgOOYOwIq4rj6JkGnRB+qYPDMJX4KUVR900ZdTOWpT5JrCHTOws8IWUErSBUg5x ovvXuLiVyfV2uB/wuzAsIGkzo63BMV3HA4IqDOypkwQEYv17ga3c4WcD59w1wsIuTx8uZtYhU7aec Mf7qz5nVnybY594TV354if5ZkjRu0zeDtaHNTzVuQOTxfH3BsokSc7TlXS9U1m++Wc5svERGUkFXH BVgksknpGNYaNliAL38A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oksIq-00AF74-EG; Tue, 18 Oct 2022 19:31:04 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oksIk-00AF6R-Fj for openwrt-devel@lists.openwrt.org; Tue, 18 Oct 2022 19:30:59 +0000 Received: by mail-qt1-x82f.google.com with SMTP id w3so10337898qtv.9 for ; Tue, 18 Oct 2022 12:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chocky-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Oa1TR19r1nS/60FDLsvz30thANprFg7ukg1ur6P/Qpg=; b=ooI7cfaNukunzpmFCn+SFr1OfDFFFTJzi4C5qZhmc6pIvvik60mNLBdihvnTEJ4LWQ BKJkxFqOa12jIopufNNwLrd73henINZjcFdSPuVBT3qkcSVqwWnOB3U2Hb/p7W3lnb31 +eEFDZ2NHPZsOrpTjvbZLBulIzQno0w6wydMAMek8G887dbhdLGXyJfVKxs5AHbEyAO7 uG4WN31NJg08LiGMcVGsz+u/5g9cM/tCk+LKEasNCo6deqrjSMHrjznWkNyM2Hfhgza7 NH0UmlDgPoDIj4HogfsA5ebHwYO1eEtHbe+Xmy3ay+Rquu4rypNT27etG/vt7uVt9PoU XTDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Oa1TR19r1nS/60FDLsvz30thANprFg7ukg1ur6P/Qpg=; b=3moqGCctNfJ87Y7HF89AZ4aNU9HbPdsJ7j/7pqeXVnrVAQ2vOORj/g4kP7tnR38xDy 6Ulw0RSV6n7U81+Fn/wiq+2R3/RedKX7dVrLdBF6I1YRVcMhKpJgh2k2LUyElpRewoR3 cXagcLoO4fb+q+ZKbLPp1mZOA1A2mSEH4NR7XEZk3Guw3Z1m+LFBzzLG0IVUID1uvA5l lVzRo+K8y0ygRecHCFDJZeJL4EObuTDY6Xu6SuD9RLvLIdaZ19kJ5rKvstBZGXKLrfuW 1y0WcqPgwtgYI4hSbj/0XnEe3ocr+NBhaPn11YsO5UmsLOlPeh0jGOdMh64RUhGggnS9 itLQ== X-Gm-Message-State: ACrzQf1on9e52Xkx/p5ivZL1PznXa2IwKQZ/PcZID4RamLas+ccBQ4RI WHxe5LI3KrD/GDa56y5av20wWr9jHdP4gA== X-Google-Smtp-Source: AMsMyM7bv/OtXTmJIhOgC1q2fNYI1WrEzXa8mw9SBC4qjmy9AECR+xFp6HoLsRuZiqD80sEQmhfKXw== X-Received: by 2002:a05:622a:389:b0:39c:e87e:903b with SMTP id j9-20020a05622a038900b0039ce87e903bmr3514858qtx.392.1666121454592; Tue, 18 Oct 2022 12:30:54 -0700 (PDT) Received: from [192.168.0.217] (c-73-154-94-239.hsd1.pa.comcast.net. [73.154.94.239]) by smtp.googlemail.com with ESMTPSA id y4-20020a37e304000000b006b5cc25535fsm2800676qki.99.2022.10.18.12.30.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 12:30:54 -0700 (PDT) Message-ID: <00bab05a-5857-33de-5e3b-09b9c531d776@chocky.org> Date: Tue, 18 Oct 2022 15:30:05 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 To: openwrt-devel@lists.openwrt.org Content-Language: en-US From: Peter Naulls Subject: gpio-mt7621 offset fix for 5.10 kernel series X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221018_123058_774236_4E3A0776 X-CRM114-Status: UNSURE ( 6.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Looks like there was some code loss when the driver came from an earlier kernel series. Without this, my MT7621 board starts its GPIO offsets at 416 (why that number, I don't know): --- a/drivers/gpio/gpio-mt7621.c 2022-10-18 15:03:42.596454871 -0400 +++ b/drivers/gpio/gpio-mt7621.c 2022-10-18 13:51:23.628305673 -0400 @@ -234,6 +234,7 @@ return ret; } Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:82f listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Looks like there was some code loss when the driver came from an earlier kernel series. Without this, my MT7621 board starts its GPIO offsets at 416 (why that number, I don't know): I'm using 5.10 in the current OpenWrt 22.03. Before # ls -l /sys/class/gpio/gpiochip4* lrwxrwxrwx 1 root root 0 Jan 1 1970 /sys/class/gpio/gpiochip416 -> ../../devices/platform/1e000000.palmbus/1e000600.gpio/gpio6 lrwxrwxrwx 1 root root 0 Jan 1 1970 /sys/class/gpio/gpiochip448 -> ../../devices/platform/1e000000.palmbus/1e000600.gpio/gpio8 lrwxrwxrwx 1 root root 0 Jan 1 1970 /sys/class/gpio/gpiochip480 -> ../../devices/platform/1e000000.palmbus/1e000600.gpio/gpio0 After: # ls -l /sys/class/gpio/ --w------- 1 root root 4096 Jan 1 1970 export lrwxrwxrwx 1 root root 0 Jan 1 1970 gpiochip0 -> ../../devices/platform/1e000000.palmbus/1e000600.gpio/gpio/gpiochip0 lrwxrwxrwx 1 root root 0 Jan 1 1970 gpiochip32 -> ../../devices/platform/1e000000.palmbus/1e000600.gpio/gpio/gpiochip32 lrwxrwxrwx 1 root root 0 Jan 1 1970 gpiochip64 -> ../../devices/platform/1e000000.palmbus/1e000600.gpio/gpio/gpiochip64 --w------- 1 root root 4096 Jan 1 1970 unexport Which is consistent with what I had in 4.14 series. --- a/drivers/gpio/gpio-mt7621.c 2022-10-18 15:03:42.596454871 -0400 +++ b/drivers/gpio/gpio-mt7621.c 2022-10-18 13:51:23.628305673 -0400 @@ -234,6 +234,7 @@ return ret; } + rg->chip.base = rg->bank * MTK_BANK_WIDTH; rg->chip.of_gpio_n_cells = 2; rg->chip.of_xlate = mediatek_gpio_xlate; rg->chip.label = devm_kasprintf(dev, GFP_KERNEL, "%s-bank%d",