Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp233231pxb; Thu, 17 Feb 2022 02:56:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiEtBDTUH68JL+lW9Ah0+1cf1uwDYmF45C0Zx+axMspgH/buJR9YgP8LVz+MMe2kwZwl6u X-Received: by 2002:a05:6402:268a:b0:410:cc67:e792 with SMTP id w10-20020a056402268a00b00410cc67e792mr1958641edd.218.1645095417348; Thu, 17 Feb 2022 02:56:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645095417; cv=none; d=google.com; s=arc-20160816; b=hGenTCPJvbDfMUjlNEycw992UeiHCfkhc6Z4E9qcSB/Xz11esBOISHiWNHHdlCZHzo OGDY0Xs/hcdbxbaItsmnisWoJA1Xp2Uefq6ItVfcrBAOisUaJgRr1VQ5XTvT0ALoa4HC xcJ4BhiJesxcfv0fCnri/Yovmgd3HqgkHpJQ0uKLQgmkIAqL/gBcecorigPGp77o66+p nfP7scgatfb5NGAX2WqBb7ugGCVgZW9mcC2aF6n772FCX2WtwStcKOBtWBj4vIoyAwq/ uJep7bKgUqM34X9A8P/SErFLg/lpMQBb8J2RUZmPAYkX2xf8VkaFRfO7UNBRdeOfIYoh lQZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=H3AhFYZ2Z/vmjNkmjXGD+SIN9hQoVCx1Lu3otAP3brY=; b=p+B60K5qAspIJ2E0eIDEwcLyo8X5U4Ryr/88BQYIArng7/lqNcaE+9xfhqwG2gvQMj /T3wacc3iG5gbgDBxUH2l2S+uyWMStpPnrbDgyrbz1ufzXoJvBNUWtCeiWeA99sqVsIr LCHruhHBBD49t63A+t6aMhLfz0Mx/ezIyK14ASUgUIg/6pPgQbXBjtsWc0Y/4nTigTbA oCJyHPAJdxX7BN2GFFL3OeG7SMJrteTjSpmFmZ3fAUsEjVqwrL7pZVFhq8Os5AAgKkDX 8cCM0HzN6NtmD8tktUXADpSNQjz4D7e2dJrWyOL+B84MXZB2SMYN810K3RlXeQ/jV1H0 J+rQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jy6si1424990ejc.901.2022.02.17.02.56.33; Thu, 17 Feb 2022 02:56:57 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237330AbiBQH7o (ORCPT + 99 others); Thu, 17 Feb 2022 02:59:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237415AbiBQH7Z (ORCPT ); Thu, 17 Feb 2022 02:59:25 -0500 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68FEF258625; Wed, 16 Feb 2022 23:58:54 -0800 (PST) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1nKbgi-0000vy-00; Thu, 17 Feb 2022 08:58:52 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 0B097C250A; Thu, 17 Feb 2022 08:58:30 +0100 (CET) Date: Thu, 17 Feb 2022 08:58:29 +0100 From: Thomas Bogendoerfer To: Chuanhong Guo Cc: linux-mips@vger.kernel.org, Rui Salvaterra , Ilya Lipnitskiy , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: ralink: mt7621: do memory detection on KSEG1 Message-ID: <20220217075829.GA5185@alpha.franken.de> References: <20220211001345.3429572-1-gch981213@gmail.com> <20220216195423.GA17551@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_HELO_PERMERROR 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 On Thu, Feb 17, 2022 at 12:06:09PM +0800, Chuanhong Guo wrote: > Hi! > > On Thu, Feb 17, 2022 at 3:57 AM Thomas Bogendoerfer > wrote: > > > > On Fri, Feb 11, 2022 at 08:13:44AM +0800, Chuanhong Guo wrote: > > > It's reported that current memory detection code occasionally detects > > > larger memory under some bootloaders. > > > Current memory detection code tests whether address space wraps around > > > on KSEG0, which is unreliable because it's cached. > > > > > > Rewrite memory size detection to perform the same test on KSEG1 instead. > > > While at it, this patch also does the following two things: > > > 1. use a fixed pattern instead of a random function pointer as the magic > > > value. > > > 2. add an additional memory write and a second comparison as part of the > > > test to prevent possible smaller memory detection result due to > > > leftover values in memory. > > > > > > Fixes: 139c949f7f0a MIPS: ("ralink: mt7621: add memory detection support") > > > Reported-by: Rui Salvaterra > > > Signed-off-by: Chuanhong Guo > > > --- > > > arch/mips/ralink/mt7621.c | 36 +++++++++++++++++++++++------------- > > > 1 file changed, 23 insertions(+), 13 deletions(-) > > > > applied to mips-fixes. > > Oops. > > As I mentioned in a previous mail, this patch has two cosmetic problems: > 1. misplaced bracket in commit message "Fixes" tag > 2. incorrect second test pattern: I meant to flip all the bits in the > first pattern, > but I used "!" instead of "~". Any value will work just fine but it > looks weird > to construct a zero using !MT7621_MEM_TEST_PATTERN. > > Should I send a second patch to fix this patch or send a v2 of the > original patch? a second patch please. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]