Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3947561ybg; Mon, 28 Oct 2019 23:12:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1Uv/CqVFjdWe5rjg2JaT1nUJWilJHyfXp+OJyUwz01aQBLZCDBBbc9SiQ9XnpqKuxvcgh X-Received: by 2002:a17:906:743:: with SMTP id z3mr1519163ejb.142.1572329571870; Mon, 28 Oct 2019 23:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572329571; cv=none; d=google.com; s=arc-20160816; b=Tq0OLTjM1G4N55/bu68yJL8VO/zQap80aLvXm0qHtWvp61RcHtiRMapjU2TlVLv87D WQUNoB7hcyRppnfskN+mECEfDn62htEeNH+Wl+4lT93ad4unnJ+AfXOER/yQjbLM+BFk Kt+pICCObmBzGb+mYratJUDh8ytTCfMOwekAyona9PBf1BU8zebSILJXvY8IE9PaN3JS +O/BrvXoBse/p9eWrw/YwsrYJb0z5k7+I3NR6/1qsU+ZHuBFYP98i+3d0ns2xIhp2pcF QTW/kwk+7gRNiJq0shQXtpxknV9n0jFNutRMF1lWELwul965G4Db8wLPPSXeBIwciA6L JfFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=YXnHpr/6fd6euFiIj/AKu1cZlMQok8QQ7LjKOvqJvGU=; b=ZmA3ZPsJoe6z1fiaa5oKGZijLPgjD6j9su/Eph1POoJnXmJNflU0OJ6RRzAfvqNqMI P1DR0O2LTICZLhw8eRKb5tbNfmnai/w1UCdyPUZi0NldHY6pWdXhzmlDrYlm0WQukAxT li+soH3LOsH9jt7vdBZiqAKQcH1/+4FV/lrkpRKWqC1hsrDGii9nS++iNLRYjtOir85B N111PgmskaDVrj5G1PzxkEGQ9JABtFoRlWveza/rPV3OUp8Ri6FC+ss4aPTU+eKspPep pVXIXOR0ukiYYC+Bep8rVHx2xBpbGX9TDD2BVShblYZCwB+sicO0Vzv3jaEdL7VFNuuF Qtag== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si7570441ejc.428.2019.10.28.23.12.27; Mon, 28 Oct 2019 23:12:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403814AbfJ1Qlg convert rfc822-to-8bit (ORCPT + 99 others); Mon, 28 Oct 2019 12:41:36 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40973 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733000AbfJ1Qlg (ORCPT ); Mon, 28 Oct 2019 12:41:36 -0400 X-Originating-IP: 91.217.168.176 Received: from xps13 (unknown [91.217.168.176]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id EC341FF80E; Mon, 28 Oct 2019 16:41:31 +0000 (UTC) Date: Mon, 28 Oct 2019 17:41:31 +0100 From: Miquel Raynal To: Chuanhong Guo Cc: linux-mtd@lists.infradead.org, Jeff Kletsky , Richard Weinberger , David Woodhouse , Brian Norris , Vignesh Raghavendra , Frieder Schrempf , Boris Brezillon , Stefan Roese , linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] mtd: spinand: fix detection of GD5FxGQ4xA flash Message-ID: <20191028174131.65c3d580@xps13> In-Reply-To: <20191016013845.23508-1-gch981213@gmail.com> References: <20191016013845.23508-1-gch981213@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Chuanhong Guo wrote on Wed, 16 Oct 2019 09:38:24 +0800: > GD5FxGQ4xA didn't follow the SPI spec to keep MISO low while slave is > reading, and instead MISO is kept high. As a result, the first byte > of id becomes 0xFF. > Since the first byte isn't supposed to be checked at all, this patch > just removed that check. > > While at it, redo the comment above to better explain what's happening. > > Fixes: cfd93d7c908e ("mtd: spinand: Add support for GigaDevice GD5F1GQ4UFxxG") > Signed-off-by: Chuanhong Guo > CC: Jeff Kletsky > --- > RFC: > I doubt whether this patch is a proper fix for the underlying problem: > The actual problem is that we have two different implementation of read id > command: One replies immediately after master sending 0x9f and the other > need to send 0x9f and an offset byte (found in winbond and early GD flashes.) > Current code only works if SPI master is properly implemented (i.e. keep MOSI > low while reading.) I am not entirely against the fix, but this is a SPI host controller issue, right? Can you try to fix the controller driver instead? Thanks, Miquèl