Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2837209imm; Thu, 24 May 2018 17:14:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq3bdNH9mL6NuAkx5Gn+K1SV+Dc0WyCJNAXTa8Oju4kFtUxWJyapBqSFVEHQjgfaibHG7gq X-Received: by 2002:a62:b204:: with SMTP id x4-v6mr155056pfe.21.1527207273087; Thu, 24 May 2018 17:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527207273; cv=none; d=google.com; s=arc-20160816; b=tP3nkVU99NzMedgIA6diNX8rqL+Hpet+DYf05otjLQa9X0F/c8lvAMhckRP6UxfU16 YAOCJoAg5CcoMGkNfalFhtjtZxFMYF+CM86dKB06+j5GZgC1SCdzz/gfgtz12+3Bpn0r MF+KAA3aYCHdTPeNzD3QOzCSObhITMcAYevMl9xkAAbwIlYf/YHRCSj35jedMVl6QhbC 4t5AoLdC3lwL/xp4qQ8cJiBGbhr+cTHjM7GlkGYgybwv6ZP/LuPRgiVWp3pzbn/yw4DX yP9vwyXR08zLQbARa6g8POzgbsWuQvWbPeeCUBPS16GZRp8xT7Tqpwr6+yseuqNe5br2 srAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=PvvOTeWgpM5d4cwCZWxoLL0dT0IalYl2IeOUsHsVnEY=; b=wGv2gBx5y8uS69Ll87+8m4iKaEdJCurJzZwYGJ78X0lT/QA7/LTaeoTRZSwIJiyGZg vMOoe/nlGnTgP+yicPIRuu99AXGQviKAv/ya2HyROXbC8HULzFDQSWvOvcW9f4fDHEqc MOl7wPL3Y4KfrFKTaEz9JC2FtOVwP0UWDMVPbQ6tjIL2IpgjMlIkrAbeNGtm7nntkEDQ wBY0v+FxP90LOj65Y6kIP8oJVmfCXvf2SHEYS56T6uhburN00cpz492rROZuWblrHA1V gff4BCEwPg1ArIHgH75sp0o7sH1gmJRsa0ZSVTKn8IpcxrRVmKJDH1Ov/TxkgM9SgpxP 0y5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=k1yK0UL+; dkim=pass header.i=@codeaurora.org header.s=default header.b=ACJEAgAc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si17845736pge.89.2018.05.24.17.14.18; Thu, 24 May 2018 17:14:33 -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=@codeaurora.org header.s=default header.b=k1yK0UL+; dkim=pass header.i=@codeaurora.org header.s=default header.b=ACJEAgAc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030362AbeEXOKt (ORCPT + 99 others); Thu, 24 May 2018 10:10:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50040 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967947AbeEXOKk (ORCPT ); Thu, 24 May 2018 10:10:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 795AA6090E; Thu, 24 May 2018 14:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527171039; bh=AhXuqrfXxOP27hhKnf0u2JGUc58Ne1I+/eybbrNumdY=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=k1yK0UL+o7uu5WLoN1fcssbYuPHOftexTh9SEhrDt01sShvTHoOe7WZXCEq/0AizP 6Q1o+OcJfjm505iLWNbkzZIiT2U37kpnGH/bKG3kNVBDrkdEnL7NOdu7SGEZYMO0E0 1HEEBzh5Kdt0T6PqmKARt+W8iIx27FqjRvkIp+R4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from ilial (unknown [185.23.60.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilialin@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4D041601E8; Thu, 24 May 2018 14:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527171037; bh=AhXuqrfXxOP27hhKnf0u2JGUc58Ne1I+/eybbrNumdY=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=ACJEAgAcR8G4aynh/IeG0Dfw0f1uyinvqqLGLfZLzLW7TXu04pohubdoSXy1G5OhJ Mfm1gRni5YIwoHRTEa1vcaZfwiDPT4bUm0I03vrsvlUiffEhEEf/0WdjaA/ymVuiiD NFioT/Cr1hc/hip9gyXQS1iaSjQ++dVpQ9XLeAfM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4D041601E8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilialin@codeaurora.org From: To: "'Sudeep Holla'" Cc: , , , , , , , , References: <1527152242-31281-1-git-send-email-ilialin@codeaurora.org> <1527152242-31281-2-git-send-email-ilialin@codeaurora.org> <860be68b-cac0-9efc-b3c7-cc75b391a4c3@arm.com> <000501d3f35f$96794910$c36bdb30$@codeaurora.org> In-Reply-To: Subject: RE: [PATCH v12 1/2] cpufreq: Add Kryo CPU scaling driver Date: Thu, 24 May 2018 17:10:32 +0300 Message-ID: <000701d3f368$fd31e410$f795ac30$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGZT1zPRN1vy0pjuCXFwimP3N8iDQLFSuT5Ahbt958CVipr1gDt4VB6pHMwwbA= Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for the explanation. However, could you suggest, which = condition should I check then? Device tree? > -----Original Message----- > From: Sudeep Holla > Sent: Thursday, May 24, 2018 17:01 > To: ilialin@codeaurora.org; vireshk@kernel.org; nm@ti.com; > sboyd@kernel.org; robh@kernel.org; mark.rutland@arm.com; > rjw@rjwysocki.net > Cc: Sudeep Holla ; linux-pm@vger.kernel.org; > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v12 1/2] cpufreq: Add Kryo CPU scaling driver >=20 >=20 >=20 > On 24/05/18 14:03, ilialin@codeaurora.org wrote: > > > > >=20 > [...] >=20 > >>> + > >>> + ret =3D PTR_ERR_OR_ZERO(platform_device_register_simple( > >>> + "qcom-cpufreq-kryo", -1, NULL, 0)); > >> > >> > >> You simply can't do this unconditionally here. This will blow up on > >> platforms where this driver is not supposed to work. The probe will > >> be called on non- QCOM or non-Kryo QCOM platforms and I reckon it > >> will crash trying to execute something in qcom_smem_get. > > > > What do you mean by 'unconditionally'? >=20 > Why should you even add/register a device "qcom-cpufreq-kryo" on other > platforms. Drivers can get registered, but only devices that are = present or > required by the platform need to be registered. >=20 > > The driver depends on the smem and nvmem drivers, which depend on > ARCH_QCOM: > > + depends on QCOM_QFPROM > > + depends on QCOM_SMEM > > >=20 > Sure, but we have something called single image for all ARM64 = platforms. > May be QCOM still used to tweeking config to build binary for your = particular > mobile platform but the distro kernel need single binary to work on = all > platforms. We have moved far away from platform specific builds long = back > now IIRC. >=20 > > And if SMEM read in the probe returns something other than Kryo, it = will > exit. > > >=20 > Check what this driver does ? >=20 > msm_id =3D qcom_smem_get(QCOM_SMEM_HOST_ANY, > MSM_ID_SMEM, &len); > msm_id++; > switch ((enum _msm_id)*msm_id) >=20 > I think it *will and should* crash here ? You need to check the return = value > for sure. But since qcom_smem_get return -EPROBE_DEFER, we keep > retrying even on non QCOM platforms which is something I would like to > avoid. >=20 > Therefore that's not the main concern. Why do I have to see = "qcom-cpufreq- > kryo" device registered on my non QCOM platform ? >=20 > -- > Regards, > Sudeep