Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4547902ioo; Tue, 31 May 2022 06:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwndi0egVwsYwpvxT/DwWBSigmBeV1Nz9j/l1q+KTi1gin0oV9PPUYmLSg88kc/ow0gedi8 X-Received: by 2002:a05:6402:350e:b0:42b:47d9:88ec with SMTP id b14-20020a056402350e00b0042b47d988ecmr50755376edd.407.1654005179679; Tue, 31 May 2022 06:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654005179; cv=none; d=google.com; s=arc-20160816; b=hNnq/oHcUpX0u9oYBmtP34wAu/Sl+1biejim/wkpdc2qjuaH+hxtPxPGI7/1+af+D3 xQeRPG4wn5hv3qKgmFyMHM2iwfstDuARcrUyVbbBH/1RG6g0XMqLTaSdfyFUasLHqJsT ykdQuYNZV4YKo2bHTsRxDRsAj1UE3R9whl0I9XEjO10o4koE3wLoB0WO5IH0qjNqVQDr Jc5koCiSdkiXGALk+TJ+5W3P/hdQxfNq3Lsku82dQ94gIq6BfwGHFkExpKjkmeFnyPZi vFppCBPMAVfKWE8IZG/pAWWXaClAaMPJRQ4v8MCx1MX7copRRAVYdKBGAOUy9UIYHUJ9 CI0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:reply-to:from :subject:message-id; bh=UnCTZ+Pp9LxNPBKma/EXyc0GiVfF3v9GMX+oU6O31Ns=; b=GugtLXFrKQuA4MOWSDNlXqOXEqSSubkzyfB6xuroUYnrmtGJ7saz/Nc8dXcONr9zWa ZaCwV/zYA0weS+UsSbbTv3iOACSsszk2ApCvaEFRShHSyrzU6J+DwlGRh5vDN9D0+3Ai 27ng0a8bDfLa2wU1uhXMjZE1R/EafgFAX/G2IVSywLeu2smqA/NE6JUBshaZG07HQ7TI 8DnaipHPDfk1yW/p06mIurmWyY79JzijVybvG6bo45aKsMXyajPcq2h5sG7zUADsAnjP u9qQn1RKo0eOEP4xkAY2V1IEs8jlfyye+8aU9ZSIX8ROyBUeFGu+5pxbWfJgSUoyNqi+ G/kA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn4-20020a0564020ca400b0042dcaf306fesi7335670edb.230.2022.05.31.06.52.42; Tue, 31 May 2022 06:52:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240091AbiE3PdY (ORCPT + 67 others); Mon, 30 May 2022 11:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239492AbiE3PdQ (ORCPT ); Mon, 30 May 2022 11:33:16 -0400 X-Greylist: delayed 601 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 30 May 2022 07:36:19 PDT Received: from ns.iliad.fr (ns.iliad.fr [212.27.33.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81DF7139AD4; Mon, 30 May 2022 07:36:18 -0700 (PDT) Received: from ns.iliad.fr (localhost [127.0.0.1]) by ns.iliad.fr (Postfix) with ESMTP id 440C42008F; Mon, 30 May 2022 16:19:06 +0200 (CEST) Received: from sakura (freebox.vlq16.iliad.fr [213.36.7.13]) by ns.iliad.fr (Postfix) with ESMTP id 3B13620054; Mon, 30 May 2022 16:19:06 +0200 (CEST) Message-ID: Subject: Re: [PATCH v7 4/9] ath11k: Add register access logic for WCN6750 From: Maxime Bizon Reply-To: mbizon@freebox.fr To: Manikanta Pubbisetty , ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, mka@chromium.org Date: Mon, 30 May 2022 16:19:06 +0200 In-Reply-To: References: <20220429170502.20080-1-quic_mpubbise@quicinc.com> <20220429170502.20080-5-quic_mpubbise@quicinc.com> Organization: Freebox Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP ; ns.iliad.fr ; Mon May 30 16:19:06 2022 +0200 (CEST) X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Thu, 2022-05-26 at 09:12 +0530, Manikanta Pubbisetty wrote: > > Thanks for letting me know about this, IIRC I don't remember > encountering this problem in my testing. Just for my understanding, > have you reverted this change and confirmed that these errors go away > ? I first confirmed the register location was indeed incorrect, then I fixed it like this: --- a/drivers/net/wireless/ath/ath11k/pcic.c +++ b/drivers/net/wireless/ath/ath11k/pcic.c @@ -143,7 +143,7 @@ EXPORT_SYMBOL(ath11k_pcic_init_msi_config); static inline u32 ath11k_pcic_get_window_start(struct ath11k_base *ab, u32 offset) { - u32 window_start = 0; + u32 window_start = ATH11K_PCI_WINDOW_START; if ((offset ^ HAL_SEQ_WCSS_UMAC_OFFSET) < ATH11K_PCI_WINDOW_RANGE_MASK) window_start = ab->hw_params.dp_window_idx * ATH11K_PCI_WINDOW_START; @@ -170,8 +170,12 @@ void ath11k_pcic_write32(struct ath11k_base *ab, u32 offset, u32 value) iowrite32(value, ab->mem + offset); } else if (ab->hw_params.static_window_map) { window_start = ath11k_pcic_get_window_start(ab, offset); - iowrite32(value, ab->mem + window_start + - (offset & ATH11K_PCI_WINDOW_RANGE_MASK)); + if (window_start == ATH11K_PCI_WINDOW_START && + ab->pci.ops->window_write32) + ab->pci.ops->window_write32(ab, offset, value); + else + iowrite32(value, ab->mem + window_start + + (offset & ATH11K_PCI_WINDOW_RANGE_MASK)); } else if (ab->pci.ops->window_write32) { ab->pci.ops->window_write32(ab, offset, value); } @@ -200,8 +204,12 @@ u32 ath11k_pcic_read32(struct ath11k_base *ab, u32 offset) val = ioread32(ab->mem + offset); } else if (ab->hw_params.static_window_map) { window_start = ath11k_pcic_get_window_start(ab, offset); - val = ioread32(ab->mem + window_start + - (offset & ATH11K_PCI_WINDOW_RANGE_MASK)); + if (window_start == ATH11K_PCI_WINDOW_START && + ab->pci.ops->window_read32) + val = ab->pci.ops->window_read32(ab, offset); + else + val = ioread32(ab->mem + window_start + + (offset & ATH11K_PCI_WINDOW_RANGE_MASK)); } else if (ab->pci.ops->window_read32) { val = ab->pci.ops->window_read32(ab, offset); } -- Maxime