Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp110841rdh; Wed, 25 Oct 2023 18:21:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGk5PNOwuJAbZnpdGLheS8iYsWu+ekG0PO2oGXyr7xxDjxkwOVC0HPisceX16ZKW1j6/3b7 X-Received: by 2002:a25:cf14:0:b0:da0:3475:c5e9 with SMTP id f20-20020a25cf14000000b00da03475c5e9mr8474405ybg.18.1698283271037; Wed, 25 Oct 2023 18:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698283271; cv=none; d=google.com; s=arc-20160816; b=SiLRUhg378KdT/IJea7IBH4OuRZnmECvpKq/tNqFxQaurTDRxOYDJnvrllErK/uKPJ us+Rp0cyJo8E8lMyd/7wJ4mrhETDbB7S39RndHAQDyRMBhuu4iRuBlxiQaWj6oS4buS0 6UDQWuLnmt0kp49feSbINzTEdhm86MpnV0NLFgvfUbEj3YEDr9wy4/Tm+HJmKXKT91fN XdTTXTik37sDRYwr7rNMbjUtVs9OZznG7BNj8tSRwJNoBeumxhqJWqwwaTxHAko1ZuDN tu2sfdcoKD0vuGSPP5Z8s23Uxzp3/pHuJin+eSSR4L/Z0ry4vXRdXO3THbrcDK5Msk6p T8TQ== 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:to:from:sender:dkim-signature; bh=PmRrkZ15lkbJoZUemYsPfR2kJiWVaXMup1NLxDeednM=; fh=BaDREYfXZBTIWNXgEcnoqEhXb9Pz5WcHyeoLuypFB9A=; b=ne0LW9ZzvKaGxCeoAbrWfptl2Ml+JpzK3RAwrkfVBuogaah//MUjEJz0JL/if1tP/y UFBzkfeiV+uBrNgxsW8/FBCNawQhcZGXo0crgmer2I32wcaoofHP5zS8dYa6D7xFQ/C7 VjpE6tZ4SEcghA69r1pjKjQ+0xgibt+4sXsSfKnxQCuCfM43e+P40pma6+VC2WlJDNzr rBlajy5a0FFJwG09fYN+MF1RAIWBEyw0Q62uNCVaJh78GeygvQmDA/vH+28YioAAU37Y B1q1CL2pbkx9ai5whASTz5TkJOOvTiAHIlxx43nHL+A3xSes2Q8u7fdIEE4F8ndS7nxz HWaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jIJrdTux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d79-20020a25e652000000b00d86688b4273si11100856ybh.579.2023.10.25.18.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 18:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jIJrdTux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0A1A980C8425; Wed, 25 Oct 2023 18:20:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229928AbjJZBU1 (ORCPT + 99 others); Wed, 25 Oct 2023 21:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjJZBUZ (ORCPT ); Wed, 25 Oct 2023 21:20:25 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1B42CC for ; Wed, 25 Oct 2023 18:20:20 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1ca72f8ff3aso2646695ad.0 for ; Wed, 25 Oct 2023 18:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698283220; x=1698888020; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=PmRrkZ15lkbJoZUemYsPfR2kJiWVaXMup1NLxDeednM=; b=jIJrdTux+uz7WLmrWCrSQRzufI7eTaoEmfq/fWQmNdbMd6d+oP7Ol7sRKRpZ7mnrlj aXmweBwZ93QaFNiLTLiGsFPYnnpTLzV3DFaPIn3pKnNwbiAbWMgt4FNh2lXIn6anfaum Ktj2uNwuEiMR56TV5no5ZjNWvLMlOE2alXjbFyPpYQe91nNjTTYBQhJ2A/OunF/3sksF zz80CIT1ET3ZQ+zmKNvqiowPxOSCbkSBvebcCJmiwK+W0daTnsIQcAht3P3tRBif9NxP zjBJ5+lVLz5vAxN9qIx8igqBbVa8+UPAUGXJ8rBHQItsVlVUvneuC3XWoa/yOMfsOgrA RPDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698283220; x=1698888020; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PmRrkZ15lkbJoZUemYsPfR2kJiWVaXMup1NLxDeednM=; b=VhYKPjRAD2I1rKhbxLVV2fmC802cglzVkzupGJM+HTFjqBsW5OHK5ir03VC5bjXo2d LECQbq1IvUzMBsZal2USOpQm7hlVF9DrHYoynhYJeqT+/8XLn4fFVoejeaAlVXj2TwUi qWj1iOJFuoQIgijUa09JRq70tHMW09GVc0kSgm3NqGhKpEydl2ED8vxQkfC7eAqfvGIE mi7c/lt0q7trQ+DJ1nYU2H3O6YNKb/2Lq6J1I9KPspvclwIon8CkJCTpP+tdcpy3Zij5 LJYKcdnKU3PlnPRAFL+KHykTCX9nCkCu2LsmlWx8KTZ7IPqD9ZdQe7NUStYG9jkiNSNU uuKg== X-Gm-Message-State: AOJu0YyHhq5ulmFQbobVsmUk/E2kwZXlQdokvZJPCbVBcj3JGPLVGKwX OtSl+xySmuClRttzczrDxkY= X-Received: by 2002:a17:902:cf4f:b0:1ca:64f:35ff with SMTP id e15-20020a170902cf4f00b001ca064f35ffmr14180050plg.48.1698283220020; Wed, 25 Oct 2023 18:20:20 -0700 (PDT) Received: from localhost (211-75-139-217.hinet-ip.hinet.net. [211.75.139.217]) by smtp.gmail.com with ESMTPSA id e12-20020a170902ed8c00b001c60c8d6b4asm9884343plj.149.2023.10.25.18.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 18:20:19 -0700 (PDT) Sender: AceLan Kao From: AceLan Kao To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] mtd: spi-nor: Improve reporting for software reset failures Date: Thu, 26 Oct 2023 09:20:17 +0800 Message-Id: <20231026012017.518610-1-acelan.kao@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 18:20:41 -0700 (PDT) From: "Chia-Lin Kao (AceLan)" When the software reset command isn't supported, we now report it as an informational message(dev_info) instead of a warning(dev_warn). This adjustment helps avoid unnecessary alarm and confusion regarding software reset capabilities. Signed-off-by: Chia-Lin Kao (AceLan) --- v2. only lower the priority for the not supported failure v3. replace ENOTSUPP with EOPNOTSUPP and check the first command only v4. move the version information below the '---' line --- drivers/mtd/spi-nor/core.c | 5 ++++- drivers/spi/spi-mem.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1b0c6770c14e..42e52af76289 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3252,7 +3252,10 @@ static void spi_nor_soft_reset(struct spi_nor *nor) ret = spi_mem_exec_op(nor->spimem, &op); if (ret) { - dev_warn(nor->dev, "Software reset failed: %d\n", ret); + if (ret == -EOPNOTSUPP) + dev_info(nor->dev, "Software reset enable command doesn't support: %d\n", ret); + else + dev_warn(nor->dev, "Software reset failed: %d\n", ret); return; } diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index edd7430d4c05..93b77ac0b798 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -323,7 +323,7 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) return ret; if (!spi_mem_internal_supports_op(mem, op)) - return -ENOTSUPP; + return -EOPNOTSUPP; if (ctlr->mem_ops && ctlr->mem_ops->exec_op && !spi_get_csgpiod(mem->spi, 0)) { ret = spi_mem_access_start(mem); -- 2.34.1