Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6320284rwn; Tue, 13 Sep 2022 02:22:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR41ZgzS+jI0NrKAHjzSiaZUW3dAIcMKde/kvMHzM2DKqnxNenglxVwaghHkvpnAH/BMSDRW X-Received: by 2002:a17:906:9b86:b0:73d:72cf:72af with SMTP id dd6-20020a1709069b8600b0073d72cf72afmr21401842ejc.440.1663060966469; Tue, 13 Sep 2022 02:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663060966; cv=none; d=google.com; s=arc-20160816; b=tAfcA+eVA1oDrPIzN4rGHVt+qI0BHp0IWqqljO7j0SQKrOrGgSnwKNimEI3uPc5hqu irS2uN7Rs6sKifHzmtvJrB6Sb0F1cgY1rMxYvofcWG2TKqF57GN3DoHxd1nIUng2Z4Gs smZZPs7KkWjBb0Xfg+/70UOjaa9zyVgBmxQOe3Tq7+FpiyY/uvyYCQNgo+NH5p275ZWh SBmMLP6uLarGkHKFTGO/mD2TdLfIXCxNYPydaJqd6gRYIQ3wck++FkIkAWBafIijlfjd U7cljE/l7il0onguWUEOg3dxewi2X2Q88GNGlTO+z1K5FHXxkQu7Qq5UIpfBbp+D87Ev YDFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UDsHn+9Q4/Sb44o7PGK24bSEg208rNW403NXgpY8lDE=; b=dv6yGEy2R7GGMB4VbnWMSjKOt73dvibbVkFZsqgGAkQ6r9SbuKZOAOQOF848K6mk53 7ewCKFtl/1YpXSQ34EcgwQi5lhSHw01XglDzt7hf+jrpX/dAQAGTNrQWpLLaELDv5o2T ClvxqrPpjsazz+jUan93I2M8QYbPqY5lco/FNJmP0IdI84CuIq37170vEoQT5718Mxcp v4NhPaccR2AicXmNpA55bHRlYvsuqNhCP3BoztZrGtQbmUKCkuA9wAxGw9ZVgBZnLl9w jPHkYwp35aV6UU/FGmM1CgaNSHJbK6Za71I1cioM5Zx6lcWbGgCOyJVW6K7tHwZ/XFTE Kw0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=bG8XvUx2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=windriver.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t24-20020a170906065800b0073daf6b44a5si7788047ejb.775.2022.09.13.02.22.20; Tue, 13 Sep 2022 02:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=bG8XvUx2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=windriver.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbiIMIla (ORCPT + 99 others); Tue, 13 Sep 2022 04:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbiIMIlH (ORCPT ); Tue, 13 Sep 2022 04:41:07 -0400 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06BFC1E3F5 for ; Tue, 13 Sep 2022 01:41:03 -0700 (PDT) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28D88iXB007635; Tue, 13 Sep 2022 01:40:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PPS06212021; bh=UDsHn+9Q4/Sb44o7PGK24bSEg208rNW403NXgpY8lDE=; b=bG8XvUx2kRU1NezMtCDLmeiDknljQmkek+28NZ+9QUlOc59/TVphcTUhrEWRqy7WXhuY ALjqBhIt1d/IaemuryxqQLS6ZwX6SoW8piAEkRZ37oNY8fhFT0zZ7CEKZxj+PAUOP08f NwcDYo/EmWd2CBqSlaVLz7KZMvW2A+Df4qzmw0oO638+gsY3FWy89JMIvgcFciaZBXoo BpHIGYdnQ00JnfD79lD6rci0QzjgWB+D0pS6MLkhRCOT26WYZrGP6mPEn/7x2mMH2hVY cWwa6AUftwLV6BAov90puZSJRnXyNj183hCH9d0IpyDKW/5M2yCqLgTznpK/iC2SbuPA ew== Received: from ala-exchng01.corp.ad.wrs.com (unknown-82-252.windriver.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3jgnv6at2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 13 Sep 2022 01:40:26 -0700 Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 13 Sep 2022 01:40:25 -0700 Received: from pek-ywang12-d1.wrs.com (128.224.32.146) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Tue, 13 Sep 2022 01:40:24 -0700 From: To: , , , , , CC: , Subject: [PATCH] mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt Date: Tue, 13 Sep 2022 16:40:23 +0800 Message-ID: <20220913084023.2451929-1-yaliang.wang@windriver.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: uQ_sJLHkaE_jWWPTxhnn7fO7D111R8Mt X-Proofpoint-ORIG-GUID: uQ_sJLHkaE_jWWPTxhnn7fO7D111R8Mt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-13_03,2022-09-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=919 mlxscore=0 spamscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209130038 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yaliang Wang When utilizing PARSE_SFDP to initialize the flash parameter, the deprecated initializing method spi_nor_init_params_deprecated() and the function spi_nor_manufacturer_init_params() within it will never be executed, which results in the default_init hook function will also never be executed. As we do have quad enable function defined in BFPT, the post_bfpt hook will be the right place to tweak the function. Cc: stable@vger.kernel.org Fixes: 047275f7de18 ("mtd: spi-nor: gigadevice: gd25q256: Init flash based on SFDP") Reported-by: kernel test robot Signed-off-by: Yaliang Wang --- drivers/mtd/spi-nor/gigadevice.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi-nor/gigadevice.c b/drivers/mtd/spi-nor/gigadevice.c index 119b38e6fc2a..bdc4d73424af 100644 --- a/drivers/mtd/spi-nor/gigadevice.c +++ b/drivers/mtd/spi-nor/gigadevice.c @@ -8,19 +8,24 @@ #include "core.h" -static void gd25q256_default_init(struct spi_nor *nor) +static int +gd25q256_post_bfpt(struct spi_nor *nor, + const struct sfdp_parameter_header *bfpt_header, + const struct sfdp_bfpt *bfpt) { /* * Some manufacturer like GigaDevice may use different * bit to set QE on different memories, so the MFR can't * indicate the quad_enable method for this case, we need - * to set it in the default_init fixup hook. + * to set it in the post_bfpt fixup hook. */ nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable; + + return 0; } static const struct spi_nor_fixups gd25q256_fixups = { - .default_init = gd25q256_default_init, + .post_bfpt = gd25q256_post_bfpt, }; static const struct flash_info gigadevice_nor_parts[] = { -- 2.34.1