Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp486533rwe; Wed, 19 Apr 2023 01:31:07 -0700 (PDT) X-Google-Smtp-Source: AKy350ZsqtUsNkCSkMid8y9tLxUWC3RrYuGFJ0w603wmdfoVOEVcMrfhQmD2FRgwCExPayNfLtpc X-Received: by 2002:a4a:3794:0:b0:546:3e27:9c87 with SMTP id r142-20020a4a3794000000b005463e279c87mr5510327oor.9.1681893067039; Wed, 19 Apr 2023 01:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681893067; cv=none; d=google.com; s=arc-20160816; b=gsJkXmtzhvEaos4kxbRnRmuGVFC0/2C7xgPU0xGESmKPwPO10RLU6Is94Ilo3+0wDY 14ewxCDKfzt1iAwuuy6MpLPqM5Dx+YYHiPXFf52TIbY0mEAA+U5qdG2e7ptr/clVfwgk UZcT+pT2xm+UpyvtaJGJD4+l4B3S4GbGlg27f/m/F//Z1IZfodj705w/Ribr7vsV3FOv 5bU5wuL9uvSjqwOnF6+OC2RhGg4m4ByF7OIu5NvnJA5vO5tRwWyZmUV1AWv4soWGL4LB tP6PiuIs4kiECy9kc9UU3RW90WxxjeKxCg+xErg1A2HTOKE3hD00lq2tPD86AYoCryzY excg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KhQTFUqxL/O6643fDSSoSsETDXYAv4dskz8SOtwED14=; b=BgftVKZaIojlBM+njDF0cNlbCAbUIKJhnVk07D08c28/arJrsGVGACFJY7lCTbIGc0 LELAxDFl77ZXVgyNJ5qMuDWVBKXboMwFuCikKZu7W7dXs6cTplWH5ptxuKMnBwZSOiNH OvE8PkVXctI6V2Flia97O2lVJPR1YOl9lRC4hemBleH9e0QwAnimm40LELC9UrGEYqf+ ScwoH/mDVUfBY4kxo0U2oq61HSCSvWqQIIzMIA3StXKSwfzdrqah8jgQruGBqNfz+NWF q47fnITqZTzErvT8BW795fNUOwoDpGaW0j3Iz8Y/WrPht9J68xb8j9pSyAeiYpFXU6aJ YMMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qm7L/uI3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e16-20020a4a91d0000000b0054601729fa7si7831654ooh.9.2023.04.19.01.30.54; Wed, 19 Apr 2023 01:31:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qm7L/uI3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232321AbjDSIOH (ORCPT + 99 others); Wed, 19 Apr 2023 04:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbjDSIOG (ORCPT ); Wed, 19 Apr 2023 04:14:06 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C72B173F for ; Wed, 19 Apr 2023 01:14:04 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id sz19so22415517ejc.2 for ; Wed, 19 Apr 2023 01:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681892043; x=1684484043; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KhQTFUqxL/O6643fDSSoSsETDXYAv4dskz8SOtwED14=; b=qm7L/uI38hNO7K25hIzjljA6TS3z+1GhbX80s9u0+gsCU9gjC1yqzZjjZ6IrI8TLj9 +6tPFvEx4YXyENHA4uSqT1ex09scO3tE9K7gX47/XUxyi2tO3oURSdFmWiU212hAcZWF 6fLNFS9h7QDXY2fGJQGgGEwKMN1ElDy2x/CWZSHP2CeNSUEacMJvBK+6zi18UZuHp2H0 mbC3cuSd7nrdW1hU7zfHf71wq4S9lEdLYYmow8f3R8yBeZKy/3fI2gAXNPDD7UDEBQFf 0Vsg/LPhP8sr3XAhZUraMq8Yek2ee2mF+QiOUxwI2pxvIm6O7psUBSof41456nfrkGul 7cEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681892043; x=1684484043; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KhQTFUqxL/O6643fDSSoSsETDXYAv4dskz8SOtwED14=; b=SROBNv9AIzuWmcHFKAoyDlF3b8DinZf+aM086vStF+Huuyl3Ma1Gx8Tqet/lH0raTq H/MnVLvRwl+nsqJKMGH2nrsqYdt0ymdoB9hz7qu7O3gRQ4v8iOZlXok9gGAWhx6DvX2s i1eJBcUvrcn8U8d91/Ao+bohQx/lJhJDcfLJNDM/cW0ZMSAdTZkwQctnNIlUph5UJpbC Ids69nZwfAkhHcuEtq5wEg3MT/IZ5bw6fvLoSi8xpuLEOeBjiDgA5HUj2SQqUDawZ2rS GE80T9JtYTJgs+fvs8LU26NW0pZNwyF7XBcPxsB82+guCK6ZJtODkYUUZqLT8RCRABBl ZWSg== X-Gm-Message-State: AAQBX9d6Rb8DM3GZcxe0DCo0UMN/fo6jpisYN+n/JYhQEYXdUIMccU0H DZ42Yrk1th60ANojmIGl7Nk1tA== X-Received: by 2002:a17:906:a408:b0:94f:236b:9e3a with SMTP id l8-20020a170906a40800b0094f236b9e3amr1516618ejz.3.1681892042992; Wed, 19 Apr 2023 01:14:02 -0700 (PDT) Received: from ?IPV6:2a02:810d:15c0:828:62f5:eb43:f726:5fee? ([2a02:810d:15c0:828:62f5:eb43:f726:5fee]) by smtp.gmail.com with ESMTPSA id ss2-20020a170907c00200b0094f4b7e2dc5sm5036143ejc.142.2023.04.19.01.14.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Apr 2023 01:14:02 -0700 (PDT) Message-ID: <36f37a18-0022-0368-bf7c-ebdd724b1558@linaro.org> Date: Wed, 19 Apr 2023 10:14:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2 2/4] spi: s3c64xx: add cpu_relax in polling loop Content-Language: en-US To: Jaewon Kim , Mark Brown , Andi Shyti , Alim Akhtar Cc: linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chanho Park References: <20230419060639.38853-1-jaewon02.kim@samsung.com> <20230419060639.38853-3-jaewon02.kim@samsung.com> From: Krzysztof Kozlowski In-Reply-To: <20230419060639.38853-3-jaewon02.kim@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/04/2023 08:06, Jaewon Kim wrote: > Adds cpu_relax() to prevent long busy-wait. How cpu_relax prevents long waiting? > There is busy-wait loop to check data transfer completion in polling mode. > > Signed-off-by: Jaewon Kim > --- > 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 273aa02322d9..886722fb40ea 100644 > --- a/drivers/spi/spi-s3c64xx.c > +++ b/drivers/spi/spi-s3c64xx.c > @@ -568,6 +568,7 @@ static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd, > > val = msecs_to_loops(ms); > do { > + cpu_relax(); Shouldn't this be just readl_poll_timeout()? Or the syntax would be too complicated? > status = readl(regs + S3C64XX_SPI_STATUS); > } while (RX_FIFO_LVL(status, sdd) < xfer->len && --val); > Best regards, Krzysztof