From patchwork Wed May 8 20:51:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13659159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D87CAC04FFE for ; Wed, 8 May 2024 20:53:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE2A410E059; Wed, 8 May 2024 20:53:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="liuRwp+U"; dkim-atps=neutral Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id E573610FB9D for ; Wed, 8 May 2024 20:53:21 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2b4a7671abaso193944a91.0 for ; Wed, 08 May 2024 13:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715201600; x=1715806400; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9F2O1ySgZCzUPwkKOIVF7CvO8xaM7qBPiKzCHpLk+3I=; b=liuRwp+UUvReZCz4LowSlXoRIuei/7WvYIaVQbkOYeMfG9YZNIoMu8gZkv0KAYYbFI iW3laZ78uJyaRKWP5VwLFFgqnE5dyjNDkfRvtPFk8/sWpz1LBgJRrh+VTc1GErkCzb3k 9EjHaoU1iZoR3FFVHE0yLqy6/3YZbs4WONJd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715201600; x=1715806400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9F2O1ySgZCzUPwkKOIVF7CvO8xaM7qBPiKzCHpLk+3I=; b=VqtoZi5ozPMgrusFYRHga5LGK/BIhZLb7OGV5HtKCSzDBhqs5Hv36uQ3PXk2E5UrZl kCVK7XtSK1LXKFadZcA+1R82UgRUcFxzopxOLr2pU2rEwHFCBeXVhbo2YQf9D5+yJ9yr Z9l42fC5X/HFjBLH7arMIqdek7jBC9u414VrdFjATf9QhSR5OQnk44I+a9jqbWQIpcdB oaBu35zAkJUSVU1v3WW47NAeYQtDQGmDttc5wILvTr8lPYhPllBeHxJYNBBmcponmszo eHa0Hj3O2V122s7YPNoZdbQVFYoLRi8KHiRrGhRj5C8AsxwkGhogH8Vqtjgdt/Nglq96 J5Tg== X-Gm-Message-State: AOJu0Yxk16XNC0b8Jnlru3edPOdiTJXiyPocJ7Mv9X4OuSVrsfEaSlvG kn94iSli6KfEMYhNUNSi1WzWQtsYBcFwP99KxWYL4Hr4hUlRETHYQEm9u+3in5IXuJ4nSEeKgwE = X-Google-Smtp-Source: AGHT+IHcvmXqDVJ/bC9j+Qc7/hlGGXc3bJX7RxOprm6cXhjNiCfIYQ8UUIU69gAVZPyxLM1azYo0gw== X-Received: by 2002:a17:90b:212:b0:2b3:28be:df00 with SMTP id 98e67ed59e1d1-2b61649c518mr3600358a91.4.1715201600424; Wed, 08 May 2024 13:53:20 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:40f4:feca:59e0:d3ca]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2b67126ad51sm6887a91.25.2024.05.08.13.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 13:53:19 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org Cc: lvzhaoxiong@huaqin.corp-partner.google.com, Jani Nikula , Hsin-Yi Wang , Linus Walleij , Javier Martinez Canillas , Neil Armstrong , Cong Yang , Sam Ravnborg , Dmitry Baryshkov , Joel Selvaraj , Brian Norris , Douglas Anderson , Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [PATCH v4 3/9] drm/mipi-dsi: mipi_dsi_*_write functions don't need to ratelimit prints Date: Wed, 8 May 2024 13:51:45 -0700 Message-ID: <20240508135148.v4.3.I9982cd5d8014de7a4513f5619f66f88da49ce4ec@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240508205222.2251854-1-dianders@chromium.org> References: <20240508205222.2251854-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We really don't expect these errors to be printed over and over again. When a driver hits the error it should bail out. Just use a normal error print. This gives a nice space savings for users of these functions: $ scripts/bloat-o-meter \ .../before/panel-novatek-nt36672e.ko \ .../after/panel-novatek-nt36672e.ko add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-16760 (-16760) Function old new delta nt36672e_1080x2408_60hz_init 17080 10640 -6440 nt36672e_1080x2408_60hz_init._rs 10320 - -10320 Total: Before=31815, After=15055, chg -52.68% Reviewed-by: Neil Armstrong Reviewed-by: Linus Walleij Signed-off-by: Douglas Anderson --- (no changes since v3) Changes in v3: - ("mipi_dsi_*_write functions don't need to ratelimit...") moved earlier. Changes in v2: - New include/drm/drm_mipi_dsi.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index e0f56564bf97..67967be48dbd 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -314,17 +314,16 @@ int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi, * @dsi: DSI peripheral device * @seq: buffer containing the payload */ -#define mipi_dsi_generic_write_seq(dsi, seq...) \ - do { \ - static const u8 d[] = { seq }; \ - struct device *dev = &dsi->dev; \ - ssize_t ret; \ - ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \ - if (ret < 0) { \ - dev_err_ratelimited(dev, "transmit data failed: %zd\n", \ - ret); \ - return ret; \ - } \ +#define mipi_dsi_generic_write_seq(dsi, seq...) \ + do { \ + static const u8 d[] = { seq }; \ + struct device *dev = &dsi->dev; \ + ssize_t ret; \ + ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \ + if (ret < 0) { \ + dev_err(dev, "transmit data failed: %zd\n", ret); \ + return ret; \ + } \ } while (0) /** @@ -340,8 +339,7 @@ int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi, ssize_t ret; \ ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d)); \ if (ret < 0) { \ - dev_err_ratelimited( \ - dev, "sending command %#02x failed: %zd\n", \ + dev_err(dev, "sending command %#02x failed: %zd\n", \ cmd, ret); \ return ret; \ } \