Received: by 10.213.65.68 with SMTP id h4csp1076981imn; Wed, 21 Mar 2018 01:53:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELtV2Mkf4sjIp9mwmen6gVK9E1YwtIrHJsAGSymLDBo3Pz3BKeLOXEwR2XUxRBIB29Wb1/TU X-Received: by 10.98.223.16 with SMTP id u16mr9634862pfg.146.1521622415120; Wed, 21 Mar 2018 01:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521622415; cv=none; d=google.com; s=arc-20160816; b=vE6pJWfMVKSxb8hTR4WTcHri8Z3QcA23Y3m5jc//C3AuUyRkxJ5dhn1lxLPEFF3Wtg DzFouUPzoqA6j+d1DaWU7JBtQq+P0fUYxHErgIfo/tVMmPt+aJXEZUB8/rPu2+A6Kb1A wPVPPBgh4R45xSPME27geezLwIMcWhYFkrCm8R/kPIFrPdl2q9dn9Yk7Brh8DVwJ4zru 4L5qyoPLjEbWSOpJYUzkj/F2mTMdnft/0/Ml0vjtjxn/kpBfnl5Lwu/FZXaSIIipjgHt A+F1VOou3gpJGEja1f+rQDBuzzVxhUDqiROFhl6AWAoWFnPmM/ksrW9OREh44A1A/R+4 lucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=8eaSi3uAInIfITJtyAmA7uC+aBcNUyIWkpmRpTpbbyo=; b=tmk4QP0kgANWc+DhJkvrBSjv6NuGYQJb+Lw46AFz0oRwVti+C9/ftBn9EEDbxMGHJz 3lvGv4ZrHiM3fFaXY1bRF+Y1X294e9CVyrcWGjosOn5jHqyPa54OdIUGWNaOPwLmKAbn AU8klGfMmAwh7anFrMZgv2snesp6+vQ6932/8pp8cLfPlfGhiWgxwiBhsvZVteUgLK26 lmhgqHirPDUaZAYZNkwnkLIu/p79Necjy0sAVTBaiLPlsx0MPUxihcwVubtMZvsktlaE E+efQjFgXSY5ooOAIihJ5AYy9+Sl5cr87uFwcGs9aK3GskqwIh2w5FGxYIzqJEIs1BnP vMDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si2512005pgc.540.2018.03.21.01.53.20; Wed, 21 Mar 2018 01:53:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbeCUIwU (ORCPT + 99 others); Wed, 21 Mar 2018 04:52:20 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.154.211]:52639 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbeCUIwP (ORCPT ); Wed, 21 Mar 2018 04:52:15 -0400 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1403.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Wed, 21 Mar 2018 08:52:05 +0000 Received: from [192.168.155.41] (192.168.155.41) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 21 Mar 2018 01:52:11 -0700 Subject: Re: [PATCH v2] MIPS: ralink: fix booting on mt7621 To: NeilBrown , John Crispin , Ralf Baechle , James Hogan CC: , References: <87efkf9z0o.fsf@notabene.neil.brown.name> <87605r9mwf.fsf@notabene.neil.brown.name> <874lla874z.fsf@notabene.neil.brown.name> From: Matt Redfearn Message-ID: Date: Wed, 21 Mar 2018 08:51:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <874lla874z.fsf@notabene.neil.brown.name> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.155.41] X-ClientProxiedBy: mipsdag02.mipstec.com (10.20.40.47) To mipsdag02.mipstec.com (10.20.40.47) X-BESS-ID: 1521622325-321459-16024-41654-1 X-BESS-VER: 2018.3-r1803192001 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Neil, On 21/03/18 03:00, NeilBrown wrote: > On Tue, Mar 20 2018, Matt Redfearn wrote: > >> Hi Neil, >> >> >> On 20/03/18 08:22, NeilBrown wrote: >>> >>> Further testing showed that the original version of this >>> patch wasn't 100% reliable. Very occasionally the read >>> of SYSC_REG_CHIP_NAME0 returns garbage. Repeating the >>> read seems to be reliable, but it hasn't happened enough >>> for me to be completely confident. >>> So this version repeats that first read. >> >> You almost certainly need a sync() to ensure that the write to gcr_reg0 >> has completed before attempting to read sysc + SYSC_REG_CHIP_NAME0. > > That sound like exactly the right sort of thing to do, though > I assume you mean __sync(). Indeed I did :-) > > I tried to reproduce the problem so I could test the fix, and of course > I failed. Over 700 reboot cycles and never read any garbage from > SYSC_REG_CHIP_NAME0. Funny how things conspire like that :-) __sync() is definitely the correct barrier required to ensure the write completes before the read begins and will guarantee that the memory operations are ordered. Thanks, Matt > > So I cannot test that this works, but I have tested that it doesn't > cause any obvious regression. > I'll send the v3 patch separately. > > Thanks a lot, > NeilBrown >