From: Ian Campbell Subject: Re: [PATCH V5] xen: arm: platforms: Adding reset support for xgene arm64 platform. Date: Mon, 27 Jan 2014 11:13:15 +0000 Message-ID: <1390821195.12230.21.camel@kazak.uk.xensource.com> References: <1390812173-12081-1-git-send-email-pranavkumar@linaro.org> <1390818750.12230.7.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Pranavkumar Sawargaonkar Cc: patches@apm.com, Patch Tracking , stefano.stabellini@citrix.com, Anup Patel , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2014-01-27 at 16:35 +0530, Pranavkumar Sawargaonkar wrote: > Hi Ian, > > On 27 January 2014 16:02, Ian Campbell wrote: > > On Mon, 2014-01-27 at 14:12 +0530, Pranavkumar Sawargaonkar wrote: > >> + /* Retrieve base address and size */ > >> + res = dt_device_get_address(dev, 0, &reset_addr, &reset_size); > >> + if ( res ) > >> + { > >> + printk("XGENE: Unable to retrieve the base address for reset\n"); > >> + return 0; > >> + } > >> + > >> + /* Get reset mask */ > >> + res = dt_property_read_u32(dev, "mask", &reset_mask); > >> + if ( !res ) > >> + { > > > > At this point reset_addr and reset_size are set and xgene_storm_reset > > will try to use them with reset_mask -- which I suppose is 0 at this > > point (due to .bss initialisation + dt_prop_read not touching it on > > failure). > I thought that if reset_addr or reset_size is 0 then ioremap will not > return me a success hence code will return it without writing the reg. I'm not sure about the reset_size==0, I'd hope that ioremap does work for reset_addr == 0 though, since it isn't implausible that something might live there on some platform. But in any case after partial success gathering the parameters these may no longer be zero. > But i think mask can cause issue if uninitialized, so i will add a > global flag (valid_reset_vals) and will set it at the end of the > xgene_storm_init, and in fuction xgene_storm_reset i will first check > if this falg is set or not before proceeding further in reset. > Is this fine ? Sounds good to me.