Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp948834pxa; Sat, 22 Aug 2020 05:46:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoKAQLYhm+iK9L48weIiCEr9NEDdiHG/EhaVEAp9jonZjf0Ry/aiJg4vw5Uv6acpT6xVuu X-Received: by 2002:aa7:c357:: with SMTP id j23mr7228143edr.228.1598100390374; Sat, 22 Aug 2020 05:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598100390; cv=none; d=google.com; s=arc-20160816; b=lbmdxBCO9olatJMuNWo/QvUQB6LLtfN67pYqGYu17aHpxlW3KxehGTHgzNmwZo9AlC knuaqWW2o0i0ClwAW+qLVbedtyvzLkXy1CmF6evPNcljhJRCsC0bmusV8y8m+IjZsMc4 9doDHGCSSbsJbs4u+EJkqK2PzHIvPl57ST3l0fpY7a/yxl9e5XKgJjz3igG9RlMLC5jY rvfrDEZJQOlumWQnTEiaViRL3hxVqw/1+b0ZAEVkOTaQgSkUXdAibmmt4IH4KpA3vZ/J FFkXhQ0ZdsMNGKBhn3wWBuGUsIThGn/jcdTTWDC93fSu1MeOKkbFcJhuQ9TEmyObjfo2 yXlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=VmbiEvrIST+ZM1V55ee74+8f9zN5UHn+J0v4taJ5I1o=; b=nvKzNv1nqJPcfRPRczEEjdDmLVxfLE2yXYluIfKV4Sptc+KYJNnheO/Anw9hdf9PLX lClvlNJnR53uDDoRNDPsdXNBtKD2ZMJ31VSSXFvc91eleXDS42ObCjoOFbmXOrT3z6FW ntQZs//8e5MlKgIKWeDzc3eZXtrfHSn5hmDS01odpzNWQNNz64Rx8OikGvpmuvwkYN4q Xd4EqGSeU+omr78L3m/KAQxX0EWjHJfqPaVzk1WjQ7K43k5RQa9D2DN8P0yoGfT6cxW6 NW+5eRrqsJZbdTSIgdcuQshcX7Je58ckHxgxSZIzzacVZ71Vaqih6iHaatKsNEU4wksA 5+/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s16si3287622ejm.36.2020.08.22.05.46.06; Sat, 22 Aug 2020 05:46:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728022AbgHVMnb convert rfc822-to-8bit (ORCPT + 99 others); Sat, 22 Aug 2020 08:43:31 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46249 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbgHVMna (ORCPT ); Sat, 22 Aug 2020 08:43:30 -0400 Received: by mail-wr1-f68.google.com with SMTP id r15so4284381wrp.13; Sat, 22 Aug 2020 05:43:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=WBNSRxvyAb/qQZAkHTrrLM5INeMErpw4ZMaPgiAVFYc=; b=NPGRsV3lU9KQ/PJOVDEAWuy9khYOyotMACJOnIMgyIGDcqFHtU3xwev68NCn61pLV4 KkOw/+kpzX3i6DDmpfZPXTkCgazlYZmOPCT9kzdGis6E82u8IGg2qDrPSV71W9uqD4Tm BudUSdiy2eSkuLYKJb9Jkrd96H+q//e95A/4oaM6gBAob5D53XV/gSjz7mQvgaRP/t2F J+4nh+a2dqvX+03WpoNlluqYPc5IaQ01v3rPUKLzUVr+GwYVbfie6fkf9m5q8Gg+1IL2 4JUJZXM1LY80m3I0gSlHlAGPTYO3E4LUMA5ReELM3phWeHhVhVc4qQ0M7SwxVgjG3x4N TCrw== X-Gm-Message-State: AOAM530mZoGY5tVy84yjNtQdoubpRTOM7gB7/PKxLoBQG/XJBWou08dC nIkq2uXwqm2eZsRVjVoOUS8= X-Received: by 2002:adf:c64d:: with SMTP id u13mr7206988wrg.114.1598100208370; Sat, 22 Aug 2020 05:43:28 -0700 (PDT) Received: from kozik-lap ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id d14sm11074673wre.44.2020.08.22.05.43.27 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Aug 2020 05:43:27 -0700 (PDT) Date: Sat, 22 Aug 2020 14:43:25 +0200 From: Krzysztof Kozlowski To: =?utf-8?Q?=C5=81ukasz?= Stelmach Cc: Kukjin Kim , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, Tomasz Figa Subject: Re: [PATCH v2 7/9] spi: spi-s3c64xx: Ensure cur_speed holds actual clock value Message-ID: <20200822124325.GF20423@kozik-lap> References: <20200821161401.11307-1-l.stelmach@samsung.com> <20200821161401.11307-8-l.stelmach@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20200821161401.11307-8-l.stelmach@samsung.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 06:13:59PM +0200, Łukasz Stelmach wrote: > cur_speed is used to calculate transfer timeout and needs to be > set to the actual value of (half) the clock speed for precise > calculations. If you need this only for timeout calculation just divide it in s3c64xx_wait_for_dma(). Otherwise why only if (cmu) case is updated? You are also affecting here not only timeout but s3c64xx_enable_datapath() which is not mentioned in commit log. In other words, this looks wrong. Best regards, Krzysztof > > Cc: Tomasz Figa > Signed-off-by: Łukasz Stelmach > --- > drivers/spi/spi-s3c64xx.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c > index 02de734b8ab1..89c162efe355 100644 > --- a/drivers/spi/spi-s3c64xx.c > +++ b/drivers/spi/spi-s3c64xx.c > @@ -626,6 +626,7 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) > ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); > if (ret) > return ret; > + sdd->cur_speed = clk_get_rate(sdd->src_clk) / 2; > } else { > /* Configure Clock */ > val = readl(regs + S3C64XX_SPI_CLK_CFG); > -- > 2.26.2 >