Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp915929pxk; Fri, 25 Sep 2020 00:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzQsWljxn+yDgau2QJsYBsG3EwkOqrhbxU0YYLfYlxzMoxiOBsRUqbKJq+KSLjP5Gha1wA X-Received: by 2002:aa7:dcd9:: with SMTP id w25mr2551237edu.280.1601020504192; Fri, 25 Sep 2020 00:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601020504; cv=none; d=google.com; s=arc-20160816; b=usJmaqbCUMKzt3a4LJuHWz8edu0C/gWD3A7oftTlu/MOQd7unUakUZsM7Y8sl6XKQH qtchbE05D6AgDL0rGfekjwF7uc0P6Hgp4tpIv2AXBP45LkkFP2vvNV8dGBGRuHqi6Ddf hLuKK97tPRqTKirtIfUXPH8GN+buGiLRjRP2RZfsMkYzY1KvXQkBv2QbhodobVJF6cCP QegknaiedoCvMJlIJtaLeTNkvnNfjo8o1lWK5nvcyk0joG2g/txS88XZEHP0ES4rGBvz hLQXsqJH7baZGaQiSjRlG5F0HTnckINTGPfIwroWNytMezfQnIBINRf48mcbEX2v9sru Hyeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c25OWVlYr3r4Zg73+hgQ+FOM6zKBeGJ84JdXLPHXx8I=; b=u+R88Ykk3t0OJFgH276p/WWnO7VeF+cQTvKOMe1QOuZFSPP2UuDGKVPK7EDJTXk+R0 SIjv5tHWpJyQGwJJkjEgzhTZt+kU25tcqMbMgGCoYzcSWAdL9UFNzH5RxPyV+yCudHBb 0W5ljmHDPk7MPXbn4xg/pjQQ/SXyIIYGBxViswjGbBY2Mvgizr/FvF9nW3Ltak0kxCFq WedsycItk2567dMZvHPEXZVMV6a70zIzME3IxOk0QutVj4RXPwwPwj4TuJpg60uoQNh3 dW9XLl154I3+zakhxwF+OQ2d+mpk2Z+LMwA4/JdMztZBuDlE6oQdtVLg1o/pQ7uO3fC+ un+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=El5vlfyF; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si1287307edq.422.2020.09.25.00.54.41; Fri, 25 Sep 2020 00:55:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=El5vlfyF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbgIYHxO (ORCPT + 99 others); Fri, 25 Sep 2020 03:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727063AbgIYHxN (ORCPT ); Fri, 25 Sep 2020 03:53:13 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC315C0613CE; Fri, 25 Sep 2020 00:53:13 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id h2so1459170ilo.12; Fri, 25 Sep 2020 00:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c25OWVlYr3r4Zg73+hgQ+FOM6zKBeGJ84JdXLPHXx8I=; b=El5vlfyFAp4rhbHtluPcO/SDAUVfZbEz0brwMeEUflGfzx/VqBAZF9s/RnrI2wdMB+ IDMVVpmjwHdDq4hsur3vvdQZc0uyMZyvFh5tOWqznd6OtXz3gY++1691QN8iikJGcKz7 epqpJNxrJKQ3h1sQXG9loYVOiG2kx3ng4H9oG5Nga3lXK7xbtIgJy86F4AgwHNMvLlt9 PRV5QnZKF9wbDJTONxKE/zxHd4XNL6oT5ffF4sSmd36kuC9SEo++bJ8l0aU36ahgQe38 +RlHD/uhUOZi7wMrZGfvCxqzv+ECiG+eOXxaCFA/g39wIJfqiNLg4eHTC8fFwkm2fs6E eU3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c25OWVlYr3r4Zg73+hgQ+FOM6zKBeGJ84JdXLPHXx8I=; b=dQlXAbndpJHhQq381XhEqevcNfGW2CMPQDtN1GnPPJGePuu8TCXVvlhl+Xe5rBWvDe AwBu0wJ0WH7jYtjXi8AkR0LowhcaH+my2i0MIAn4SGwb1MDvigXZYh4rFcQh1S9B5x50 pI4ATAoWGUdloRMITpZf3D4SDZmvFZGm3CFVOci5MX178RUJx5zRaUmgomlHDLqKcmLb koFVAKlQLpnxHVWbtAatB/VHeEtZoEwCuDNdnG2Jtf1jiF4+zuh+AKuKCdrx6imu2BKm G7pK9GRL80rlLsit50r6mrjXAJ3Txi0Dmjtf4W5Tz3wY6sNbva/RcdcsSP941hjFB1WU 0DGw== X-Gm-Message-State: AOAM530L2UgLBI7E+2xyYm1ipdStDvPZRYHrv0TylmFU8LO1rHtZgKk9 iszQtVgpQKVSJb1scuvFVFa6GoIU78yVntsY6ICXvHZdkv0= X-Received: by 2002:a92:c10c:: with SMTP id p12mr2108245ile.274.1601020393169; Fri, 25 Sep 2020 00:53:13 -0700 (PDT) MIME-Version: 1.0 References: <20200925065418.1077472-1-ikjn@chromium.org> <20200925145255.v3.3.I7a3fc5678a81654574e8852d920db94bcc4d3eb8@changeid> In-Reply-To: <20200925145255.v3.3.I7a3fc5678a81654574e8852d920db94bcc4d3eb8@changeid> From: Chuanhong Guo Date: Fri, 25 Sep 2020 15:53:02 +0800 Message-ID: Subject: Re: [PATCH v3 3/6] spi: spi-mtk-nor: support 7 bytes transfer of generic spi To: Ikjoon Jang Cc: Rob Herring , Mark Brown , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org, Matthias Brugger , "moderated list:ARM/Mediatek SoC support" , open list , "moderated list:ARM/Mediatek SoC support" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI! One more comment: On Fri, Sep 25, 2020 at 2:55 PM Ikjoon Jang wrote: > +static bool mtk_nor_check_prg(const struct spi_mem_op *op) > +{ > + size_t len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; > + > + if (len > MTK_NOR_PRG_MAX_SIZE) > + return false; > + > + if (!op->data.nbytes) > + return true; > + > + if (op->data.dir == SPI_MEM_DATA_OUT) > + return ((len + op->data.nbytes) <= MTK_NOR_PRG_MAX_SIZE); > + else if (op->data.dir == SPI_MEM_DATA_IN) > + return ((len + op->data.nbytes) <= MTK_NOR_PRG_MAX_CYCLES); You need to consider the existence of adjust_op_size in supports_op as well. This mtk_nor_check_prg still rejects SFDP reading command from spi-nor driver altogether. -- Regards, Chuanhong Guo