Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2411916ybf; Mon, 2 Mar 2020 08:07:21 -0800 (PST) X-Google-Smtp-Source: APXvYqy87nm9GaUjW1buHyFpHHa9bHVcLvx850ECInuYXOoeCOW2k+wVqiS4ZVmZ0jG/BPhir8MN X-Received: by 2002:a9d:12af:: with SMTP id g44mr13640100otg.332.1583165241596; Mon, 02 Mar 2020 08:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583165241; cv=none; d=google.com; s=arc-20160816; b=JyFZd6af6pi6tBlvOYDl8bX69bHtN90hIdpgCHNSuEeXt+0VoDaJ0WvlCDTtJhwtrX CLfrN7n1bZO12EHc4SX6FOTjXU2yk6yIJsTrijSstdngZM5rpU9jR66WY44X69O6ZHfn atuncG4sPlG9+wvagXt8kkgyCnuZ7BlntD8jeAFMfyg+nIcdoIhVhC3krhMVaDAoc7oH K+F1YBOo6b0Rxx5dIqgBSOSjhFp3P1QhZg4HDNd1MKuOZGzlrXckFGtg5oRhR0AkdUbQ QxIG5nnvu5128It8PIOfmMhicydkHP/BIcUFJ0yfaNa3272fSaKe3kph+BRb8KeMTmoM /K5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:subject:cc:to:from :date; bh=Ik9KqzBqzQG64YL669izkQHJhh+k7axMGpdH92Gn/uM=; b=xkZv1eoFahoXavih8Kgnzj5xpEnwhF0PQfs4WDdAbHJ/e0woeor4N2brQ/xhDZr+xI uN5g8WVHsr7u6Kp/bh7rwxWIk5oZcPfnnANFNAc01IarD98YqL1KdK7U5+AHiOIZJEW2 OpRQD343fXns6u6J7Nn38db+1LYhdE6qbvdO+nY6f9+F1s6IgwYz8CSc0NkSEjNNs0Fc gDLjhvG6LOmyxmxWE3GIWD7JnqzGY75H6ElCFGsJ3CqwLxIgq0DRB3fnyyvSuJaJJYf7 0t8jEERHhQbvB0l1+dYgKj2nuCxiRJYa9tkGb+AvaanVK26Vx9XM/jweQLsLtsrdV+mA 51dg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 x7si4111364otp.114.2020.03.02.08.07.08; Mon, 02 Mar 2020 08:07:21 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727466AbgCBQFW (ORCPT + 99 others); Mon, 2 Mar 2020 11:05:22 -0500 Received: from foss.arm.com ([217.140.110.172]:34684 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727170AbgCBQFV (ORCPT ); Mon, 2 Mar 2020 11:05:21 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65F9D1045; Mon, 2 Mar 2020 08:05:21 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCD533F534; Mon, 2 Mar 2020 08:05:20 -0800 (PST) Date: Mon, 02 Mar 2020 16:05:19 +0000 From: Mark Brown To: Oleksandr Suvorov Cc: Igor Opaniuk , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Marcel Ziswiler , Mark Brown , Oleksandr Suvorov , Philippe Schenker Subject: Applied "spi: spidev: fix a debug message value" to the spi tree In-Reply-To: <20200229161841.89144-2-oleksandr.suvorov@toradex.com> Message-Id: X-Patchwork-Hint: ignore Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: spidev: fix a debug message value has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From ea70fb5b3e8b795730ab5716592bb573648434bb Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Sat, 29 Feb 2020 18:18:40 +0200 Subject: [PATCH] spi: spidev: fix a debug message value The debug message in spidev_message() can show wrong xfer speed. It happens if the initial (came from DT) and set with ioctl call spidev speeds are different (spidev->speed_hz != spi->max_speed_hz) and one sends a message with ioctl call and the field of speed is uninitialized (u_tmp->speed_hz == 0). In this case the kernel shows the spi->max_speed_hz value instead of correct spidev->speed_hz. ... set the max speed with an ioctl call: [ 1227.702714] spidev spi0.0: setup mode 0, 32 bits/w, 20000000 Hz max --> 0 (real speed sets to 20000000Hz) send a message with an ioctl call: [ 1227.731801] spidev spi0.0: xfer len 4096 tx 32bits 0 usec 10000000Hz (debug message shows 10000000Hz that is the original max speed of this spidev came from DT) ... Fix the data source for the debug message. Signed-off-by: Oleksandr Suvorov Link: https://lore.kernel.org/r/20200229161841.89144-2-oleksandr.suvorov@toradex.com Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 2ab6e782f14c..c97e853dbf5c 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -275,14 +275,14 @@ static int spidev_message(struct spidev_data *spidev, #ifdef VERBOSE dev_dbg(&spidev->spi->dev, " xfer len %u %s%s%s%dbits %u usec %u usec %uHz\n", - u_tmp->len, - u_tmp->rx_buf ? "rx " : "", - u_tmp->tx_buf ? "tx " : "", - u_tmp->cs_change ? "cs " : "", - u_tmp->bits_per_word ? : spidev->spi->bits_per_word, - u_tmp->delay_usecs, - u_tmp->word_delay_usecs, - u_tmp->speed_hz ? : spidev->spi->max_speed_hz); + k_tmp->len, + k_tmp->rx_buf ? "rx " : "", + k_tmp->tx_buf ? "tx " : "", + k_tmp->cs_change ? "cs " : "", + k_tmp->bits_per_word ? : spidev->spi->bits_per_word, + k_tmp->delay.value, + k_tmp->word_delay.value, + k_tmp->speed_hz ? : spidev->spi->max_speed_hz); #endif spi_message_add_tail(k_tmp, &msg); } -- 2.20.1