From patchwork Thu Nov 25 18:36:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 12639759 X-Patchwork-Delegate: nbd@nbd.name Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7012BC433F5 for ; Thu, 25 Nov 2021 19:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348780AbhKYTEY (ORCPT ); Thu, 25 Nov 2021 14:04:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236810AbhKYTCX (ORCPT ); Thu, 25 Nov 2021 14:02:23 -0500 X-Greylist: delayed 1334 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 25 Nov 2021 10:59:12 PST Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64302C061746 for ; Thu, 25 Nov 2021 10:59:12 -0800 (PST) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from ) id 1mqJc4-00026U-4x; Thu, 25 Nov 2021 19:36:52 +0100 Date: Thu, 25 Nov 2021 18:36:45 +0000 From: Daniel Golle To: linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Ryder Lee , Lorenzo Bianconi , Felix Fietkau , Hauke Mehrtens Subject: [PATCH] mt76: eeprom: tolerate corrected bit-flips Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org mtd_read() returns -EUCLEAN in case of corrected bit-flips. As data was read, don't error out in this case. Acked-by: Hauke Mehrtens Signed-off-by: Daniel Golle --- drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index 2d58aa31db934..0eb98f7ff7ec0 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -65,7 +65,7 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len) offset = be32_to_cpup(list); ret = mtd_read(mtd, offset, len, &retlen, eep); put_mtd_device(mtd); - if (ret) { + if (ret && !mtd_is_bitflip(err)) { dev_err(dev->dev, "reading EEPROM from mtd %s failed: %i\n", part, ret); goto out_put_node;