Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1202492pxk; Fri, 18 Sep 2020 06:35:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoSTriCI+OlfekV/Dx4m+RYOEZDX2YvkRsDTW7DS4hHcCstAySJLdb5cRWejzPatn/Hp+n X-Received: by 2002:aa7:c7da:: with SMTP id o26mr39455997eds.261.1600436125174; Fri, 18 Sep 2020 06:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600436125; cv=none; d=google.com; s=arc-20160816; b=lSItEbgRy67d6eAmvx2Wy0zxVePSkq9Ojqlnf7OQDNpuyZXcJRIZ0Xydf+EC11P5HZ i/urdb0a7sYJAuVZAmm1ujpX2rW5gwa5f5Rg6kzGhY7d7BP8k5R/NzAL6zHOpLA3J2Hi rzWOOAzYrdi2PVdv9yGcp6NClXSxs/aDwGg/LWc3bJp3WbCB0PLLi8n7L3e/IA17wc2U 3hnFXdIIpDGU89eBBt8Me/2FhagG6LROTVUQU7Vf+4EBq41LlSLan0m8vMk68+olKMw+ A8598cdLOP0I2PLctbeCeXzb0uszGJSbdmH9YMnkT2ywc45VquAFNcgAqXxpLpQmCWap zYcQ== 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=vHP6a/n1DUHQQL99sdaOgDDLN4fD6Mu08+md9guUmtw=; b=mrfK/ae3cGinuefZYgJQCaqdwjU4bez/0UQKZvxLPOpvskSohau0SJ2P6pbgc/zDBs T18u8yPaAis1BFTaWlQ5i2UzAJz6JQ6ZRdCyvV2CipcrL7cF8tlhPLQszPft2fKZoqLL FUSJkgKeUVNQkJ7BSUJ+tCYUInO6gisaF6vc/lZ8h7rnAxya0Ktj3hY8rhcc4WqcPRHQ VjgfJBiJkRygYoo4i3MMS1SNY56Kaf4m9KOSjVAwnIflErkNhTMQRXs2+SwG3mQLNcUE 39+X0dyYvmav3AgTAGSQvdBl9Pda7tUKB+838/rizQE4Z6+g8z7Yhoryr5DQ165O9KAu 8t6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JAHVq72p; 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 h1si2184290edn.39.2020.09.18.06.35.00; Fri, 18 Sep 2020 06:35:25 -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=JAHVq72p; 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 S1726301AbgIRNdp (ORCPT + 99 others); Fri, 18 Sep 2020 09:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgIRNdp (ORCPT ); Fri, 18 Sep 2020 09:33:45 -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 E9A7AC0613CE; Fri, 18 Sep 2020 06:33:44 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id x2so6247984ilm.0; Fri, 18 Sep 2020 06:33:44 -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=vHP6a/n1DUHQQL99sdaOgDDLN4fD6Mu08+md9guUmtw=; b=JAHVq72phYgsTz7+cCz2K98bwVoT3voMNXxrRvYlKds4E2Tcwdic91D/30M3J8KHaM HnnjFuvQEB0yHzEx/+o1bOBU06cjVuNivsU3zCGkB0dLwyvZ3GRpdMpC4QuS7aFMIC+x oOJ6l2yRi3794WPpPUrCpcyqcpH/rQ7qDu9tKB/ADiCp0eguh3XjoX3ebrqNcGRRpXGU v6bcRj2GhLbxfvcPcDMbzsHnOlu9IGabU5vGcCXLMOdXMEa40kyhFbI8+AQ+15pFNCUY QqaESEET6BaX3HH9e1DhRzYgb733Uj+aRTGX/Vf34sTEHtPKJqHhyb/fCvOiBiYgaU/c y20w== 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=vHP6a/n1DUHQQL99sdaOgDDLN4fD6Mu08+md9guUmtw=; b=EsybWkCMvtofHdIG/3MvMgV3eclVfMmeL/lk1Ep3OvHjWRv0pIjknH3vKVhszlNyKd DAm8//+hKrB5jsz++i0B0JUkjwn1BVgSEzGpEb31fCtho+3kvRj/TJ9QvZ42SjNomavg yTR4GPCUfqzffN9Qn+JjkUhbIcXH0ir9nElnum9RXgq1GtD/lsbwtpDMr24bnU6xPNjl ZWL5ROkqST2exxjBt19or3xRYEhJY22yNMQfnRyVLRAoT6q+1ua5+ocvftgWBOr+eRoe ujOYOYYYWDZ15qkGBqYnyFXTP27e0JP0A9cqGMkixaD/NJ63wT6X5PlEpR6W7gQWCXmu qBKA== X-Gm-Message-State: AOAM531rdf5O1wne4KrXG0r+iyDSrMSP3MCylQM6k/KqtYpd3HnVe91B kHdUpBhUsEbhsbl5AzaybTObTM6xotFXS/zgjLY= X-Received: by 2002:a92:c10c:: with SMTP id p12mr4688358ile.274.1600436024267; Fri, 18 Sep 2020 06:33:44 -0700 (PDT) MIME-Version: 1.0 References: <20200918083124.3921207-1-ikjn@chromium.org> <20200918162834.v2.2.I3de2918f09b817cc2ae6d324f1ece62779ecc7cf@changeid> In-Reply-To: From: Chuanhong Guo Date: Fri, 18 Sep 2020 21:33:33 +0800 Message-ID: Subject: Re: [PATCH v2 2/5] spi: spi-mtk-nor: fix mishandled logics in checking SPI memory operation 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! On Fri, Sep 18, 2020 at 9:09 PM Chuanhong Guo wrote: > On Fri, Sep 18, 2020 at 4:34 PM Ikjoon Jang wrote: > > [...] > > + switch (op->data.dir) { > > + case SPI_MEM_DATA_IN: > > + if (!mtk_nor_match_read(op)) > > + return -EINVAL; > > You are changing the code logic here. > mtk_nor_match_read checks if the operation can be executed > using controller PIO/DMA reading. Even if it's not supported, > we can still use PRG mode to execute the operation. > One example of such an operation is SPI NOR SFDP reading. > Your change breaks that which then breaks 1_2_2 and 1_4_4 > reading capability because spi-nor driver parses these op formats > from SFDP table. I just noticed that you already broke this in: spi: spi-mtk-nor: support standard spi properties Please also fix the same logic in mtk_nor_supports_op in your v3. -- Regards, Chuanhong Guo