NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/53171 (Broadcom (and other ARM SoC i2c drivers) mis-handle indirect configuration of devices)



The following reply was made to PR port-arm/53171; it has been noted by GNATS.

From: Jason Thorpe <thorpej%me.com@localhost>
To: Jared McNeill <jmcneill%invisible.ca@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, Jason Thorpe <thorpej%NetBSD.org@localhost>,
 port-arm-maintainer%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, gnats-admin%netbsd.org@localhost
Subject: Re: port-arm/53171 (Broadcom (and other ARM SoC i2c drivers)
 mis-handle indirect configuration of devices)
Date: Mon, 30 Apr 2018 12:51:19 -0700

 > On Apr 30, 2018, at 10:33 AM, Jared McNeill <jmcneill%invisible.ca@localhost> =
 wrote:
 >=20
 > Can this change be done in a way where we require explicit locators =
 for attaching indirect child devices? I worry about driver probe =
 functions sending crap over the i2c bus on boards where we've otherwise =
 strictly defined devices in the DT.
 
 Not sure what you mean =E2=80=94do  you mean =E2=80=9Cdisallow wildcard =
 locators for indirect config=E2=80=9D?  That should be trivial.  I think =
 just about all of the i2c drivers already specifically filter their own =
 =E2=80=9Cvalid addresses for this device=E2=80=9D before even doing =
 anything, though.
 
 That said, the current behavior, is obviously a bug =E2=80=A6 probably =
 introduced when FDT-ization of evbarm happened in the first place (I =
 guess no one had devices that were commented out in the kernel config =
 files to try?)
 
 Anyway, if you want to prevent random devices from even trying =
 known-to-DT-i2c-locations, we=E2=80=99ll have to separately record which =
 i2c locations are reserved for direct-config-only, and only process =
 indirect after we=E2=80=99ve finished enumeration of direct-config =
 devices from the DT.
 
 I=E2=80=99m not sure what all of this really buys you, though, because =
 userland has access to i2c as well =E2=80=A6 so to keep that avenue from =
 tripping things up, you want to separate filter =E2=80=9Cany address =
 that is in use by the kernel for some reason=E2=80=9D.  But that filter =
 would add expense to each userland i2c command, since the address is =
 specified in the i2c exec argument.  Seems like an orthogonal problem =
 that warrants a separate change.
 
 DT is nifty, but it=E2=80=99s leading to an annoying bifurcation of =
 device configuration information.  The kernel config file was the =
 traditional way to specify this stuff=E2=80=A6 but if we=E2=80=99re =
 going to say =E2=80=9Chey, the right thing to do on FDT platforms is to =
 provide your own DT snippets for whatever hardware you=E2=80=99re adding =
 to your prototyping platform=E2=80=9D, then we need a way to make that =
 easy (or discoverable, or maybe both).
 
 -- thorpej
 


Home | Main Index | Thread Index | Old Index