From owner-freebsd-hackers@freebsd.org Wed May 29 21:40:48 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAB2C15AE58E for ; Wed, 29 May 2019 21:40:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433D489057 for ; Wed, 29 May 2019 21:40:47 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559166044; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=mUTv5IobotbDiAWHZoi0R4jtcenD36MW8/C2FE7TtERKeRvuJ5V3m6FaTPjDqT4uroEEUTELdWjA3 slO14iRrIigSofKlr/Xtb/l2/POpiiVwk7lik3GAyVZKgT1LUQhFj11ak3+2LsO9koUEOEK0car1Jo 8qNhAM67yBfLPeSIRtDBQ2PljBy4pf/NaYk1vtk72c6vHzw9ndQmKCmnXYY7o26IPcMgV6Pb+KcKVU /Un1BmmivCtaKrXmcF/L0nyzyCWJi1luc2V/au49yQi/HToB91MFsD8nQIT1aerGVHNYHT2T9piu4B 7p4Qh6EK93zEQMr0enbxLKbqjR66ibA== 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:cc:to:from:subject:message-id:dkim-signature:from; bh=hLDQqBgWzAzL7dhKzjgo464SUvMRrIRi2SwwhOHhD1k=; b=WJb+tH8/iTfYwdsk/+xCjRjnPWWsXCKex5iBapwL8FuLsu+CCtsAmsS9m7QXYF3VWpsAdaREUQ0jz 7P1I+OTWeyhkfe5BYlYRgMNmHnKjU3kbv6W/6EVSVhap/uXGnmI1Htkv6X2zHPbw/Fqthywu+sDMc7 8PHufiZh0A07viNnjC+qvkK4osRsWJ0utfJduU6M8e5Qx116dO+CaIXwCSpJk1pLpSDxbSwLlrMS/H 3p3iijuzowGIkg/lYhwD5Jy8TkfZuLDyC2uuuR96lkXaOo9c6t6fiDW3Isn3CVFMveq4ekOvVAFz2V JGyFM/oTmIIgiqLabym11/103LzDPkw== ARC-Authentication-Results: i=1; outbound3.eu.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:cc:to:from:subject:message-id:from; bh=hLDQqBgWzAzL7dhKzjgo464SUvMRrIRi2SwwhOHhD1k=; b=HTPPfMuKst7kGUs4dYrAUjcPFTqurR6mk0e1c9Bja/61wgSoOCUTyM9q/OMtPqpcgkSJarSzD4N2T 6erQfxoEjYmcB4zfn4VBBWyLp49tTNoXpzCAFnId6rQ3SS8/geL/pPmBHNMIX44uDlS1JANWxZZLz5 kJEW1V1t53/aBVRAeb43UDgxIk0tLxlJfQ2jGvdaYWrOHnEriuntp8TNtGnk8xwGZJ3s0KzjNOxVyJ 6YKhFYBN4q8c1YgegIPlM6wrOwiK8h6v9jH6dr4qhwJZjuL6GdGcu5m5+fAE7103UlvEi/TtaAbM+/ wEzKKAYLt9XkGPAjtzOxQ9w9AlKBm0g== X-MHO-RoutePath: aGlwcGll X-MHO-User: 6742ac49-825a-11e9-91aa-b56e4e6b5865 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.eu.mailhop.org (Halon) with ESMTPSA id 6742ac49-825a-11e9-91aa-b56e4e6b5865; Wed, 29 May 2019 21:40:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4TLedSN036276; Wed, 29 May 2019 15:40:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: setting driver properties for a particular device From: Ian Lepore To: Andriy Gapon , Michael Zhilin Cc: FreeBSD Hackers Date: Wed, 29 May 2019 15:40:39 -0600 In-Reply-To: <1a8fe3f8-a4d7-44f9-2b90-8b70e158f661@FreeBSD.org> References: <201905231115.x4NBFMSu037564@repo.freebsd.org> <523f92fe-c106-db6b-00d9-356913fdca5d@FreeBSD.org> <1a8fe3f8-a4d7-44f9-2b90-8b70e158f661@FreeBSD.org> 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: 433D489057 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 21:40:48 -0000 On Wed, 2019-05-29 at 13:31 +0300, Andriy Gapon wrote: > On 29/05/2019 13:29, Michael Zhilin wrote: > > Hi, > > > > There are kenv and sysctl. Is it far from what you are looking for? > > No. When I said programmatically, I meant programmatically from > within the kernel. > Hmmm. Whatever you do, it's going to amount to a conspiracy of agreement between the driver that wants to set this info and the driver that is expected to act on it. So if you don't use the existing hints mechanism, then you'll have to invent something new, and the gpioled driver will have to be updated to also check that new mechanism to see if there is any config info there that affects it. I'm not sure that's a big win over the slight inelegance of crafting a hint string at runtime. -- Ian > > On Wed, May 29, 2019 at 1:19 PM Andriy Gapon > > wrote: > > > > On 23/05/2019 14:15, Andriy Gapon wrote: > > > Author: avg > > > Date: Thu May 23 11:15:22 2019 > > > New Revision: 348153 > > > URL: https://svnweb.freebsd.org/changeset/base/348153 > > > > > > Log: > > > gpioled: add a new hint for initial state > > > > > > hint.gpioled.%d.state determines the initial state of the > > LED when the > > > driver takes control over it: > > > 0 - the LED is off > > > 1 - the LED is on > > > -1 - the LED is kept as it was > > > > By the way, can anyone suggest a mechanism to set device > > properties like this > > one _programmatically_ ? > > > > I am thinking of a case where I know exactly how everything is > > wired on a > > platform. And there is no FDT or alike support for it. And > > hints are not > > possible to set up correctly (e.g., bus numbers may float). > > So, I want to > > create a gpioled child on a specific bus and I want to set some > > properties for > > the device. > > Of course, I can probably do something like > > kern_setenv("hints.foo.X.bar", ...) > > using the child's name and unit number. But that feels a bit > > cumbersome. > > > > And this question is not about gpioled specifically. > > > > IVARs is definitely not the right mechanism, because it is > > about bus-specific > > properties of devices on the bus. So, it is not aware of > > properties specific to > > a driver that attaches to a child device. > > > > > > -- > > Andriy Gapon > > _______________________________________________ > > freebsd-hackers@freebsd.org > > mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > > freebsd-hackers-unsubscribe@freebsd.org > > " > > > >