Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1034572ybl; Thu, 22 Aug 2019 08:25:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbQx+7/aOLKJqSBYuYtU4dY/fSOBbLF0BbbuDXvYCdaumK6Z1B6n/ETSh/7se3JuSGGuiD X-Received: by 2002:a63:60a:: with SMTP id 10mr33876333pgg.381.1566487534017; Thu, 22 Aug 2019 08:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566487534; cv=none; d=google.com; s=arc-20160816; b=GppqeUaYkOYj63YYqm+1v0OY/1xcOtxKv1rUnAPkHDX8rPuy1GGBk17IJVlhCLEZZZ jIROhMuVrh+/sSdKFy041S4AcCTX0FAkKTfj79EauTbPuCKqW3vDx4YRSy0O+2l7BZ5h R4PJ4fF19fMKWGX/4V8WQzK2S6mVUf7GJIWQUNWnAxtGGr2nQgybgqZc4uOB3wiFOcJj SP+o+KQDJRwksnkEWMZJCQTHjbHiQ8jLJIYSKQGo1Yhwquz0SBLmsbr2ZcKLHSUVeYz+ 6+KCxLyMnhV6rc6MnWTH9ou96kwaXZ5tJI3FOh1DAhV8/7aGhiHkwwfvLj465pmBrybV 2dpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pVS9WjZ8RWCSBv6JVW5/oNJDRTIjY7tJwBPEyclsS3s=; b=GAlrufiFKDIJK9cF03Tcsh/94CvFYsnlYHZQHv7OW5StxrG+4THTNTdCeDBNQKekvZ emLbUggl0zhjTK9BYYOLLUk9ItIGuXXjit1FiomRDS3pEzIYLjPcPyDRtnhBYVn4yx1e RC77JlM923y1d0Y/UWsme+ZavmQ5C7BQLWsV52EYLAWDUYbEnQlzSZsEjPPNouxDJWvf QfZv0yYdVSpSkU3j5qtzfDUE9UWfJ24AnULMHGqPIEQZ5UiasEBzw24XZ1f9esoh8PqG tM1gBsggt5Wc8vt4T0B3YTDWJLVdoXmLGwnw7MGJCPaK4TFNBaSuQSP5vz/UtiFHdS+o nQ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IHwJHSCr; 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 q21si17221765pgt.432.2019.08.22.08.25.18; Thu, 22 Aug 2019 08:25:34 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IHwJHSCr; 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 S1731832AbfHVNzd (ORCPT + 99 others); Thu, 22 Aug 2019 09:55:33 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45462 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731791AbfHVNzb (ORCPT ); Thu, 22 Aug 2019 09:55:31 -0400 Received: by mail-pf1-f195.google.com with SMTP id w26so4002695pfq.12; Thu, 22 Aug 2019 06:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pVS9WjZ8RWCSBv6JVW5/oNJDRTIjY7tJwBPEyclsS3s=; b=IHwJHSCrZqwuxLg+z9PPuWxBtzeGhgAcD9jbCyNf7SVvnbEYEC7sAULbMT2EfPFyng 9Gu6yf9O1eH34wTMSQkb3aF/w9vUZKZHXAqzau1Zs48p0Q9w0ZJI90Qx/i2B92E2BH/m aPAxH9UWBwnGkUXLyHcpJqvRw8GzmYZGDYi07ux6OMSttTDL7fSOevIObEPBOiGEM6Cq G7suHv7mIKdp15Tk4i8uRrjOH5Oh3qtPH6lxCTvPOo1Ti9O4Nlhzcj1x+Luj6OEiPDFV 2suCvr6o6JxtVothsXeejOPG1tN3DA4OWAOosJkqclGKmUrtEx/0h4IHi/gdwB5Sz17U ECmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=pVS9WjZ8RWCSBv6JVW5/oNJDRTIjY7tJwBPEyclsS3s=; b=SVVgVowX6RSQTGaQwwESKMQaM7XEWr4fKTKfihw4XdCEMF5O0p01Q9cF8vNd5O9ACL KNw9lj5Q8MqTMPuur5sxwybJlcHhe7YKY25+LMA7b/+UUe/fFQLNAhth2q+3gjIptfGs 8A6L5erM4/LVKYEIK+sSmzgr6Mg/r1ewgCuk7rU+p70kEcjo/okGEOJtqaoSbkpblKul BXPUNaQutprbHZMyhFatZYRJGAwGcMO4/23WJadF8JM7eUP8k4KqjkMSgs8WElp8Qgto +JzzPU7LRih7dyieo7Rreyb9LLrANS7NI1+0eSGEtn5iyCluw7cd1cc6dl4lfIhb+Fz+ 0Fng== X-Gm-Message-State: APjAAAUNrembRxZLJCaCWO1mnzN57VxvN7zkeqlTt9yIOh3tYB8Kr+vH vA6xuKWFVkxrBWiHrcPbXVg= X-Received: by 2002:a17:90a:bd0b:: with SMTP id y11mr5304283pjr.141.1566482130453; Thu, 22 Aug 2019 06:55:30 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e13sm33247202pfl.130.2019.08.22.06.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2019 06:55:29 -0700 (PDT) Date: Thu, 22 Aug 2019 06:55:28 -0700 From: Guenter Roeck To: Ivan Mikhaylov Cc: Wim Van Sebroeck , Joel Stanley , Andrew Jeffery , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Alexander Amelkin Subject: Re: [PATCH 3/3] watchdog/aspeed: add support for dual boot Message-ID: <20190822135528.GB8144@roeck-us.net> References: <1f2cd155057e5ab0cdb20a9a11614bbb09bb49ad.camel@yadro.com> <20190821163220.GA11547@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 22, 2019 at 12:15:20PM +0300, Ivan Mikhaylov wrote: > On Wed, 2019-08-21 at 09:32 -0700, Guenter Roeck wrote: > > > > > + writel(WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION, > > > + wdt->base + WDT_CLEAR_TIMEOUT_STATUS); > > > + wdt->wdd.bootstatus |= WDIOF_EXTERN1; > > > > The variable reflects the _boot status_. It should not change after booting. > > Okay, then perhaps may we set 'status' handler for watchdog device and check > 'status' file? Right now 'bootstatus' and 'status' are same because there is no > handler for 'status'. > You would still have to redefine one of the status bits to mean something driver specific. You would also still have two different flags to read and control cs0 - to read the status, you would read an ioctl (or the status sysfs attribute), to write it you would write into access_cs0. I guess I must be missing something. What is the problem with using access_cs0 for both ? Guenter > > > + > > > + return size; > > > +} > > > +static DEVICE_ATTR_WO(access_cs0); > > > + > > > +static struct attribute *bswitch_attrs[] = { > > > + &dev_attr_access_cs0.attr, > > > + NULL > > > +}; > > > +ATTRIBUTE_GROUPS(bswitch); > > > + > > > static const struct watchdog_ops aspeed_wdt_ops = { > > > .start = aspeed_wdt_start, > > > .stop = aspeed_wdt_stop, > > > @@ -223,6 +248,9 @@ static int aspeed_wdt_probe(struct platform_device > > > *pdev) > > > > > > wdt->ctrl = WDT_CTRL_1MHZ_CLK; > > > > > > + if (of_property_read_bool(np, "aspeed,alt-boot")) > > > + wdt->wdd.groups = bswitch_groups; > > > + > > Why does this have to be separate to the existing evaluation of > > aspeed,alt-boot, and why does the existing code not work ? > > > > Also, is it guaranteed that this does not interfer with existing > > support for alt-boot ? > > It doesn't, it just provides for ast2400 switch to cs0 at side 1(cs1). Problem > is that only one flash chip(side 1/cs1) is accessible on alternate boot, there > is citation from the documentation in commit body. So if by some reason side 0 > is corrupted, need to switch into alternate boot to cs1, do the load from it, > drop that bit to make side 0 accessible and do the flash of first side. On > ast2500/2600 this problem is solved already, in alternate boot there both flash > chips are present. It's additional requirement for alternate boot on ast2400, to > make the possibility to access at all side 0 flash chip after we boot to the > alternate side. >