From nobody Mon Jun 12 03:48:16 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 4Qfd2R3Xhlz4cHjt for ; Mon, 12 Jun 2023 03:48:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qfd2R12JQz3jjf for ; Mon, 12 Jun 2023 03:48:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-4f122ff663eso4337886e87.2 for ; Sun, 11 Jun 2023 20:48:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686541709; x=1689133709; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UojZdW9RDxNY8bHSCiZCNAHQRrnhGgyvlV9IqduGFcU=; b=MsbVfVP1zlfi2oralPedHjOdu0wjdQxeV/EGd91EVMANnB+MJem18lYZ6ieOv9xd6g rbyq2gLb4ZVy4PBgbCGaLWWcr5prCZs4STgSMDtz3BrSEWaL9ao/YtSfvJ+ezXQe5L6B 33GUp1Ir6eIOyrVCMyS6ZzmQ6ycTtgVju/xqE3g4CyvhDqxp3lwq64fPUp6mzJh7uXzS 7hMXicGzAg5P+rG1QpohdjAp642tDwwBIKCb2cr4m6IqmvY1y8aF3jzcmQdrvJg+uYta b6xESNCiQmko9iKVkGzEM84F/XaHQ2WlBm5Vfl+r3/S8jTOmks6b5KseNIapTVJDwyi0 6aZw== X-Gm-Message-State: AC+VfDyz1B6NFO9Zu2vMJQNli6a0M7+aq19kPsPLsM9CFUxIdhEGP68t cigP1MXxCuVgm9zIu2ckkI7JxZq7BDBWfQEsCbBlHKjD X-Google-Smtp-Source: ACHHUZ50buAmBdweXWgnXt4on+ZnKaiZt8C4KN6mJZUQqC1DiVcbIjeDWJngTKNVcpyFQV9IzwAslabjyleErEtT7Bg= X-Received: by 2002:a19:4f5c:0:b0:4f6:55:7d5d with SMTP id a28-20020a194f5c000000b004f600557d5dmr2822070lfk.13.1686541708334; Sun, 11 Jun 2023 20:48:28 -0700 (PDT) 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 References: <49AEA1CB-FA85-432F-89D7-8C49B5F3A344@jnielsen.net> <85BF3AB2-2EBF-4398-A507-ABA35505A56C@jnielsen.net> In-Reply-To: From: Adrian Chadd Date: Sun, 11 Jun 2023 20:48:16 -0700 Message-ID: Subject: Re: Help me grok the ath(4) device attach code To: John Nielsen Cc: "Bjoern A. Zeeb" , "wireless@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000006c9c3405fde6974f" X-Rspamd-Queue-Id: 4Qfd2R12JQz3jjf X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000006c9c3405fde6974f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 11 Jun 2023 at 18:17, John Nielsen wrote: > > On May 30, 2023, at 11:17 PM, Adrian Chadd wrote: > > > > There's known issues with all the Atheros chips (sigh) with how the > EEPROM 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 itse= lf > will work in another device fine, because it's the BIOS/ACPI code. :( > > Does =E2=80=9Cnothing gets read=E2=80=9D manifest as getting zeroes back?= That 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 > memory=3D1088 eeprom=3D0 > > Are there any workarounds (even gross ones like sleeping 2 seconds > somewhere)? > > The gross workaround is to manually reset the pcie RC/EP and do it for the right amount of time. ;-) -a --0000000000006c9c3405fde6974f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


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

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

Yeah that's not a good sign.
=C2=A0

Trying (2) EEPROM access at address 0x03ff
ar9300_eeprom_restore_internal_address: Found block at 3ff: code=3D0 ref=3D= 0 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 memo= ry=3D1088 eeprom=3D0

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


The gross workaround is to manually re= set the pcie RC/EP and do it for the right amount of time. ;-)


-a
=C2=A0
<= /div> --0000000000006c9c3405fde6974f--