From owner-freebsd-arm@freebsd.org Fri Aug 21 00:41:10 2020 Return-Path: Delivered-To: freebsd-arm@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 54CF53AE4B1 for ; Fri, 21 Aug 2020 00:41:10 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BXjPK49xtz4G8F for ; Fri, 21 Aug 2020 00:41:09 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1597970462; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=o8icZe1uPfZsVccQ8gQYbOyOXdOTHfEXXkGRJblL5jCRtwE1YZP1sYmLCZUl6PXjJM7HW9xHMyQeK oadcFPRht2i7KJIJKlZ2eXMN4QtV7uo+hOgNsKn2PEPmG5nXf+MZDDnuD9kygMluoGwePTJcdas/fZ z72vq4ksq9f9vSaSyJYjgpIOyn4v9xmrvuqBSzid+4kZGVd2E9rGpan1YZpX1+ZC4bJ78kXKtVIGrQ hG7wYSvcHDGVFIYIWJJSPpyoiA/b/YNtCB4Ca/2EeUH5T5BE6kGLM4yFAsyERb4y+KKIRgvQ4FQG+I JW1ooqDpHf2l4pqirND5G4fQZVvwqFw== 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=GIMmSM2gwguhD+9WfQz+OUKouLFQwhz4D854Ezd4nCc=; b=TqVLpOapZD1fOk5mkEuKkZ5e0LgWcddu6tOnrGvTKzLI2RuzGlFueOJwSMdxYMwI20gC8uv8kfW+o XvOvX2DX3Trfx6L3T9wsYuVbZvBYuICr1PJNdE0h7JQJW++IEq+TpnCYUeHpe62w2sgm6zZfsCHlEw Iih7xwUj9gITxkonbHvNXedVCK3OUDUVGsBHNQLRyPeCFVdJ/xoDjcvZhU1DGDoMop9znQkitFBU2K GH+in0E9ryAiBsxZ8emYMCBPoJUJTir3uSNGzOqyJ8HNApQ8MyvOUtZGAWf3ed3xI2pd/bHtZepdBi YiYqqvhh4OuRkDYMLFoZyOTGAQil/kA== 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:cc:to:from:subject:message-id:from; bh=GIMmSM2gwguhD+9WfQz+OUKouLFQwhz4D854Ezd4nCc=; b=suai45tgondLALqw18Vc1DDK+VupfiN6sESI2elh+BAntSA7rb7JSpBIVk42UZK+yi6vUXSQEYf2O VTApdbYtXrn8e7VTH+M2GgxsbXBeEJrY72YIu5q7Y9THs6g642uot8//VNYwcy0s/vEhGaAZFl3Oxi 42anFXZRHaroSSh4xZQ0enQwTtHZOBa2vY5rE6ZQIOYcUQp0UUhZBCxqrewtumy7WrdQ3P2e7R+Bak iaAcIf5nlqx+5iDwU2x9oxVqbhVfQ6Em/6xQWDZKrFoihTbEOlPacvTNssTm8nEruvwkUnFZ9gaKq1 w/2wJp6ak++5LEDVdCb+pavqyr9JcSw== X-MHO-RoutePath: aGlwcGll X-MHO-User: f8f3431f-e346-11ea-a2bb-9f0c275c2f69 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 (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id f8f3431f-e346-11ea-a2bb-9f0c275c2f69; Fri, 21 Aug 2020 00:41:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 07L0etCs094655; Thu, 20 Aug 2020 18:40:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: Kmod driver at iicbus. attach() and config_intrhook(9) From: Ian Lepore To: John-Mark Gurney Cc: Alexander Mishin , freebsd-arm@freebsd.org Date: Thu, 20 Aug 2020 18:40:54 -0600 In-Reply-To: <20200820235301.GE4213@funkthat.com> References: <7fabb65d99aaa74775c1daa91bffb873@mh.net.ru> <3249fa7e-554a-83ef-57b2-7c38aa0b4591@FreeBSD.org> <20200819072409.GA59949@bluezbox.com> <05145b71692af74b103bb226a2e93a15e1e851cb.camel@freebsd.org> <20200820223918.GC4213@funkthat.com> <20200820235301.GE4213@funkthat.com> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BXjPK49xtz4G8F X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2020 00:41:10 -0000 On Thu, 2020-08-20 at 16:53 -0700, John-Mark Gurney wrote: > > Hmm, yeah, it looks like more has been done along these lines than I > > remembered. In fact, the work may be done. > > > > Some i2c controllers have to work properly before interrupts are > > available, to control things like PMIC chips that are required very > > early in device configuration. Typically they have some sort of > > Ahh, yeah, forgot about PMICs... > > > polling mechanism that's used early, and revert to using interrupts > > once they're available. The allwinner and rockchip drivers work that > > way. > > So, sounds like any controller that is found to not be doing this, needs > to be fixed to use the above function, and then the remaining ones that > either poll, or use the hybrid approach can keep using > bus_generic_attach... > > Back to original question, no, that additional logic should not be > needed, and any controller that requires it needs to be fixed > instead... Yeah, it was always my plan that after all controller drivers were updated, the intrhook stuff could be removed from slave drivers that still have it. I'd like to see the controllers that can do xfers without interrupts have a comment that says so. Something like /* no need for bus_delayed_attach(), we xfer without interrupts */ Then you can grep -l for add_child.*iicbus and grep for bus_delayed_attach and compare the two file lists to find drivers that may not be doing the right thing. Using that technique now shows that we may still have a dozen or so controller drivers to fix (or at least examine for correctness). BTW, all of this tends to apply to SPI controller and slave drivers too, but the problem is likely smaller there because we have fewer SPI controller drivers. -- Ian