Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1226687rdb; Fri, 16 Feb 2024 08:55:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU8fArtuxBeUA0sbqMIXd+UC9snwTJL1Cyg/OgLKHOb9jgwt8KUzMUijjWZkTKAgFQOl2Zs+R5o/YY2PhZwg+CfjYPf3UITRv7UD6c3bA== X-Google-Smtp-Source: AGHT+IF4QfTFFpBhC4i5B1WwgxyuTyQOPzSDWkOQXuvw3shCawEP69tM1cYTh7hIe6vIQqz+HmI6 X-Received: by 2002:ae9:e309:0:b0:785:af0a:54b7 with SMTP id v9-20020ae9e309000000b00785af0a54b7mr5435893qkf.11.1708102500283; Fri, 16 Feb 2024 08:55:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708102500; cv=pass; d=google.com; s=arc-20160816; b=ObC6bakcAZpUAE5SNgk1YNeWFwnF5tRhlcm1Gy/5wrnMKNq0CUhrLDryGf6IdMrlwO JHmOtYRXaprSxEsW8z2gF1AHFuqHoj2s6XhA2e/Czf98SgPnVody4RvgHo4SbTQ/rbyF iUhTpj8hX2jNGt9luznFfnkPoy5HZiQiyQBtT7IL9eMUP/2V0reJReXhi5qdMcWoVPnn Yyw3E1LFoQnFdwwMzGhuHJxxmvTSHIwy7oRT+tuNXTW/kK2iHUhvSNnomJw66w2GJtWK RlsYldh9PcUGM/rA+19xb6ZJ8zo8fhLAsek2Vj9WQuRtmFElKtVZI/unp7lSKY0oXRIE jzLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PFWrdq00OZGhDwFJsj9Cycw/9z1sW14MCT2bj1WsaP8=; fh=vVF/5dn30u+XRE76UbiKp6yneV7deR6sA06RmdHFBQM=; b=wUcBybwawHTApq6Bv6ZdP7XQUpXG3+Tuf+hPh7XuOn6Q6IBLvk5qNCAmoGmh1reteM xqh0i5WrY4/Tiw2jfjXfh58Oh+M6iO37So53+GUGoDUgqA3947N0Kox6vlY9qaxOoEBS GrpGuag7lt4UKvUdinPcCznsHA4H9us1VvDagLBR42JOWGdVGkXsx2yldmnlN/hfKUoX VolpgWCCL5+N3fvkn6ivtbNBaZgVYPYGlNdLVQ6R7BJV98Pb2TZadFv/DpgymenSsm4A vp4U2eoV6c/kugzSlj2NPqZGWDUxEuD3/wjdgqN6yh1C2H+5j4GA27QCxPQy4c0cmZQq 2RyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hJ8DQvJb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3688-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3688-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id qr22-20020a05620a391600b00785d846cf6asi291474qkn.393.2024.02.16.08.55.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 08:55:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3688-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hJ8DQvJb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3688-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3688-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F17991C222D6 for ; Fri, 16 Feb 2024 16:54:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71222130E5C; Fri, 16 Feb 2024 16:54:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hJ8DQvJb" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41BB912FB1E; Fri, 16 Feb 2024 16:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102469; cv=none; b=YUGghwRG/avm5vuJ5p3YIJHNzSZ/3rFHQIcYEzcqk41qUNUptDK0o70k9aKfgC0vkQC3QL6mB3HoVY+QVSiz6rzP+HNXswpEU7cLFT7TqpFK334X/0I5K2g511Pek6KLJA0Bel+wiUy3+iA8laQxrqeMpk64FMuxcC9THj3TKo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102469; c=relaxed/simple; bh=8OddoM/5Z/IMvsCA4MEbtq8hH+VVAaz1jere2rqeK4I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nLwmuPV43xAfJs1SwzgBvK5lot3a2Cb3RcHCG8BlyEl6FE7OuQ6s9U+/QmVtgQOedVedKZykgRdUMJIOQU/WQzwKyqkSd4Zw4EL9vMacspyCUyKlX8AzqsQo77lrIoza6eDqRocOxupdmrjmQSK3MUrIHEyvNTrKP4qwuk2zkbg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hJ8DQvJb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6CC0C433F1; Fri, 16 Feb 2024 16:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708102468; bh=8OddoM/5Z/IMvsCA4MEbtq8hH+VVAaz1jere2rqeK4I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hJ8DQvJbxtRhr01ZEId0k89q7dwWlxrtj2nDvJRjNH+HzFC71g1N1MPug2HxVBfGf +IpgYCo7u7cWxTPn/lR+LVeoU7tMMMZFH587CV6KMK3m4Hc05zEKXXzciAkT0yt/De s3AhOjbjQdAfcJFmh8XVuy9grwYk0gzoT23IH0DLkr0igwOys/E+yvUGEZOJHRZmb0 2LzpX2sHpnGESSwEZpIvASKgwRTNxF0x+jA2vtKqHw0t5Az+/k3BK2dSQBcX5t2mhY FkmXwScH9gr2jrSUQFcn9mtMC4mjkP88NSh6PgUvY5ZLO1if4K8euZdTvrN6XP9CYa rnHwIn4WNmG7A== Date: Fri, 16 Feb 2024 16:54:24 +0000 From: Conor Dooley To: Kalle Valo Cc: Ajay.Kathat@microchip.com, alexis.lothore@bootlin.com, davidm@egauge.net, linux-wireless@vger.kernel.org, claudiu.beznea@tuxon.dev, thomas.petazzoni@bootlin.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH RFC] wifi: wilc1000: fix reset line assert/deassert polarity Message-ID: <20240216-reckless-freedom-4768ce41e939@spud> References: <20240213-wilc_1000_reset_line-v1-1-e01da2b23fed@bootlin.com> <2ff1c701f3443e1c612a81f4077b0280850f57c6.camel@egauge.net> <081bce96-f485-414c-8051-e1c14271f8cc@bootlin.com> <877cj4o0sv.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vP5ooK5Cnuawf+D0" Content-Disposition: inline In-Reply-To: <877cj4o0sv.fsf@kernel.org> --vP5ooK5Cnuawf+D0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 16, 2024 at 06:01:52PM +0200, Kalle Valo wrote: > (Adding devicetree list for comments) >=20 > writes: >=20 > > On 2/13/24 09:58, Alexis Lothor=E9 wrote: > >>=20 > >> On 2/13/24 17:42, David Mosberger-Tang wrote: > >>> On Tue, 2024-02-13 at 16:22 +0100, Alexis Lothor=E9 wrote: > >>>> When using a wilc1000 chip over a spi bus, users can optionally defi= ne a > >>>> reset gpio and a chip enable gpio. The reset line of wilc1000 is act= ive > >>>> low, so to hold the chip in reset, a low (physical) value must be ap= plied. > >>>> > >>>> The corresponding device tree binding documentation was introduced by > >>>> commit f31ee3c0a555 ("wilc1000: Document enable-gpios and reset-gpios > >>>> properties") and correctly indicates that the reset line is an activ= e-low > >>>> signal. However, the corresponding driver part, brought by commit > >>>> ec031ac4792c ("wilc1000: Add reset/enable GPIO support to SPI driver= "), is > >>>> misusing the gpiod APIs and apply an inverted logic when powering up= /down > >>>> the chip (for example, setting the reset line to a logic "1" during = power > >>>> up, which in fact asserts the reset line when device tree describes = the > >>>> reset line as GPIO_ACTIVE_LOW). > >>> > >>> Note that commit ec031ac4792c is doing the right thing in regards to = an > >>> ACTIVE_LOW RESET pin and the binding documentation is consistent with= that code. > >>> > >>> It was later on that commit fcf690b0 flipped the RESET line polarity = to treat it > >>> as GPIO_ACTIVE_HIGH. I never understood why that was done and, as yo= u noted, it > >>> introduced in inconsistency with the binding documentation. > >>=20 > >> Ah, you are right, and I was wrong citing your GPIOs patch as faulty > >> (git-blaming too fast !), thanks for the clarification. I missed this = patch from > >> Ajay (fcf690b0) flipping the reset logic. Maybe he had issues while mi= ssing > >> proper device tree configuration and then submitted this flip ? > > > > Indeed, it was done to align the code as per the DT entry suggested in > > WILC1000/3000 porting guide[1 -page 18], which is already used by most > > of the existing users. This change has impact on the users who are using > > DT entry from porting guide. One approach is to retain the current code > > and document this if needed. >=20 > So if I'm understanding the situation correctly Microchip's porting > guide[1] doesn't match with kernel.org documentation[2]? I'm not the > expert here but from my point of view the issue is clear: the code needs > to follow kernel.org documentation[2], not external documentation. My point of view would definitely be that drivers in the mainline kernel absolutely should respect the ABI defined in the dt-binding. What a vendor decides to do in their own tree I suppose is their problem, but I would advocate that vendor kernels would also respect the ABI from mainline. Looking a bit more closely at the porting guide, it contains other properties that are not present in the dt-binding - undocumented compatibles and a different enable gpio property for example. I guess it (and the vendor version of the driver) never got updated when wilc1000 supported landed in mainline? > I'll add devicetree list so hopefully people there can comment also, > full patch available in [3]. >=20 > Alexis, if there are no more comments I'm in favor submitting the revert > you mentioned. =46rom a dt-bindings point of view, the aforementioned revert seems correct and would be Acked-by: Conor Dooley Getting off my dt-binding maintainer high-horse, linux4microchip is going be updating to a 6.6 based kernel in the coming weeks - maybe that's a good time to update the vendor kernel wilc drivers (and therefore the porting guide?) to match the properties used by mainline Ajay? Cheers, Conor. --vP5ooK5Cnuawf+D0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZc+TQAAKCRB4tDGHoIJi 0mwWAQCVgXlcuztMUaj+vUYBVR0Uq5Xq2C4jK/ao24lMy8wEIQD+JiJQQoX+cszP esUPn0KXW8gNd8xDXqQrm0+EQRNtdgY= =hxLt -----END PGP SIGNATURE----- --vP5ooK5Cnuawf+D0--