Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3478872rwb; Tue, 16 Aug 2022 03:57:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4rGxp/XrI0si6Bfon0P11UZAgDItGkYGXLFUT9lphyYetVOT8ESO7G5xNlwTPzMexRt7yd X-Received: by 2002:a17:902:d890:b0:16c:abb4:94d0 with SMTP id b16-20020a170902d89000b0016cabb494d0mr21795591plz.50.1660647449407; Tue, 16 Aug 2022 03:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660647449; cv=none; d=google.com; s=arc-20160816; b=KBuWC7mfbe5XjE68dWNJkURzGkbH69KdOM9XHbCcfbFArBoPDzEkEON6zyqTfIhmnq 02t3jiufq5aISrQyWcr5bUOMhJSa91BzA0yvYuHTRD0m5Q+/Y/VM2TO3ddAd1drfixr0 bE5Dk3DafKu9uUNMSopoTEOMTPLLMRmMTRZzNJ4+uE7P+ynstiW3JG6RHm2/6hSmgXQs wCjOsUQYhKrvSaKM+NNWSrXfXb8WowWeLw7ZA0yMe+T+ADv/uu+wcpEpEBgc3glh/TCV cv5f9IkrEjUyLR0M6DLcxY0xW4exMCWdjcvVHYZlie8/jMRGd4ICv2pH88eRr/KDrAPJ aLmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=OhMgZX7auIgkuBlZmd1o5pXnydvmuutKuznb643+nMc=; b=xdksQbPnIHPfsXvV+boyxTIgonPLMZHZsi0NrzsfL0aefiqR23aipJnUv4oF/n/BWF 0fYizy/BfP9tbpCorK/QCA4kCcZS1AtJ9NvzLRlknmORduiLFN5F8L7q2G2alhjhWuYY Xz/6esb+G9f3MGPccYwBQPdwFaRAcU77jaRA6Gs2evtE4TIUacvejst8EkC1vQXgVVkG ut3MfMpLL3IcNII1NDiJZpj42tYXl+Ou7k23CYilCZeyMHpVjr216mgHMrYDJtvBlvKN NQG2cWQ8JlJgc1CJHt0Qy7RI7DvElRVBwtcyc2OHjN4D0Y4kONrGUkVF5YqFViWPaaXg F4dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=xfxXIimP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NRYAcG7u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o23-20020a17090a421700b001f76ea8dd34si12297687pjg.74.2022.08.16.03.57.18; Tue, 16 Aug 2022 03:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=xfxXIimP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NRYAcG7u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234910AbiHPKjD (ORCPT + 99 others); Tue, 16 Aug 2022 06:39:03 -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> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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