Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1176891ybi; Fri, 14 Jun 2019 09:53:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUJqPPnLE1BBMmmWYeXHqUvAlM59egJwfibUOeYnr8sgkdwnyIDKr4PvW0ZyHwyCHGG7vn X-Received: by 2002:a17:90a:20e7:: with SMTP id f94mr11775744pjg.68.1560531214804; Fri, 14 Jun 2019 09:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560531214; cv=none; d=google.com; s=arc-20160816; b=z5amdQli2SM0jAk/z3bhwS7VacCNGCV3mNmVdhHNb2T0ah3NvE8piHbuC1i9yAoMSj 3a/xrENpcq4eaUIuBECP0bCA87QoC6oXBYOBGXatNfyeNkyTCYhj7e41tXE48zj5Z6Ze yW3LzVDkVaiQazmsCOtUfDxbJ+Ez0rZi57Gu10qi9ZRo23ZijvmYWJO3R71LMvwedTEu oiRzFuedSyJa3WIpzRXPPcG1e4yLOZt2+9J65a7a8M5cW38fOe8LwwRI59diTwbTgtta xMxIaeUK1EitF4OcpUxgPAOCgXDgP3fAt7pl/51AHYsKQ+7iBbEH1PRt0etTraaU76xj InaA== 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:dkim-signature; bh=La0om+Dm2f2QFp3CrekJBlv0rebzycLNY6Yi9piJU5o=; b=kJ7fGC8303FNHnLej28M0JMvTZ+dKKC6oMjEpxZA/4ur9BpT0ULZy7ZuyupZ8QT8sG 3U3cNqcjRpRy2U/Yl1+at5VtAv6ZCg77UuslJD83IlcNtorrnA4K6DOo6bXNaFOazyJy dVuaasqYkW9qhVLqfNd9JHpjiGyF7kqFDBimVLrAODZhY585sxTILcqLcSjdChCsZcuQ 1VxSMuHoK0qmPz/gBGu2LUwLE6rjz/GqXhPqUG+xcCv3rHt5c0t2/4t4ukWDN89COv6L Y7I3Q62nYNxnfN8JqCGzvrHngvqb6t4CRx6GIm7zZroTW2TJOmWlZ5+u7mRtiRzUsp2D pMUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XIj2dn3M; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si2983814pgk.223.2019.06.14.09.53.19; Fri, 14 Jun 2019 09:53: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=pass header.i=@gmail.com header.s=20161025 header.b=XIj2dn3M; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726289AbfFNQvg (ORCPT + 99 others); Fri, 14 Jun 2019 12:51:36 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44235 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbfFNQvf (ORCPT ); Fri, 14 Jun 2019 12:51:35 -0400 Received: by mail-lf1-f67.google.com with SMTP id r15so2176648lfm.11; Fri, 14 Jun 2019 09:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=La0om+Dm2f2QFp3CrekJBlv0rebzycLNY6Yi9piJU5o=; b=XIj2dn3MekBc7CEwjalh574vqRmrX+0g+5gz5K2IAnjYDYIHOO5nhpQcEj2SwDzTIS FfD58vd4ah4wj8Pr3cSIddxPdG1wKT4vaafRN4hy7DLbFBR3VSMGxofTfE8Tf2nRpsP4 3PzFKbF8xmpfgZdLpZ08Ie66e+PkE0y0s3keXCND9LJX73qoyDkQ7YEE5gkqfWX252Xc 8OTMsa3jcKP4/l/xawElS2mVoCrRHMAFO777paf1VjG+Li7PkNiJ4lZumf4fIX83g95L cAEiSiDXrPYafCNqy4rRmEUzc7PJTnJJBg25e7eOuPu/ddmrxWU54JtX+FMSFxkbLeWg AU+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=La0om+Dm2f2QFp3CrekJBlv0rebzycLNY6Yi9piJU5o=; b=GlE1bsAC+GozkA9z2z3Ve0uTV02k0reKm51cQj42FhUcl1KQ4/CPAFyzpAaDSmHkBr vJiVrmv00XgcB3GGBxx33oEZR4cri4xyFwEDpv9wW0lajyjQkz5C1WrucwOYdNLhICcD 5+aahJM/9fT0beLEZnoxvH4COjJUpF/bvbYU19w53t40qLmf2g4i6heHb0+JITmi7cCX do+C2eNqxJwfidb39WNo2jfkohn7ROquCHxvMuKFwGX6t1lp9LjfgKBg/AJ4YwYMufje baf24zjnkwne2GxOTWonBJT0vTw3YBbguVp+9iIUnoDf6VxGxIQFry//5eqtyEJFkxrC vlIA== X-Gm-Message-State: APjAAAUF8LJUX3uGwnZWpCSTjiZmEZ8RuOg5PmGGDk+M0oxO9kBoi/QM UFn5hxVxZXoKsYQq+Iu+m6r/uDkH X-Received: by 2002:a19:4017:: with SMTP id n23mr52512076lfa.112.1560531093330; Fri, 14 Jun 2019 09:51:33 -0700 (PDT) Received: from [192.168.2.145] (ppp91-79-162-197.pppoe.mtu-net.ru. [91.79.162.197]) by smtp.googlemail.com with ESMTPSA id m24sm546452lfl.41.2019.06.14.09.51.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jun 2019 09:51:32 -0700 (PDT) Subject: Re: [PATCH v2 6/6] clocksource/drivers/tegra: Restore base address before cleanup To: Jon Hunter , Daniel Lezcano , Joseph Lo , Thierry Reding , Peter De Schrijver Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190610164400.11830-1-digetx@gmail.com> <20190610164400.11830-7-digetx@gmail.com> From: Dmitry Osipenko Message-ID: Date: Fri, 14 Jun 2019 19:51:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 14.06.2019 18:48, Jon Hunter пишет: > > On 10/06/2019 17:44, Dmitry Osipenko wrote: >> We're adjusting the timer's base for each per-CPU timer to point to the >> actual start of the timer since device-tree defines a compound registers >> range that includes all of the timers. In this case the original base >> need to be restore before calling iounmap to unmap the proper address. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/clocksource/timer-tegra.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/clocksource/timer-tegra.c b/drivers/clocksource/timer-tegra.c >> index 2a428fdf702f..7be91db98bd7 100644 >> --- a/drivers/clocksource/timer-tegra.c >> +++ b/drivers/clocksource/timer-tegra.c >> @@ -345,6 +345,8 @@ static int __init tegra_init_timer(struct device_node *np, bool tegra20, >> irq_dispose_mapping(cpu_to->clkevt.irq); >> } >> } >> + >> + to->of_base.base = timer_reg_base; >> out: >> timer_of_cleanup(to); > > So what you are saying is that because we don't know which CPU executes > the tegra_init_timer() function, then it is necessary to restore the > base. IOW if it is not CPU0, then the base will be updated and hence, > need to be restored. Correct? We know what the CPU is, it is always CPU0. What we don't know is what TIMER is assigned for CPU0. On Tegra210 it is TIMER10, for other Tegra's it is TIMER0.