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 3F4E2C433EF for ; Thu, 25 Nov 2021 18:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237889AbhKYSu2 (ORCPT ); Thu, 25 Nov 2021 13:50:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346987AbhKYSsZ (ORCPT ); Thu, 25 Nov 2021 13:48:25 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86B0C061757 for ; Thu, 25 Nov 2021 10:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ygId15sHVDSUgzordb/RZ26Hm8zOUDkkt5ndBILk9Hc=; b=Fr4fNeN61PCsABSBEVh2FWVyMi m0Odj2QKLZewBWg/KsNqW/bM/QIgHcjhNlcuABLT+oAt+MLenHI79i2qDyzRXyX5CxTPkxoPWr6nm MT7mat/E2hV5ohLK56nhnFbIL7yk9fDgyq/9ifyp0NIsHjwQwynR4crLjsvlbaMqY6ac=; Received: from p54ae9f3f.dip0.t-ipconnect.de ([84.174.159.63] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1mqJjP-0000xx-6s; Thu, 25 Nov 2021 19:44:27 +0100 Message-ID: <8ed35f3f-b0a2-dd93-e78c-33233bc6497a@nbd.name> Date: Thu, 25 Nov 2021 19:44:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] mt76: eeprom: tolerate corrected bit-flips Content-Language: en-US To: Daniel Golle , linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Ryder Lee , Lorenzo Bianconi , Hauke Mehrtens References: From: Felix Fietkau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-11-25 19:36, Daniel Golle wrote: > 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)) { I don't think this will even compile (err vs ret) - Felix