Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2153050rwl; Thu, 30 Mar 2023 06:46:29 -0700 (PDT) X-Google-Smtp-Source: AKy350YEMQ49fN8Zz/0ozbTgojDD0X/8jAbwqOCGS+rU9aoJsxCOvXSdzSscCzflFPPtRKlpJCB5 X-Received: by 2002:a05:6402:10d8:b0:4fb:2296:30b3 with SMTP id p24-20020a05640210d800b004fb229630b3mr22960584edu.15.1680183989396; Thu, 30 Mar 2023 06:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680183989; cv=none; d=google.com; s=arc-20160816; b=lhfTsLEuTxPHaBJldnLd0My0M9kzbpRJIRjE1L6ZPqQA6LFgQxdhnHpXjdr5Ay+tA6 Ea6RruMtyBQO9N1mNCQ6IGjhK+REyB+dwrK7eOh5EZP4EFEAqrid+Yb6tD3YTAZ4yBdl IFeJv1smNdxQCVaCMUr3L7D2Nikv9NPy59hN5+CAVhPggKdxhqadqPIij2rLIYEpz7ED oM2j2e+OTeUmjcQAiHN4gl66Mhf9EC1AQpAeVMET+Q49QLwrYLSvgEmWv01cgWoHOR/x sgIJwggQjFgTpfYfdBX/qw3dpqOv/r/urByf2hdVQIXY8WwC0GF9Q1uukvHONxSrIYT+ ZAZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=iwcsnV9PI7cjjYT37XSQZUYM9/h/szm8FuKiFwTpB+E=; b=XFImh+qXY2icDfzmuFxTSEXnewj4xcdhSJiz/BYbwMbIKrsv+iErcRX2puBb6inZI3 aQKM1dBdivFLRSnPww5dMlZvtef83ul6tZDsltV0vfeXgx1Ms2BXehgOw0ZX8F9fWrp2 ZfzN1XycfIdff5WeIE9uQVBthz3TqadAOVoW6jinPALsvAduxURNRoqWZmZymmPmh3m5 soCYGu5R44Wr+LHAYLngjGLkk8xfhDZYeO+OA9ydIaIs2PJLsjYk1i6xScmvOORGG3vL 9nAwk+lE7VA08YByShGpQulnaIrvq2hu6w1W0qJAbv2BokdyHk8DR+EXYc7q/7nlv/Y/ PI/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@seqtechllc.com header.s=google header.b=JHJ7KuLV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=seqtechllc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020aa7d64c000000b00502241c86afsi16339513edr.320.2023.03.30.06.46.14; Thu, 30 Mar 2023 06:46:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seqtechllc.com header.s=google header.b=JHJ7KuLV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=seqtechllc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232153AbjC3NpF (ORCPT + 59 others); Thu, 30 Mar 2023 09:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232059AbjC3NpC (ORCPT ); Thu, 30 Mar 2023 09:45:02 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6976BDC8 for ; Thu, 30 Mar 2023 06:44:41 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id q23-20020a05683031b700b006a1370e214aso7145069ots.11 for ; Thu, 30 Mar 2023 06:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seqtechllc.com; s=google; t=1680183877; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iwcsnV9PI7cjjYT37XSQZUYM9/h/szm8FuKiFwTpB+E=; b=JHJ7KuLVBf/AOvBl3Fr/7vVEDPudAIp/NVmsC/n0hig5S5cqqrkwYNsosxwK3JlUNm /iP2QTLgwHJOZXrR5YNRwbBBAN4yuuD/pZrA39KKghuwHwRYHRyzvhc+DzBDhG45LBRh VKLXoJF9o3SeRnFAGfmQ+9cU2U0gceSGcaPgG0OS8otULr/bMh0kDFRdOxuLw1RH+Bli q6wSsOexODlcrX6Nq2TqMDPksb7uoTlDfxIV842crkloLb8C5zq3sNAIoqEAam7xuwZv 5VnN6HoYmiBJqgxas3RD2luRxwz4gox9xBHzOU+icZ8NHAq5ZcZFR0Tp4r39zqXMzVwG doWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680183877; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iwcsnV9PI7cjjYT37XSQZUYM9/h/szm8FuKiFwTpB+E=; b=0N3qpWUDReXhk05GyMvY/8cfLtnlMnu6RZd7DRkExlMGf9RJRt1hSs+Yv/QF1aRag/ 6LXcaAJCMcXErnGb9xnEtE3OplDZU4ZjGcO7niA1OUfkTrxzRrrwCt6uuIWNnZ6HAjyO VnFGTJ3qX/U4CDQfdvGlEJ7aWM/77S2TmCGfk1rwZJwaSLo8AxvDfmoch7wO1QWDIZWG UDyyXx+rnfHa35153ZMj7QtKW5IK9J5rXbaXn356rhf0gdjUOALXwRPYZILeHSQPAA2z u9HONoUiEm+Oy6ufNSyidvGGZKAGbE2OWrrhCawbkmBiVYValA1f8CAhjuTkMHlzc5o4 uzcg== X-Gm-Message-State: AO0yUKV6JPDB8A35C3Am8o/5o47IsVOLs2EKkwtSl52Gw7aFoz7KIjOi N97zPscQt1cLLoLdwyiD+jD3ygt7nyVEI6BUx+PQoZZbvUS2ZAutkmApkDxa3AFaK3zgd8wCaYX kBOf8WWNSLYT2aOXOZm2sdGIVDZIUONHaY3uGqkJlTK2deLBwwoxGXECCIwMkPRf53Fg2DdJnwv rY1qyFtjfIWbkC7d3R/Lio2BIo/SvE5KaIS6FJTOA7KF9i+mvsXPUTjA== X-Received: by 2002:a05:6830:1e38:b0:69f:8a54:d6fa with SMTP id t24-20020a0568301e3800b0069f8a54d6famr11390899otr.10.1680183877091; Thu, 30 Mar 2023 06:44:37 -0700 (PDT) Received: from smtpclient.apple ([67.202.189.242]) by smtp.gmail.com with ESMTPSA id t16-20020a9d7750000000b006a036b9794asm7424416otl.37.2023.03.30.06.44.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2023 06:44:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: shift exponent 35 is too large @ ath/ath9k/ar9003_hw.c:1147 From: Gregg Wonderly In-Reply-To: <87cz5079p1.fsf@toke.dk> Date: Thu, 30 Mar 2023 08:44:25 -0500 Cc: linux-wireless@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <27B86217-CA79-4E4A-842B-9B2341B48B13@seqtechllc.com> References: <87cz5079p1.fsf@toke.dk> To: =?utf-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org I have not tested this. I am in the middle of testing on this machine = of many other things and building a kernel right now is not on my = timeline. Note that I have a magic 6 constant in there. I derived this = from dividing 32 by the bit mask 0x1f width of 5. But looking further = at this, it seems like chk_dbg should actually be a u64, and dma_dbg_4 = and dma_dbg_5 placed into that value as a continuous 64bit value. But = again, I don=E2=80=99t know if there are 2 bits at the top of dma_dbg_4 = and 3 bits at the bottom of dma_dbg_5 that go together. This needs to be = fixed by someone with the time and the knowledge of what=E2=80=99s going = on in the hardware. Gregg Wonderly > On Mar 22, 2023, at 4:33 PM, Toke H=C3=B8iland-J=C3=B8rgensen = wrote: >=20 > Gregg Wonderly writes: >=20 >> I am receiving a console error message from this driver that appears = to be in the following function. In this function, the chk_dbg variable = is 32bits and there is logic that seems to attempt to select from 1 of 2 = different 32bit values to get a 64bit wide mask value into chk_dbg from = dma_dbg_4 or dmc_dbg_5. >>=20 >> The problem is that the (5*i) shift count should be have i adjusted = by the 6 limit used to make the check for which dma_dbg_[45] value = selected. >>=20 >>=20 >> static bool ar9003_hw_detect_mac_hang(struct ath_hw *ah) >> { >> u32 dma_dbg_4, dma_dbg_5, dma_dbg_6, chk_dbg; >> u8 dcu_chain_state, dcu_complete_state; >> bool dcu_wait_frdone =3D false; >> unsigned long chk_dcu =3D 0; >> unsigned int i =3D 0; >> dma_dbg_4 =3D REG_READ(ah, AR_DMADBG_4); >> dma_dbg_5 =3D REG_READ(ah, AR_DMADBG_5); >> dma_dbg_6 =3D REG_READ(ah, AR_DMADBG_6); >> dcu_complete_state =3D dma_dbg_6 & 0x3; >> if (dcu_complete_state !=3D 0x1) >> goto exit; >> for (i =3D 0; i < ATH9K_NUM_TX_QUEUES; i++) { >> if (i < 6) >> chk_dbg =3D dma_dbg_4; >> else >> chk_dbg =3D dma_dbg_5; >> dcu_chain_state =3D (chk_dbg >> (5 * i)) & 0x1f; >> if (dcu_chain_state =3D=3D 0x6) { >> dcu_wait_frdone =3D true; >> chk_dcu |=3D BIT(i); >> } >> } >> if ((dcu_complete_state =3D=3D 0x1) && dcu_wait_frdone) { >> for_each_set_bit(i, &chk_dcu, ATH9K_NUM_TX_QUEUES) { >> if (ath9k_hw_verify_hang(ah, i)) >> return true; >> } >> } >> exit: >> return false; >> } >>=20 >> The for loop seems to need to look like the following: >>=20 >> for (i =3D 0; i < ATH9K_NUM_TX_QUEUES; i++) { >> int off=3Di; >> if (i < 6) { >> chk_dbg =3D dma_dbg_4; >> } else { >> chk_dbg =3D dma_dbg_5; >> off =3D i - 6; >> } >> dcu_chain_state =3D (chk_dbg >> (5 * off)) & 0x1f; >> if (dcu_chain_state =3D=3D 0x6) { >> dcu_wait_frdone =3D true; >> chk_dcu |=3D BIT(i); >> } >> } >>=20 >=20 > Did you test this? Please send a proper patch :) >=20 > -Toke