Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753250AbdF2PWo (ORCPT ); Thu, 29 Jun 2017 11:22:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:55334 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751974AbdF2PWh (ORCPT ); Thu, 29 Jun 2017 11:22:37 -0400 Subject: Re: [PATCH v4 20/28] ARM: owl: Implement CPU enable-method for S500 To: Arnd Bergmann , Thomas Liau Cc: Linux ARM , mp-cs@actions-semi.com, =?UTF-8?B?5byg5Lic6aOO?= , =?UTF-8?B?5YiY54Kc?= , =?UTF-8?B?5byg5aSp55uK?= , 96boards@ucrobotics.com, support@lemaker.org, Linux Kernel Mailing List , Russell King References: <20170606005426.26446-1-afaerber@suse.de> <20170606005426.26446-21-afaerber@suse.de> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Organization: SUSE Linux GmbH Message-ID: <6d9d0d63-113e-b050-a54e-62746ebc6013@suse.de> Date: Thu, 29 Jun 2017 17:22:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1903 Lines: 57 Am 29.06.2017 um 17:07 schrieb Arnd Bergmann: >>> +static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle) >>> +{ >>> + unsigned long timeout; >>> + int ret; >>> + >>> + ret = s500_wakeup_secondary(cpu); >>> + if (ret) >>> + return ret; >>> + >>> + udelay(10); >>> + >>> + spin_lock(&boot_lock); >>> + >>> + /* >>> + * The secondary processor is waiting to be released from >>> + * the holding pen - release it, then wait for it to flag >>> + * that it has been released by resetting pen_release. >>> + */ >>> + write_pen_release(cpu_logical_map(cpu)); >>> + smp_send_reschedule(cpu); >>> + >>> + timeout = jiffies + (1 * HZ); >>> + while (time_before(jiffies, timeout)) { >>> + if (pen_release == -1) >>> + break; >>> + } >>> + >>> + writel(0, timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4); >>> + writel(0, timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4); >>> + >>> + spin_unlock(&boot_lock); >>> + >>> + return pen_release != -1 ? -ENOSYS : 0; >>> +} >> >> This looks more complicated than necessary. Why do you need the holding >> pen when you have a register to start up the CPU? >> > > It seems you missed my question here. Can you please follow up, and > if possible send a patch to remove the pen_release logic that appears > to be unnecessary here? I do not have any documentation on these registers, only the downstream code that I forward-ported here. If you tell me what you mean exactly, I can do some testing and if it still works submit a patch to simplify it. Comments from the so far quiet Actions Semi side would help, too. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)