Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1380046imm; Fri, 28 Sep 2018 17:45:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV631TJDuewRNfiDYTBDaqHlIFbHiOQUd3W48fNffuK4MIf3Wxk+NfKEFAuxL+kX+52AmIcAx X-Received: by 2002:a63:7d2:: with SMTP id 201-v6mr925683pgh.129.1538181956493; Fri, 28 Sep 2018 17:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538181956; cv=none; d=google.com; s=arc-20160816; b=zER/RVdcfQb8B7BuMlsECiw4aMFqLLrFqZMBoSd/hVf5fle0doZDvxIkWisgRJnCMx 97WI7Qsfrek3aUZHb/VLK+DvZUjmn4Jc2PG/nXjvY0QVdv5eKgE5NE4eqIcFAwC1VVe2 jGPART8JvDhuN1b85+AwZk65S0qlmMq/Pcj0sHPx7FjMoMe0pJfhXLbUEoTOziHzEIjP ugN2YLHZJqTWYlZI7FC3KIBdKdiMKhZs+b63g80n/gh4/MnRsW/SyjUbNjwb0BhuiZ1a C1QT4SZ/o0IdsLxGxFK5hhiYmwD7kxlhLks/m4OVItsX1C5Aw+LGknJ/Zr8a2D+JmUr/ o6YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature; bh=lu3W8hNOf5vBJ0OSfSyTf2R0XqT5DQqqn4zskv6xfk8=; b=irGCSDolMtnaCG1Y5RuomnfnstC2hW2+NuST7fqgRLyjmEaxtQSu6Af05kOrBcruUe 28LPCswZZADOnJSAVs+3keKyXHGa+kSPYctrpX6xDOsp2k9Wz0QC7yTafVt3+ycdii5r 8vBhnicSWad2xMzOB/WItliDqIbQlQ9lmvGqNwroPEt0YyRu7KkAhvh5IC/XdWwFPmRX nhs2oic/spcnrUmIyk2DAIVc7aBsqc56re0EDsKc0JDWdNUN6hYYDlmUsL07t+IG3kPj lJY5y2TJndL70zyLUddWWHKVJpstqvBDcINQwqViAvEpLs4LU+30HipngKDOYvJbXf7o J5nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UIErrrQ9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62-v6si6205586plf.164.2018.09.28.17.45.42; Fri, 28 Sep 2018 17:45:56 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b=UIErrrQ9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727429AbeI2HLo (ORCPT + 99 others); Sat, 29 Sep 2018 03:11:44 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43591 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeI2HLo (ORCPT ); Sat, 29 Sep 2018 03:11:44 -0400 Received: by mail-pg1-f195.google.com with SMTP id q19-v6so5551291pgn.10 for ; Fri, 28 Sep 2018 17:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:to:from:in-reply-to:cc :references:message-id:user-agent:subject:date; bh=lu3W8hNOf5vBJ0OSfSyTf2R0XqT5DQqqn4zskv6xfk8=; b=UIErrrQ9QQKYG+srjvfby5N0HLR3DEoCJvQEVChacsG7c89yRZ7w1DzUAiqGZ2BU18 BKhOvsiCrx2iTWTx+KOHAQZXk+tGv8SOJsE6PeFFBawe0sKqjD5mbvWl5BzFR9gKfJOP b0JTfe6/kNDJ3mIFLWdFVKr8QyorIB1ICGyaY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:to:from :in-reply-to:cc:references:message-id:user-agent:subject:date; bh=lu3W8hNOf5vBJ0OSfSyTf2R0XqT5DQqqn4zskv6xfk8=; b=prrVm2yCKS+YrUsIVFUc2N+M0WoG0mqFOnruVERrMOas7kArNmpoY/IjVglajs2xsY eE2mn4llqNGsHxEUssopNwpIIyXYPC7/wJ7Iz1AZUzKT3SLtG5rnwU8WqP6DaGeQdG8q Ekxc58WhKTfvpBGDHZoS+Il+2vTbTHxs5qm7DiU6lTVNLdJfBKQoCyAIVLyc8UKgpmzC ccweqpGzmJjRsl6CWFJuxsnEWfoOVvGGQMbHnMge2E2gkNhpMwfnABXx2CGLNFrBya5c CQpGXobc9axBZ/TKpq+LL2cECh0cjxRtq87J5Tan/LmXjVrqgREDzrIjhXJfdBGDZ0h6 4hGw== X-Gm-Message-State: ABuFfohI6xksK8lE7BLUKwqDepD0/vzV0PZNDlcvB8SkHwFo+lt/fK01 dxVKZLVUmBPz/bLEmIfoex7pX379BNc= X-Received: by 2002:a63:cd45:: with SMTP id a5-v6mr926048pgj.43.1538181926984; Fri, 28 Sep 2018 17:45:26 -0700 (PDT) Received: from localhost ([2620:15c:202:201:7e28:b9f3:6afc:5326]) by smtp.gmail.com with ESMTPSA id p3-v6sm10407876pfg.175.2018.09.28.17.45.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Sep 2018 17:45:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Ryan Case From: Stephen Boyd In-Reply-To: Cc: Mark Brown , Randy Dunlap , linux-arm-msm@vger.kernel.org, Doug Anderson , Trent Piepho , Boris Brezillon , Girish Mahadevan , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org References: <20180926205204.184898-1-ryandcase@chromium.org> <20180926205204.184898-2-ryandcase@chromium.org> <153803059441.119890.891880266219521584@swboyd.mtv.corp.google.com> Message-ID: <153818192522.119890.9441387074333006354@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v3 2/2] spi: Introduce new driver for Qualcomm QuadSPI controller Date: Fri, 28 Sep 2018 17:45:25 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Ryan Case (2018-09-28 11:19:51) > On Wed, Sep 26, 2018 at 11:43 PM Stephen Boyd wrote: > > Quoting Ryan Case (2018-09-26 13:52:04) > > > From: Girish Mahadevan > > > +#include > > > + > > > +#define AHB_MIN_HZ 9600000UL > > > > Is this used? > = > Nope. Do you want all currently unused defines removed or specifically th= is > one? I saw precedent in other drivers for defining registers/flags/values= of > supported but unused functionality so I left these (big endian, DDR, ...). I guess it's fine but I don't know if it will ever be used so remove it? I'd leave the others if they help someone know what register bits exist. That's usually how I handle it. > = > = > > > + speed_hz =3D slv->max_speed_hz; > > > + if (xfer->speed_hz) > > > + speed_hz =3D xfer->speed_hz; > > > + > > > + ret =3D clk_set_rate(ctrl->clks[QSPI_CLK_CORE].clk, speed_hz = * 4); > > > > Why 4? Is that related to the number of wires? > = > In normal operation the core clock should be running at 4x the rate of the > transfer clock regardless of number of wires used. Ok. Maybe add a comment so we understand that. > = > > > + put_unaligned(rd_fifo, word_buf++); > > > + } > > > + ctrl->xfer.rx_buf =3D word_buf; > > > + } > > > + > > > + if (bytes_to_read) { > > > + byte_buf =3D ctrl->xfer.rx_buf; > > > > Does this need to move forward by words_to_read bytes so that the left > > over bytes are tacked onto the end? Or this should be an else if > > statement? > = > When the words block completes it updates the rx_buf location so it is al= ready > at the correct offset for bytes. > = Ok I see. Subtle!