Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3829328ybb; Mon, 6 Apr 2020 17:02:03 -0700 (PDT) X-Google-Smtp-Source: APiQypIAI5/pygxDrwPYcUgvUjM+EdTdVpx2qyGYJQk+qpV276Cvazfr5O6HE11nCxnk259jxppO X-Received: by 2002:a05:6830:1541:: with SMTP id l1mr19731685otp.297.1586217723048; Mon, 06 Apr 2020 17:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586217723; cv=none; d=google.com; s=arc-20160816; b=UAg8nXtLGNwj+FH8sxmHuTRM7KJR6ABcHrrV5hJoXlXKxdcQqy54nwmyRVz72iXjSB 5AJKlkCEQH5XgEKZF+4hdaebul58gOc/HbikNQONMDO48J+54kM23WmMYUBXo3MT+hhZ CEF8t3muLu4lj/cJYogdLkDwrpx3PgtJKRWG5+ZglaRn1mpV04Qz+K/geMv0zo1j78jE iIP/g6ptr6sTv1gGvwqSuwdXYwvdVuWPnAse9TZKA/kfcKiMMpuQxUJBsdLJ/B75R4Mg mpXLLUEgabQUjZmjWMJyQlgTudGzl33LY/2R3kSmnSsEYKq39rVyjVJp8ysx25qK6lSK +n0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lHbXJ9vXM4+dU5Sz6fkmoLJzaPhx2iKjMlji8mhSLF8=; b=inVb2wtiB9wH96cZ65gjS5qzubPHPq+igIUXIGlYPj+M7kvYJ0YnVOztUrCpcbuKsJ Bb1gd1d4u26Shcxg3T8LzrsMHtp9q24JCqTRJw99nYr+Z5seCNlyfD3pO8UezSvazH2z VbG3u5w2KfFHNA8qt2N28MgYQRxK2wTHlSfIZ6T0yMGQA5dhvC439nCWXuR+2W2SjZZ6 uiTmxC1aUzMvesgmTPCUQL7eMp/cMNKlhQq951Z+ChwYlZK1xE0R/GL/SJGUrEzMH8nx 444atTaR898TuuYHuTL/K+whXUOHELjCip8HZRTVE6ZGScwjJ+xXO0PApy2rYDSDeUP2 icrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=biYnjtFg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si555410oto.169.2020.04.06.17.01.51; Mon, 06 Apr 2020 17:02:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=biYnjtFg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbgDGABL (ORCPT + 99 others); Mon, 6 Apr 2020 20:01:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:33608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgDGABK (ORCPT ); Mon, 6 Apr 2020 20:01:10 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 992B12078A; Tue, 7 Apr 2020 00:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586217669; bh=pXKRpwwHtbm90DIBd74/wZF5z6Ew8Gi8Rdz4A52o3G8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=biYnjtFgvDBXrlocXIFdt2BcsmJpLtGwgIiteml2s/rs5eYHbQrSPu5OqWEPg19VD Pe9TS72Np7dVq8IgwdEFvoME8yG9pAum+8LxJchJv/FMfZAJoIDq8OFfFZBZ5wZ2Sj 0tdwuYH0Z5SarbQDaD8zrJTzYXoosDnSY1/bzfWc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mordechay Goodstein , Luca Coelho , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.5 08/35] iwlwifi: yoyo: don't add TLV offset when reading FIFOs Date: Mon, 6 Apr 2020 20:00:30 -0400 Message-Id: <20200407000058.16423-8-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200407000058.16423-1-sashal@kernel.org> References: <20200407000058.16423-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mordechay Goodstein [ Upstream commit a5688e600e78f9fc68102bf0fe5c797fc2826abe ] The TLV offset is only used to read registers, while the offset used for the FIFO addresses are hard coded in the driver and not given by the TLV. If we try to apply the TLV offset when reading the FIFOs, we'll read from invalid addresses, causing the driver to hang. Signed-off-by: Mordechay Goodstein Fixes: 8d7dea25ada7 ("iwlwifi: dbg_ini: implement Rx fifos dump") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20200306151129.fbab869c26fa.I4ddac20d02f9bce41855a816aa6855c89bc3874e@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index 4c60f9959f7bf..e5c9149099886 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -8,7 +8,7 @@ * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2015 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright(c) 2018 - 2020 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -31,7 +31,7 @@ * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2015 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright(c) 2018 - 2020 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1407,11 +1407,7 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt, goto out; } - /* - * region register have absolute value so apply rxf offset after - * reading the registers - */ - offs += rxf_data.offset; + offs = rxf_data.offset; /* Lock fence */ iwl_write_prph_no_grab(fwrt->trans, RXF_SET_FENCE_MODE + offs, 0x1); -- 2.20.1