From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbdF2PHo (ORCPT ); Thu, 29 Jun 2017 11:07:44 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:34027 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753466AbdF2PHg (ORCPT ); Thu, 29 Jun 2017 11:07:36 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170606005426.26446-1-afaerber@suse.de> <20170606005426.26446-21-afaerber@suse.de> From: Arnd Bergmann Date: Thu, 29 Jun 2017 17:07:35 +0200 X-Google-Sender-Auth: ozHtaJ3ySIpjbU8rQkkyvk7d02A Message-ID: Subject: Re: [PATCH v4 20/28] ARM: owl: Implement CPU enable-method for S500 To: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: Linux ARM , mp-cs@actions-semi.com, Thomas Liau , =?UTF-8?B?5byg5Lic6aOO?= , =?UTF-8?B?5YiY54Kc?= , =?UTF-8?B?5byg5aSp55uK?= , 96boards@ucrobotics.com, support@lemaker.org, Linux Kernel Mailing List , Russell King Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> +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? Arnd