Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170AbcJFOwi (ORCPT ); Thu, 6 Oct 2016 10:52:38 -0400 Received: from mail-vk0-f41.google.com ([209.85.213.41]:34207 "EHLO mail-vk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbcJFOw2 (ORCPT ); Thu, 6 Oct 2016 10:52:28 -0400 MIME-Version: 1.0 In-Reply-To: <20161006040139.GA17619@vireshk-i7> References: <1475272561-8446-1-git-send-email-mmayer@broadcom.com> <1475272561-8446-3-git-send-email-mmayer@broadcom.com> <20161005032509.GG4664@vireshk-i7> <20161006040139.GA17619@vireshk-i7> From: Markus Mayer Date: Thu, 6 Oct 2016 07:51:59 -0700 Message-ID: Subject: Re: [RESEND PATCH v2 2/3] cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs To: Viresh Kumar Cc: Rob Herring , Mark Rutland , "Rafael J . Wysocki" , Broadcom Kernel List , Device Tree List , Power Management List , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1423 Lines: 30 On 5 October 2016 at 21:01, Viresh Kumar wrote: > Thanks for accepting all the comments :) > > On 05-10-16, 14:04, Markus Mayer wrote: >> Is there an easy way for me to know via the framework whether init is >> being called for the first time vs. init is being called on a >> different core after a previous attempt to initialize on another core >> failed? >> >> I could use a driver-global variable for the driver to remember if it >> has been initialized, but that seems a bit hacky. > > You don't really need to have any special code here, specially for the case that > may never get hit. For example, if we fail to initialize something for CPU0, > cpufreq core will try calling this routine for other CPUs as well. I don't think > there is anything wrong in letting cpufreq core trying that. Why stop it or > return early? It wouldn't happen normally, unless there is a bug in there. During early development, when the driver couldn't fully register, I would see the init() function called four times, i.e. once for each core. If the first call succeeded, that was it. It would only get called once. But if it failed, all cores would try to register. And I wanted to avoid spilling the same error message four times. I'll look at that again. It may have had something to do with how the driver worked back then. If it doesn't happen anymore, I'll just get rid of this code. Thanks, -Markus