From patchwork Tue Apr 1 13:47:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 14034882 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53B5E1E51E7; Tue, 1 Apr 2025 13:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743515279; cv=none; b=gLCzdoCllW3CgLiTpGm22q5oJ8tBp0Hs40zmHK2KgoAZoS2D/cciX3l7IMXX6SAPnuUgI4WLW6vHUK/zqlGOznt3aaDz63rqXYl13WzwfrItNiSdoyvf6xgbZQzey7nx9//8677Age3ibS1Llvl1uHm+kQ0V6YjkB3gSnwFThM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743515279; c=relaxed/simple; bh=hOs++MwrUaYCOY1shivPXVBTJoZY0XCnkJVREjJHL2g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kxp5kYbJZFs34zZiVhxx3AVz/6BlXDPStZVIo6shT0Pxg+ac0B4noAOqKQn/zaWImNU2uYv2PpGd6V2+DRB6Gs/l7OxNiHwSw1ViFL6Kev1xiWNpxuzz0otfuAvtyt0P9CxAa5YQeDWuxPXCP9v65lak6mU+6tVQ2SuIgDegV64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5e5bc066283so8974900a12.0; Tue, 01 Apr 2025 06:47:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743515275; x=1744120075; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tbHCyAwFaCvDeDpwtBYWOO2ER9i73U6lCkUuCsIXylE=; b=tbNi3mttxYaS4xGWcCOYfd28isy3Ve7JYyIkT4og+VfSBviYBkJh+R/6svbcs4sZ/Q idDyAWbmbx1Yr+cCKIKK2wsMxN0NLIohdzmaerg1WiXHvYRf0W5u6ht1glR/nDIXFO03 gHJDb7mqpasuIWBmgGabU0iO/lubENnqwn1U1zhkJq9Nr5HQSekMycDA4hHEq8VQj8XP kwYr7vRU7G0cHpCQrNIod3UXLeBZdK+B3ZC/yPg7AieJq3JqoCmhyiLDgqf2NAGKvmfb 6jyketSx5iTYbEDHCBH861BER23XkhXLhvLGomusDp5ec9NTqymFs7ZJchC2gyPXQL6u T18g== X-Forwarded-Encrypted: i=1; AJvYcCW7z1VmHVNlHOUNy04/EdcqPDlK2ElNRPc6Zxp7WIQvHp00yb9xJA1P3ql1V6hp0GpPjRNX80xHICT+qow=@vger.kernel.org, AJvYcCXmZqZ1KRVppL6t78xw8oUerQs/Yggu/MUlpo3E9ZJ9hNEBCTjhS2brkAyuXjmlwUK3acDXe1u9Nk1j@vger.kernel.org X-Gm-Message-State: AOJu0YxHiFakUk2fcMN534OPwPyBhJc6TMmtwuNlR4YiPSh++1jD4SIx FCiM/mQ3vn1Q+DLtrT17QEJZwYyFUzyuLSsEZWRLH/NGDcbX9gqO X-Gm-Gg: ASbGnctq9cM10z4Io56k2392ypuVvJ1/DeFPF6WKmOg0jPzp3BDGJFr117BPmYta0PE qgpZdQmPP0poY3iORPSYKCOgIj40T43wipXpGbYk6Kmc8E6h4b3eYV0FgP5hTUGUSIDa6KYGhuT C9aojMvkWEgZxyqk3ubp9e7b7e5F4T8tiwKQD2gFYoupCQ1lREzwxYB3DQVVAR2GMbLgqz2l2jD pLFT0l4aQZI/6TR4RINlYRk9YYD1xHiDqKf8EP2PW6SbbE8SvVNhUzD2p+ja8wvBdbJkhS43BYj R+Fc8mZJhu/C/dg/8XilXXM5+3oHwCab8Sk= X-Google-Smtp-Source: AGHT+IFaOAUiA0127HNC4F1EYvGA+dTW3uSSkUW6Ld9cbie9cNlmSeb7b8CrV8OKh60U4YIEhPygYQ== X-Received: by 2002:a05:6402:40c6:b0:5ec:f769:db07 with SMTP id 4fb4d7f45d1cf-5edfde2199fmr10351630a12.29.1743515275347; Tue, 01 Apr 2025 06:47:55 -0700 (PDT) Received: from localhost ([2a03:2880:30ff:5::]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5edc16f10d6sm7205742a12.47.2025.04.01.06.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 06:47:54 -0700 (PDT) From: Breno Leitao Date: Tue, 01 Apr 2025 06:47:49 -0700 Subject: [PATCH v2 1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-tegra-v2-1-126c293ec047@debian.org> References: <20250401-tegra-v2-0-126c293ec047@debian.org> In-Reply-To: <20250401-tegra-v2-0-126c293ec047@debian.org> To: Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Laxman Dewangan , Mark Brown Cc: linux-tegra@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, rmikey@meta.com, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.15-dev-42535 X-Developer-Signature: v=1; a=openpgp-sha256; l=1190; i=leitao@debian.org; h=from:subject:message-id; bh=hOs++MwrUaYCOY1shivPXVBTJoZY0XCnkJVREjJHL2g=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBn6+6I4auklE6e72/KWx8ezg/ZfiOha9yKfuxkb JoPbheA1f+JAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCZ+vuiAAKCRA1o5Of/Hh3 bV2lD/0QX3s4v6btBpohw9Yda+5tIWCxGKCaXJrGqigGKwRe1nuf0S6LAAqthV0+1nnqM/PotNR H0MM4ZFwNV0EljCI4U9sn2Snc86W5+fwdTCTw1N9ViH4CBP8tgG+bbhcH92uQGZ0kFgsRCmhFX+ JuOGNIotBYQrscw+iwEo4zZ6PBrMXiNKNy8aMwJoXJ0a3UwCOd4qogZpi0pY1kMWnkEiCpRGxmW 5uIB/Hi1JZ8GHuGdf8AvD9Ra1vT5TO8JT041aULUsozis6U9MhEQ5/10FSjoQuo2EQPZStLBxKl rZ4zhgu5YfDULQN4u/d4O3dVQX4bdehHICUyt+cvpQWgvzSE1GqW/ckTrsqxD9n5BWgy9iPc+tT VIPkspF1GId7wGR9Dc3RL3bSQUDNiTjLI+ia9JWiH9q0cZzvARJoq+25142tRzoxw8NAhFlhtDZ D0H3vrkjiGjh/b6arnqAfILCgScJrO7X3qrjKkMwL85IygSaMCcHD1rKsETi6zewljMd3ffoAs8 K4HqSev1DLLrxVAEQMTTg4h50a/x5hL7Yw19s+VugLApk4qsHoPop+mnu+/uq6Fy7iTqoe4ca5h HpsRaGUiIy+BTNG70Nnd6GzVmkdqP5/J7Z14kCFv1P1BChl66ixBdLLGGV6texAyPC1jMOJJKm4 3dgHz2+CoqoLu6Q== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D Some machines with tegra_qspi_combined_seq_xfer hardware issues generate excessive kernel warnings, severely polluting the logs: dmesg | grep -i "WARNING:.*tegra_qspi_transfer_one_message" | wc -l 94451 This patch replaces WARN_ON with WARN_ON_ONCE for timeout conditions to reduce log spam. The subsequent error message still prints on each occurrence, providing sufficient information about the failure, while the stack trace is only needed once for debugging purposes. Signed-off-by: Breno Leitao --- drivers/spi/spi-tegra210-quad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index 08e49a8768943..2d320fbb8875f 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -1117,7 +1117,7 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi, (&tqspi->xfer_completion, QSPI_DMA_TIMEOUT); - if (WARN_ON(ret == 0)) { + if (WARN_ON_ONCE(ret == 0)) { dev_err(tqspi->dev, "QSPI Transfer failed with timeout: %d\n", ret); if (tqspi->is_curr_dma_xfer && From patchwork Tue Apr 1 13:47:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 14034883 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 965262045BC; Tue, 1 Apr 2025 13:47:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743515280; cv=none; b=F9yCAR1pXKGficXuy9SJGpD4qba9h38Wn2/wpy7r/VQqhKl5gP2I6DPqzWWxQkf/7ucf6sSxIG3VxovmYn+wJRAZrVZvYOS4zzSrJkMRGyKb1pIy8ufVPT9f3TkthZZFcipzoehDw31BGiq56308/ktwaYAolUPOdXqh4OLr1zA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743515280; c=relaxed/simple; bh=orIhHZK2mBXOHJ9P6CPj8DtCz0DKuFngNgPnyToyf84=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y6XZieIvANOGXQwrzCH2OnL9A346qizSyCP9OBtQTpRCFk8Fu6n/xdSULuhb7eZ8LpUIv83hpMZCZjLoqa4kIGLEjqajJTpNBGt+A6TjnS52O80qU1fGKt977RtP3fcgPTxzwFxYhaUtEMG/VAStviUPAw/x6CigRCdnZw0pTP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5e60cfef9cfso9021410a12.2; Tue, 01 Apr 2025 06:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743515277; x=1744120077; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X+rx1qskGEkuP5w6Tn0BhreVF2R/OVnokSpbvWp5rvw=; b=pmJsMc+cSOOx1739QvgfUOpAifNREyMsF4uRcDtuKdwKrZQG5UvSMQyCtv84uphwsj 0kkDDZd8eVqwOPqmUk2CBZAbHSKr+DEPvIsuOE3GYuzBDlYwqtywB3Ouiqf1iw2RrBF5 x8C3g7eRb3T4ri9LmDNyZK45dTImEo+Un4HR7oZklT1WL37IP5e5ILSbVF74hg+JhAoN 36zPAAxDI5rNM85hJkHMBwgfDKXGS5ZqNFR6ZIMuEwmNATKKXTxFvXOiPEZSbgZ1tDxT XFpuuLSqcl20zdwfTEVtJjXxWQ1+eGftYdh9ZrXBcx9PdvfhVRS/cbCuvvF5FngA0lfW ljGg== X-Forwarded-Encrypted: i=1; AJvYcCURB4f4zSnasFcXYCzK+jnO1kJYPgYb4YvxxCmYMkdrIRE+9XSdR6JvA5yanoukohp47d5+B2ubr/kFX1k=@vger.kernel.org, AJvYcCXs/f3A0HDJvCBkteV8tB5OX/unr++Y1Cy2ntNn5WvcBwxfZJMnBFalnQOEHxTewmwqi/s+5lVM0XPh@vger.kernel.org X-Gm-Message-State: AOJu0YwXahS+YAQ83XMd4CasxR6HcaojE00YOAsh+cyNP4TisonnH13Z gZ1Injl3xobw35Nfn7muT43X5GSTtFW21Rbkn9jYafBclWtnvneq X-Gm-Gg: ASbGncvTt8pLCGZL1GhUDRv0krpAbX0+v5P6SjyBRi8hzSAJVgyzm3NAZcSyXmy1tJq JIWjBFj1aACQS7BKIrvsUujGEC4rj7fP3VU3tD4is6gIdDi5TY45F1ZryQdSZgTyBJNPJI2gleD lEckIcC0zPyv2tpOvLezM2BxiLexI4Qmz6TbPCecGamrwkTz/j8m2Qak9HZUDRBdmi4VjMKxU6e /hFsXtB+VJGGY0X40+Fj3MUtcIvaBD0GX5OUjHsnfi+WpS6XYGhVSX1a/+39FHn8QiIZNWQQas6 bwc2vJFaPYGQUy0f04VxKqJQqJbzCAKi13Q= X-Google-Smtp-Source: AGHT+IF1ZqchpsJl91cjnqOW0TqInkBNKXIBilhyIt5S+CcHOTDLL1ou0xV+jViKplohtQaHQNdGSg== X-Received: by 2002:a05:6402:348e:b0:5ec:25d2:8631 with SMTP id 4fb4d7f45d1cf-5edfce7682amr11659933a12.12.1743515276724; Tue, 01 Apr 2025 06:47:56 -0700 (PDT) Received: from localhost ([2a03:2880:30ff:7::]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5edc17b30cdsm7015449a12.64.2025.04.01.06.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 06:47:56 -0700 (PDT) From: Breno Leitao Date: Tue, 01 Apr 2025 06:47:50 -0700 Subject: [PATCH v2 2/2] spi: tegra210-quad: add rate limiting and simplify timeout error message Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-tegra-v2-2-126c293ec047@debian.org> References: <20250401-tegra-v2-0-126c293ec047@debian.org> In-Reply-To: <20250401-tegra-v2-0-126c293ec047@debian.org> To: Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Laxman Dewangan , Mark Brown Cc: linux-tegra@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, rmikey@meta.com, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.15-dev-42535 X-Developer-Signature: v=1; a=openpgp-sha256; l=1318; i=leitao@debian.org; h=from:subject:message-id; bh=orIhHZK2mBXOHJ9P6CPj8DtCz0DKuFngNgPnyToyf84=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBn6+6IKYuj1Klp3ayQG0I42YY+kWGh8x3sA5+Lx 6v4mh/jxHOJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCZ+vuiAAKCRA1o5Of/Hh3 bZFqEACDPf/gXpU56XhDJIj+HxwyNSXfqDbAYZhODhE8kgP6KjkOZWwTufYJMY7ncMpWLstBcfp TSvB2l9gtkkpJlq0p36i1dcMZXpM/WjpNGcEtZ1mbhjQ+NSbbf0Fu68jMpYvGfFJz1vnawGgKbV kRSW0SGsZMfdN96xdf2loH+jfGaKkOhTM/yMtWe1cMu5rsf5xkMrnIQEUgw/FYlU5g/YRtxGKDM +x0kPH0FRw4FPfRHjLZFTTWJJU/amfvtrguEiWrbhQ+iFTvRZ15FSwbfMvtSfDlz1gtjtrUTQ4i 3CAhkkjqHx7OBeuTchajs8Q6CFBzXO8pySTP02ONDG7s+ID18zP4Ne64NiNqKQRv43EzEvA+Aze yMXDPIlTKci6lJ3Ch3dNMsXAr/nTCmnAeXwB3VCkEmiuAKMXDoCO24inKOYg91aOAgQqviyJZbC luL5JO3p6Xzl4mBGsrFTneKnfDX1Dc5UT1GMexWfIve/nec/A/BNdYPLP83fuoO+yHeaNGZz80W Po4+jXp7giue21jQBHCEZyB+HOmk9KJiq1FpHFjKu+g+sKtefLlOQe8fnmZrQYudcCtahRl0EQc l1lHwDHVdwExl4VjOhJxtxMhoPwmqWzqsQUOZHk1isi4gwTIXX5QdASAGQZai7jcLVnjiL+ySAG Lr8Q8v8i0PDOaLQ== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D On malfunctioning hardware, timeout error messages can appear thousands of times, creating unnecessary system pressure and log bloat. This patch makes two improvements: 1. Replace dev_err() with dev_err_ratelimited() to prevent log flooding when hardware errors persist 2. Remove the redundant timeout value parameter from the error message, as 'ret' is always zero in this error path These changes reduce logging overhead while maintaining necessary error reporting for debugging purposes. Signed-off-by: Breno Leitao --- drivers/spi/spi-tegra210-quad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index 2d320fbb8875f..64e1b2f8a0001 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -1118,8 +1118,8 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi, QSPI_DMA_TIMEOUT); if (WARN_ON_ONCE(ret == 0)) { - dev_err(tqspi->dev, "QSPI Transfer failed with timeout: %d\n", - ret); + dev_err_ratelimited(tqspi->dev, + "QSPI Transfer failed with timeout\n"); if (tqspi->is_curr_dma_xfer && (tqspi->cur_direction & DATA_DIR_TX)) dmaengine_terminate_all