From nobody Fri Sep 08 02:39:32 2023 X-Original-To: wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RhgLz0ZHhz4s8kW for ; Fri, 8 Sep 2023 02:40:11 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from webmail5.jnielsen.net (webmail5.jnielsen.net [IPv6:2607:f170:34:11::b0]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.freebsdsolutions.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RhgLs2Lp9z4Nlc; Fri, 8 Sep 2023 02:40:04 +0000 (UTC) (envelope-from lists@jnielsen.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of lists@jnielsen.net designates 2607:f170:34:11::b0 as permitted sender) smtp.mailfrom=lists@jnielsen.net; dmarc=none Received: from smtpclient.apple (166-70-14-17.xmission.com [166.70.14.17] (may be forged)) (authenticated bits=0) by webmail5.jnielsen.net (8.17.2/8.17.1) with ESMTPSA id 3882dmKb073825 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 7 Sep 2023 20:39:51 -0600 (MDT) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail5.jnielsen.net: Host 166-70-14-17.xmission.com [166.70.14.17] (may be forged) claimed to be smtpclient.apple Content-Type: multipart/alternative; boundary=Apple-Mail-31602FB8-1D0A-4491-9B5B-7845115F7FF2 Content-Transfer-Encoding: 7bit From: John Nielsen List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: Help me grok the ath(4) device attach code Date: Thu, 7 Sep 2023 20:39:32 -0600 Message-Id: <92D595F6-C268-4E61-BB3E-51DC5F8B6961@jnielsen.net> References: Cc: "Bjoern A. Zeeb" , wireless@freebsd.org In-Reply-To: To: Adrian Chadd X-Mailer: iPhone Mail (20G75) X-Spamd-Bar: / X-Spamd-Result: default: False [-0.49 / 15.00]; MIME_MA_MISSING_TEXT(2.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.96)[-0.957]; NEURAL_HAM_SHORT(-0.93)[-0.932]; MV_CASE(0.50)[]; MIME_HTML_ONLY(0.20)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[multipart/alternative]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:6364, ipnet:2607:f170:30::/44, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:~]; MLMMJ_DEST(0.00)[wireless@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; BLOCKLISTDE_FAIL(0.00)[166.70.14.17:query timed out,2607:f170:34:11::b0:query timed out]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[jnielsen.net]; HAS_XAW(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4RhgLs2Lp9z4Nlc --Apple-Mail-31602FB8-1D0A-4491-9B5B-7845115F7FF2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Com= ing back to this after a busy couple of months..

<= blockquote type=3D"cite">On Jun 11, 2023, at 9:48 PM, Adrian Chadd <adria= n@freebsd.org> wrote:

On Sun, 11 Jun 2023 at 18:17, John Nielsen <lists@jnielsen.net> wrote:
=
> On May 30, 2023, at 11= :17 PM, Adrian Chadd <adrian@freebsd.org> wrote:
>
> There's known issues with all the Atheros chips (sigh) with how the EEP= ROM and PCIe bus reset .. interact.
> (If the bus reset is too short then the EEPROM state machine gets stuck= and nothing gets read.) It makes debugging this hard because the NIC itself= will work in another device fine, because it's the BIOS/ACPI code. :(

Are these =E2=80= =9Cknown issues=E2=80=9D documented anywhere public?

Does =E2=80=9Cnothing gets read=E2=80=9D manifest as getting zeroes back? Th= at does appear to be what=E2=80=99s happening on my laptop:
=

Yeah that's not a good sign.
 
Trying (2) EEPROM access at address 0x03ff
ar9300_eeprom_restore_internal_address: Found block at 3ff: code=3D0 ref=3D0= length=3D0 major=3D0 minor=3D0
ar9300_eeprom_restore_internal_address: word[0]=3D0x00 word[1]=3D0x00 word[2= ]=3D0x00 word[3]=3D0x00
ar9300_eeprom_restore_internal_address: checksum 0 0
ar9300_eeprom_restore_internal_address: EEPROM structure size mismatch memor= y=3D1088 eeprom=3D0

Are there any workarounds (even gross ones like sleeping 2 seconds somewhere= )?

The gross workaround is to manually r= eset the pcie RC/EP and do it for the right amount of time. ;-)
<= /div>
How/where would I do a proof of concept of this g= ross workaround? Sprinkle in pcie_link_reset() somewhere? Or is it more of a= rewrite of the bus initialization code?


=
Thanks,

JN

= --Apple-Mail-31602FB8-1D0A-4491-9B5B-7845115F7FF2--