From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7059CC32772 for ; Tue, 16 Aug 2022 10:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234941AbiHPKjB (ORCPT ); Tue, 16 Aug 2022 06:39:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234819AbiHPKit (ORCPT ); Tue, 16 Aug 2022 06:38:49 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30BF92B27A; Tue, 16 Aug 2022 02:21:06 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 8D2305C00A0; Tue, 16 Aug 2022 05:21:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 16 Aug 2022 05:21:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1660641664; x=1660728064; bh=OhMgZX7auI gkuBlZmd1o5pXnydvmuutKuznb643+nMc=; b=xfxXIimP3vKiA76KqsYsv4Bkat kSxGJqmiXPRBmc8729AnI4/OqKgSI5WloA2b27nl/Y0B9iQRu4UVWqdwYjLPSmbh X4tAZDPKXkD0RyBq7fm069/5aceGNkl1HMXJhJ1BN9wghNhyHNx89INwVJl3ldzU NscFrG/Ja+weLLcvQU4hOJxUu4+8ApiKoxB7J4+f/Tdz0cquvNLGU/VedpgfrG75 lQIlpqNdEONfxa3Z18WBL/9VQjUcHJADXHvZLYIetxqIw88GEDl11eMJdV3r3iRa a/jmbb4OFAh4+GW068nhEEv10nXtqzH0/rBpf5WI2j1q9x2HWAjDnP3xGeMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660641664; x=1660728064; bh=OhMgZX7auIgkuBlZmd1o5pXnydvm uutKuznb643+nMc=; b=NRYAcG7uxWwgU7F3BWUESvVCTM7SP5pGEFkQjOorYyYu FHLDot5AzJo260CjVoA/KpJH3h9ZrcJj9sdgn/leIrm1AAINVmJ5UCZXt001H+WJ I/67P8234bFJm8XrfYNJwF7CF4BrJlCfSwOgW0/Xwp8iL0SBoo5bDtWgL01Wu//C qEC3HXOpUXGWozg9MXvwf+K5/mHXGGvc2kywwVXPuuGPvto1NhAJIzyq0YryfEVR KQvyCtxKlGc5SNezdDlai+AuGpgTSouuHLHPgbdDGtefEoW1HxUvow4pAjdAXFCY q2gZf+HjpMVJkS1p9Mv5v42mefDkIBMm6OCBmqEBNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehgedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepheegvd evvdeljeeugfdtudduhfekledtiefhveejkeejuefhtdeufefhgfehkeetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Aug 2022 05:21:03 -0400 (EDT) Date: Tue, 16 Aug 2022 11:21:01 +0200 From: Greg KH To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, linux-api@vger.kernel.org, f.fainelli@gmail.com Subject: Re: [PATCH v4] MIPS: Expose prid and globalnumber to sysfs Message-ID: References: <20220816091258.9571-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220816091258.9571-1-jiaxun.yang@flygoat.com> Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Tue, Aug 16, 2022 at 09:12:58AM +0000, Jiaxun Yang wrote: > Some application would like to know precise model and rev of processor > to do errata workaround or optimization. > > Expose them in sysfs as: > /sys/devices/system/cpu/cpuX/regs/identification/prid > /sys/devices/system/cpu/cpuX/regs/identification/globalnumber > > Reusing AArch64 CPU registers directory. > > Signed-off-by: Jiaxun Yang > --- > v2: Drop static qualifier for kobj (gregkh) > v3: Use kzalloc to allocate struct cpuregs. > note: When Greg mentioned about static I was thinking about > static qualifier of percpu variable. After reading documents > again it turns out kobjs should be allocated at runtime. Arm64's > cpuinfo kobj is also on a percpu variable... I guess that was a > intentional use? > v4: Properly handle err of kobj creation. (gregkh) Nothing was fixed :( Again, please read the documentation for the kobject calls you are making as it explains how to properly handle errors being returned from them, and what you need to call if that happens. thanks, greg k-h