From owner-freebsd-current@freebsd.org Thu Oct 24 16:22:25 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B88FC170E2A for ; Thu, 24 Oct 2019 16:22:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46zXZn2TPCz3xfs for ; Thu, 24 Oct 2019 16:22:25 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1571934144; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=m319cf4CaKcD/DegyaAb+JqcsZfXAmsbKZEWPkxcHEdlxeqR6E/oOD0+fzS6DuX7txI1uOrk2WJ5D Bo8/EG6VC4vs6jrwqbsaYyFWo4WPXzflPmjWPuCWhK/I6CE8XNboeHMcIf5nhybWHrAhS+pQ4WbTP2 E85x0Cvs6LH2jajWEqIeqQIc18xCvXKa6igpm/jIU+dkSjXEhs4pqzH1cWGhQeH+i0J6VDyGq9FjT2 GQiHN1Bemit0tpQjcbYmSGDLeuT0biPHvj/Fy3kdye3eqvT1pbb4uh1YHXGhaZ8J1kwv0DkEZbm1su i+bJlVLLd1Hp2u+45bdgpLEK9fKpB/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=rELvqBWhTCTtWRaAK39u9/+v2ZuM8m7494H/m2cxX8s=; b=jQYJQ9hT7LyEhbgUhOLc6QiSxpgHOrwXXJq4VbzmeFCr/rqxMq4sRfvcm9IsKNdQbPFuIosYdrsq+ wI6gFtGa+NmHDFNLy4IL0tmcwuT8NUnC/SeHI2nTI3sPsE7R6AGmIHOBH6Qje/Hw5f245bxyOqDa+L tGTv55W3F2ywyF0OHgdnZzpiME1lfvdKy2ygaaU7fNF6zRkk+WHvQkIWddnKIQJDctdE2lP8FEic6d svELI78rwX5Tpvut76Mx+flS/qknbYLAn6PbdRZ71wVWPgdU9pbECASMF0NDYmBeWMheF1u/kB06sT LPkl9p03f62oB8Y2LabKGRHIhdBj4UA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=rELvqBWhTCTtWRaAK39u9/+v2ZuM8m7494H/m2cxX8s=; b=ZC1Egj0Ir8lIJajs6/BwkpRVJW2V55HoKlzNIBTLv9udmWDVRimCDkSPON9OGymSY7POAmrQom56B 1wPG88jLA+r5HQ7s1dAIM8ihG5h6RADyULN5TTvyluOBfiZDWvF4+HSjx3dY1A5WbLuxXdVvfDhP7L 1UH5OuFSKb33Ml85upLQCGLLDP1yz/PY06Au51KapVghuE2OfY1eN3Xps5BvrsOMBTIkETNjBQfxDK 60g2JZMMHkfFdw0BQrV7inzGRsmkWS2xqK7VVHVrcrtBAtjonpFgi7PrQ+MscAsdw1bh28D7Y8Q9cM zII9fkWdx4Ht1ayGRfYOQjth+4ZNaLQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 74e8db7e-f67a-11e9-b80b-052b4a66b6b2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 74e8db7e-f67a-11e9-b80b-052b4a66b6b2; Thu, 24 Oct 2019 16:22:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x9OGMLM7045438; Thu, 24 Oct 2019 10:22:21 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: gpiobus: setting output value while in input mode From: Ian Lepore To: Andriy Gapon , FreeBSD Current Date: Thu, 24 Oct 2019 10:22:21 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46zXZn2TPCz3xfs X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.91 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.91)[-0.907,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2019 16:22:25 -0000 On Thu, 2019-10-24 at 19:01 +0300, Andriy Gapon wrote: > Also, if we universally implement GPIO_PIN_PRESET we still need to answer the > question. Because some consumer might still try to change an input, either by > mistake or for some reason, and we need a rule on how to handle that. Well, yeah, I guess just to zoom in on the core question of "what should happen if you try to set the state of a pin configured as input?" the answer would be "the controller should return ENODEV" and you could make a good case that it should do so regardless of the hardware's capabilities. Actually, for hardware that lets you set the output state while configured for input, where the drivers currently leverage that feature, we could both set the hardware and return ENODEV, and existing code like that in gpioiic will still work. But doing that also would require examining every existing driver and probably changing many of them. I'm not afraid of this aspect of any change we decide on... it's about 30 drivers, all of which will need minor changes. -- Ian