From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8462C4338F for ; Thu, 29 Jul 2021 12:04:49 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4241660E76 for ; Thu, 29 Jul 2021 12:04:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4241660E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 722BC82E7A; Thu, 29 Jul 2021 14:04:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SWuWJPgl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C288F82E8D; Thu, 29 Jul 2021 14:04:45 +0200 (CEST) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9E7BB82E05 for ; Thu, 29 Jul 2021 14:04:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-yb1-xb34.google.com with SMTP id w17so9773408ybl.11 for ; Thu, 29 Jul 2021 05:04:42 -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=EuwRJgpn8HRvlP+r7N3UpLxkhBcWWx809DYPn1t8mzg=; b=SWuWJPgl31eqRpfiOumfxPHYuGwhjKdw+OzZN0WnWzFtj5QYe6xifADQG47Dn+qKz5 KRkc2UreXIfAOqhLYMLfoCd5Biaz+SXQ41mrLYFX41wcugFdoMiGBh4AlB0IULgJM4lY Z53U2qz98eKw9LmudnnHG0HlF1bALZLp+57fW/V9ofoYcKuDWpxdqO2c2DgSAr/1vsBc MQJm+OQP1GQshXXDaahsFjJyS3Pu29vLFKRDlVsmvxnc9AwgDohbOOObBPzzScwcScPm J7LuGV0kEYGQ+VGm2U8LfnOJDTM+QlMp02Wr8+pyhq+fQJ+XESqhQILwZ+ZcrS1vbKgn 4how== 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=EuwRJgpn8HRvlP+r7N3UpLxkhBcWWx809DYPn1t8mzg=; b=Eyig7aRGzFIfWuri3Z/Kyke9fEe4xzivKIStpxljtiYZr3ZvDz4qFJS57F1eBMokp9 HlPUwRLGA1Xo41dpKfMagk89a3KqMjSDuu0XrcG+aiYyaNkHhHTm2idKeobFh4x4JpTL DaIZf8XSZsINZ6zkEnWaB9RN9NaalWiGhaLCTXg46JlRRidr0yfNsJb6LTT4mhDVWLYI bN9zHRc0rCnpVYSRuW9uNaObRNar7OI7ASoPnwjGeU0JgZKgDSaDYFmBLFPNODDbK2JR FQBByTa5HYk+e/qb87Mie0yJlayYF2gtUpSm7wdpBRJQ4Gb+wzWyIVrXfrgTY1vpaEUV v9mg== X-Gm-Message-State: AOAM533rRWArfiyG2ftiDp1jyrIPZd9pVEJfPbXFsIMBP+s0ORi0gjxF yw/B+9WIY3WEv+Eie+l+bswNUFR+nKI2ut0qANQ= X-Google-Smtp-Source: ABdhPJyYCZV8v/8KnAeZLoIOjAcf3XG3k0uXgaZrA/xTke/N1OB67IeBoAo0pu1hphBd7sHjEfh9lb7zS7sBF6jJ7cU= X-Received: by 2002:a25:cc0c:: with SMTP id l12mr6334860ybf.152.1627560281435; Thu, 29 Jul 2021 05:04:41 -0700 (PDT) MIME-Version: 1.0 References: <20210728102857.526170-1-bmeng.cn@gmail.com> In-Reply-To: From: Bin Meng Date: Thu, 29 Jul 2021 20:04:29 +0800 Message-ID: Subject: Re: [PATCH 1/2] spi: ich: Limit slave->max_read_size To: Simon Glass Cc: U-Boot Mailing List , Jagan Teki Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, Jul 29, 2021 at 9:32 AM Simon Glass wrote: > > On Wed, 28 Jul 2021 at 04:29, Bin Meng wrote: > > > > Since commit 43c145b8b3ee ("spi: ich: Correct max-size bug in ich_spi_adjust_size()") > > (in v2020.04-rc1), SPI flash read no longer works with ICH SPI controller > > in software sequencer mode. > > > > ICH controller can only transfer a small number of bytes at once. > > Before commit 43c145b8b3ee, the logic happens to make sure data.nbytes > > is limited to slave->max_write_size but after commit 43c145b8b3ee > > data.nbytes is no longer limited because slave->max_read_size is not > > initialized with a valid number. > > > > Fixes: 43c145b8b3ee ("spi: ich: Correct max-size bug in ich_spi_adjust_size()") > > Signed-off-by: Bin Meng > > --- > > > > drivers/spi/ich.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > Reviewed-by: Simon Glass applied to u-boot-x86, thanks!