Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3595716rdg; Tue, 17 Oct 2023 23:07:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyRmsLMgPGcsyGtUd/Wbh/DR/AtVae0uEy1QySvaYL9OL0YdttHZ+NsCbl3rOY6dWw/eQc X-Received: by 2002:a54:4e90:0:b0:3b2:dab7:e6e4 with SMTP id c16-20020a544e90000000b003b2dab7e6e4mr3480212oiy.6.1697609257847; Tue, 17 Oct 2023 23:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697609257; cv=none; d=google.com; s=arc-20160816; b=NajoERJa51ytiQWetqI1DReMK0jpk3KcRf9ggOsiphBau2rxNVJZrcvQSZ9kvfcmga emiu+mGmfdDcbEdlwXVnAvaBOBC+2iUU9EZ5XWr6wI5LKB7C9GHAknebqzxOCYrS6fjb fN0srVrV8Nj8li6pv76wM2cvSbiixeME0xfxoRzCQCOYOT5yFYrOSVb55t9HlFP2R35Q MLDy/btLCrs11i4RIU4GsU1IiSktUJG2MkXeOJpuRj+2g5Fm7ywUg5NDyiVzEX97Ws/T dbH7NNxn5i93brSnYDKP9GpFGX0wl5yccYORW8Lq5k5g+3pRuUAztqLcmYnheMXRY8AH J1sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=R86kxfqrPEtr495qKYbi8YP7lktM7XvKgX2nq4nlfuU=; fh=3imDo5Pyd4tYDAR8xwwD54zmulLSiB92W3YcTTIJv2w=; b=MvwzH6ayJSZw2OXlYt16As5Ag0/BgyelyxSmVkdO0qnE29P6XJE7D4u5KQNEFqpCG9 zcaKxgSqLIYHRLTBLrfWHX5NSYjahQXE4pJax3K87vp7aYKL/5vPzqVloGi3PkOYDFqR Chm7KGDV7wuZugIeKwffBGUK/pEZ7yjdG6O8iqSyxvEU2ZXMbg/Tm9oTALbGMDr9vuS8 Iva27n1XekMYUxfQBw8VoODoODebylU3EW81UV2+fPiXaZkmT5NcJ696FD/HPpgn8rys HAIIi0OLY/mZQdlvpaPKdTGbNmUV7JnIAYjmLROqNGd34wDi/xeK9pTorqLXGf0uCLKj Sn1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k14kdHnx; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bq6-20020a056a02044600b005a9b0fe6afbsi1775055pgb.144.2023.10.17.23.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k14kdHnx; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 04A208026C37; Tue, 17 Oct 2023 23:07:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbjJRGHa (ORCPT + 52 others); Wed, 18 Oct 2023 02:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjJRGH3 (ORCPT ); Wed, 18 Oct 2023 02:07:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722A0C4; Tue, 17 Oct 2023 23:07:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16DEBC433C8; Wed, 18 Oct 2023 06:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697609248; bh=h/auq6HpOSLO/N4BVvzPRBs8wFljerSgSeyenywRUl4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=k14kdHnxqZ97agAIFMyDjHuczUDMuqPTAoLnzIWFM/jPbjraO7DPPFJFC4bivqoYY JUrGrG3gf2H1E5+HjEQyhA/kUpvKYZDW1vX1/mfoLEz36vdzWRBb9cuzmjwm7HDdBz ErG81JZoUVatTvvMWFjw4PVEXH9ux8VZ9/FVi7xx1VWYv3lEdqFRqjEQqyPMyqiymI zotak707hUoVBhZoqA7uDfLuGoarDlAd/657b3Fggk8958IssNB6Al2XRFLWx+XKIt Vr4VJCltmeYRZv6QYuHCPYLPLqVISx0UJRvMfqNhO8Lg81W4CHb6YqQeASv5wmx6EO ihCvlCrWBobyQ== From: Kalle Valo To: Christian Marangi Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Simon Horman , Alexander Couzens , Nicolas Cavallari , Daniel Golle , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, stable@vger.kernel.org Subject: Re: [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 References: <20231017190510.27163-1-ansuelsmth@gmail.com> Date: Wed, 18 Oct 2023 09:10:07 +0300 In-Reply-To: <20231017190510.27163-1-ansuelsmth@gmail.com> (Christian Marangi's message of "Tue, 17 Oct 2023 21:05:05 +0200") Message-ID: <87a5sgea0w.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 17 Oct 2023 23:07:32 -0700 (PDT) Christian Marangi writes: > Commit 495184ac91bb ("mt76: mt7915: add support for applying > pre-calibration data") was fundamentally broken and never worked. > > The idea (before NVMEM support) was to expand the MTD function and pass > an additional offset. For normal EEPROM load the offset would always be > 0. For the purpose of precal loading, an offset was passed that was > internally the size of EEPROM, since precal data is right after the > EEPROM. > > Problem is that the offset value passed is never handled and is actually > overwrite by > > offset = be32_to_cpup(list); > ret = mtd_read(mtd, offset, len, &retlen, eep); > > resulting in the passed offset value always ingnored. (and even passing > garbage data as precal as the start of the EEPROM is getting read) > > Fix this by adding to the current offset value, the offset from DT to > correctly read the piece of data at the requested location. > > Cc: stable@vger.kernel.org > Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data") > Signed-off-by: Christian Marangi mt76 patches go to Felix's tree, not net-next. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches