Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp951337lqm; Thu, 2 May 2024 00:05:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXca2nA14Pxe01A4hkgBscVVlR8IXjtWj+BUC3kff2qzLda5chWdJZVSJQvJq4GcT/ooVLMbIf7dcx5u9wVnfZ9LTLtPGktKRJ+w94tJQ== X-Google-Smtp-Source: AGHT+IFoWBxaYd5NSlqQgL1DzsCoc6pSeIgwkqwJAfl+ZyZaWo7xBVnLgL1sQIzg7uwAyAxq7wFB X-Received: by 2002:a17:90a:c383:b0:2b2:9fe9:d9a6 with SMTP id h3-20020a17090ac38300b002b29fe9d9a6mr1135874pjt.24.1714633555666; Thu, 02 May 2024 00:05:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714633555; cv=pass; d=google.com; s=arc-20160816; b=N0nrYmbnHQknWSNGxL22+38KnKqhpjMqKqaFGWJLnOEjwn8dE/YelNsNXpuXgvyocH YpsfRfxK/g/Zy/OdFBF2gWafCACaKYz03JN3axMnlrUHNGhdCfJ5T9HrVqYhnVxcqGzo vU5o2rxDSiCRICRs7S7akC6NPzZsAwOeHZobgHbaOtz8IikD2k0gzPNL78du9a4FzBV2 Kx1pybmeGYt3V78ohzNPh+/yd5S4bZVMqMspU/vdz6JadqnG9TTRtXIXBwzMtCwNvH0E U+TA/CH2zRDRSDmEd3YabmWSY68cul6QjRXjl5HYbB40iI6yG59wo5LwFaBh/N3HNJqm BjRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=DZNVlNvJLDH4dzhZVNxCUIK/u/XXde2l+sjFkINRI20=; fh=cnawQ4C2RijBKclKiUkDypcCvRPmU6A6Lhe+ScMqfqc=; b=b3TpEqnTqFgxYnrWNMjLyOs7P6Fyb1nGFtQ0//wz5peD4b2wqVR9luiofp9Ilb753P fbgL8fUDRnDusxqZtt1vr8m5puOzTTS3knWDpG/sD4P05P6P6CHjrn8QaglmFomjINw/ xDlOuPCIh0VoOF/7P3ZkwevdB6F5K8f8E4PTQmyibQVTwP0A6ji2a9pd4GeEvtT39+yl A0J9KE76FkywS9Vbx+dZAhXkqn+jMZBROjy68c6bcRS4lBupyBalf57Qq+gyCiDYsup1 +5f7LLfVmWxy1qz15+H/4WALNdSf8rNQC2mRySHuGSncS6kNb0zfDj5B976NDWhIriab Spmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oRqGX9Fx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7107-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f19-20020a17090ac29300b002a297239055si519149pjt.71.2024.05.02.00.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 00:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7107-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oRqGX9Fx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7107-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3A40AB2105A for ; Thu, 2 May 2024 07:05:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 669A121A04; Thu, 2 May 2024 07:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oRqGX9Fx" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C7DC1CD32; Thu, 2 May 2024 07:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714633541; cv=none; b=fccELQUodKFdTD9JNFC/Q74a5X+0Z+/JC1pU+z1nS9yDliDV6bZitJ49XXfmTusWVLEZiHO1VYvEwuoy49AT++nK/mnKhrnlQTe9fqLJbPSDPS6t7Rq/lgrqORId7SY41OwQK6KqbL10hKyfgat3T8qmtYN9Zr4YRC518C0WQhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714633541; c=relaxed/simple; bh=qohn0+wgZK8fW1L5cozppymgAyY5UyPVH1hNxyFm7eU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=YRQ8bOGerjxTyiiS97QkNvgC4EVkXGQS0+tZ/ZdegEFCz2JqkeJxc5YzkEryN2Fe0rqKudOl1D+Zv9chhpTHlyghzgMDHs9HzBDXwChaZKttNBOCyFwtJPhF9EMKGdjWPKSVVS8oq649cYP2rEYa7ajvA0JaSOzDmNh7IQvHT1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oRqGX9Fx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57CB4C116B1; Thu, 2 May 2024 07:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714633540; bh=qohn0+wgZK8fW1L5cozppymgAyY5UyPVH1hNxyFm7eU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=oRqGX9FxmLIFyp9Bj3JGwc+u09C7EFFuKGwAASNv4wI1ZecH8gJiEifMEwVgOmiyX 3ukJLI8BFq4b5Bm/t6P2NyP3eFpDt1ymuOO1Q1Ti9QuFKuNnM+Zt6ShK3WDBtUBhdH JqCy1IprTP8X+NzlXZRb97dGg6iZZgD7fbqxlpwe9rilg43LBzPtoJrgq/ohjORFhS A6wrkUXcbDN3+OWOo2boPlvWB8+RBeSI39lHsDcsvCsXbnPKnh57RL/Oon7OZAofAc pl1tOc6XriZ1t6L5TtbjxGoerBIckRM8/KxWvpbaiiHcWhV8OIKJoDpkXsK6Dgw0Z1 I917sxhoe5jNA== From: Kalle Valo To: Jeff Johnson Cc: Ziyang Huang , , , , Subject: Re: [PATCH] wifi: ath11k: fix remapped ce accessing issue on 64bit OS References: <6336ffc7-d8ae-4cfd-8b66-d6d91cb0d15e@quicinc.com> Date: Thu, 02 May 2024 10:05:37 +0300 In-Reply-To: <6336ffc7-d8ae-4cfd-8b66-d6d91cb0d15e@quicinc.com> (Jeff Johnson's message of "Wed, 1 May 2024 09:56:15 -0700") Message-ID: <87zft8elry.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jeff Johnson writes: >> static inline u32 ath11k_ahb_read32(struct ath11k_base *ab, u32 offset) >> { >> - return ioread32(ab->mem + offset); >> + switch (offset & ATH11K_REG_TYPE_MASK) { >> + case ATH11K_REG_TYPE_NORMAL: >> + return ioread32(ab->mem + FIELD_GET(ATH11K_REG_OFFSET_MASK, offset)); >> + case ATH11K_REG_TYPE_CE: >> + return ioread32(ab->mem_ce + FIELD_GET(ATH11K_REG_OFFSET_MASK, offset)); >> + default: >> + BUG(); > > you can WARN but you can't BUG (and even WARN is being discouraged) Yeah, even WARN() is risky especially in a function like this. It can cause so much log messages so that the wathdog can trigger and reboot the host. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches