From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2DE079EE for ; Sat, 9 Dec 2023 08:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OYjoR3u0" Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7AE45424DE for ; Sat, 9 Dec 2023 08:48:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7AE45424DE Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=OYjoR3u0 X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.101 X-Spam-Level: Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vg2dTKi3Ug-g for ; Sat, 9 Dec 2023 08:48:31 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by smtp4.osuosl.org (Postfix) with ESMTPS id 672A64149D for ; Sat, 9 Dec 2023 08:48:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 672A64149D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702111711; x=1733647711; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BArBMRz+Uu5UuNs6uA3RiQFC97rd4SqkRdb+dYG43vQ=; b=OYjoR3u02cYbODohI4k+TGOe/sCWI3aRHtq+hYYuZPhEqLIGanrsTZ5k FKsUkTnuC+Kf90bfnwUmvncpMmrurznmAp7iKzKkhxrUQcBemZELuRbTv QxpFNyYs5d3fGnSFQisn1EAru9Mr1FYCLN7p1znDOZrHikI0QMjPoJVEU b02DaZQQN8G675x5UG52gU94PhvagqK+5AoYjDmcfQg9ltDIpLL0g/ef7 3GXUfMuMh7IhPC3/2DeaDym1ymFd1niaJrnpGgvOo6hfEhhJ1Bp/cVb1H faUK701spzedOc1rNgefU8yunHrnfLgGuNbXpp8skO3oC5T7idm1Rpxh7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="1573876" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="1573876" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2023 00:48:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="863150723" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="863150723" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2023 00:48:26 -0800 Date: Sat, 9 Dec 2023 10:48:23 +0200 From: Raag Jadav To: mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, rafael@kernel.org, lenb@kernel.org, robert.moore@intel.com, ardb@kernel.org, will@kernel.org, mark.rutland@arm.com Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com Subject: Re: [PATCH v3 5/5] perf: arm_cspmu: drop redundant acpi_dev_uid_to_integer() Message-ID: References: <20231123100617.28020-1-raag.jadav@intel.com> <20231123100617.28020-6-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: acpica-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231123100617.28020-6-raag.jadav@intel.com> On Thu, Nov 23, 2023 at 03:36:17PM +0530, Raag Jadav wrote: > Now that we have _UID matching support for integer types, we can use > acpi_dev_hid_uid_match() for it. > > Signed-off-by: Raag Jadav > Acked-by: Will Deacon > --- > drivers/perf/arm_cspmu/arm_cspmu.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c > index 2cc35dded007..50b89b989ce7 100644 > --- a/drivers/perf/arm_cspmu/arm_cspmu.c > +++ b/drivers/perf/arm_cspmu/arm_cspmu.c > @@ -1108,7 +1108,6 @@ static int arm_cspmu_request_irq(struct arm_cspmu *cspmu) > > static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid) > { > - u64 acpi_uid; > struct device *cpu_dev; > struct acpi_device *acpi_dev; > > @@ -1118,8 +1117,7 @@ static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid) > > acpi_dev = ACPI_COMPANION(cpu_dev); > while (acpi_dev) { > - if (acpi_dev_hid_uid_match(acpi_dev, ACPI_PROCESSOR_CONTAINER_HID, NULL) && > - !acpi_dev_uid_to_integer(acpi_dev, &acpi_uid) && acpi_uid == container_uid) > + if (acpi_dev_hid_uid_match(acpi_dev, ACPI_PROCESSOR_CONTAINER_HID, container_uid)) > return 0; On second thought, I just realized that this can cause false positive in case container_uid is integer 0. I'm not aware if that's a valid value to match against in APMT. If it is, it's better to drop patches 2 and 5 for now. Raag 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51FC9C4167B for ; Sat, 9 Dec 2023 08:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nne+1PhGGJAueR5WrcVKpaDmsbZNj0fPB6tI9eSX3h8=; b=StIasBukQNeHde 5KU5lDXs/+WWxsLIuUzUqRGLLY9BKJXEX/KCgBbqK93T1wLYChSeXE2ENdo8gW0LabTToGGRWN0cP o4hza76pasPdCwOscAhAoqlpUyYyUooVJRbtR23y0vVmthjGICgJZdIUejYLnUeVkJtsTUfRt6BTR NBZMG7xN3N6GRnRd9FlMH/i8l6Cd6GBnLzdYTShMqu6s7a0OYA510A0x4CKoWfhwi+JIqcz2ygla0 XcD2tjFm06mIhQlbxULU93/BOmXHrFd++tpHlRIQAF1rQtTr8nRVG1t+HCCaC83yz/N9Q0q6+TihE elQJvDmkLges+h294KFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBt0l-00HKpB-3C; Sat, 09 Dec 2023 08:48:35 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBt0j-00HKo7-14 for linux-arm-kernel@lists.infradead.org; Sat, 09 Dec 2023 08:48:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702111713; x=1733647713; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BArBMRz+Uu5UuNs6uA3RiQFC97rd4SqkRdb+dYG43vQ=; b=Vhr2g5Q5EytO85slPMJWfDmtQuIHpBVAhZNJhNSRrXS5ndm4Brwh0H41 0D4SJtozybgK0YubgTEVAbXnZ46CaYuVGi+lXfuAFTlQxJ1QzL1LH8Jv/ lrd62hWw1zscY/En6WJu8HQaflasox1AlY5yZra3Nx3o9DiwqDk94vcJt o5T36aIFoU52rACwW6q7ib7BTjRaenzjua4bP2roa0jhJnbaTgdAN5fbU uIBe787RsVMpNm50fVTWpuGM4KtRG0lviNUAQXREHkEfi0OI7sM2nsegw AK7ORmt/cmj9iN62zEuMpE6x16SRnq9Kj58T1m4ChX1R7Wt305Gn8oaRj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="1573880" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="1573880" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2023 00:48:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="863150723" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="863150723" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2023 00:48:26 -0800 Date: Sat, 9 Dec 2023 10:48:23 +0200 From: Raag Jadav To: mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, rafael@kernel.org, lenb@kernel.org, robert.moore@intel.com, ardb@kernel.org, will@kernel.org, mark.rutland@arm.com Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com Subject: Re: [PATCH v3 5/5] perf: arm_cspmu: drop redundant acpi_dev_uid_to_integer() Message-ID: References: <20231123100617.28020-1-raag.jadav@intel.com> <20231123100617.28020-6-raag.jadav@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231123100617.28020-6-raag.jadav@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231209_004833_415859_0EF1ECD1 X-CRM114-Status: GOOD ( 17.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 23, 2023 at 03:36:17PM +0530, Raag Jadav wrote: > Now that we have _UID matching support for integer types, we can use > acpi_dev_hid_uid_match() for it. > > Signed-off-by: Raag Jadav > Acked-by: Will Deacon > --- > drivers/perf/arm_cspmu/arm_cspmu.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c > index 2cc35dded007..50b89b989ce7 100644 > --- a/drivers/perf/arm_cspmu/arm_cspmu.c > +++ b/drivers/perf/arm_cspmu/arm_cspmu.c > @@ -1108,7 +1108,6 @@ static int arm_cspmu_request_irq(struct arm_cspmu *cspmu) > > static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid) > { > - u64 acpi_uid; > struct device *cpu_dev; > struct acpi_device *acpi_dev; > > @@ -1118,8 +1117,7 @@ static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid) > > acpi_dev = ACPI_COMPANION(cpu_dev); > while (acpi_dev) { > - if (acpi_dev_hid_uid_match(acpi_dev, ACPI_PROCESSOR_CONTAINER_HID, NULL) && > - !acpi_dev_uid_to_integer(acpi_dev, &acpi_uid) && acpi_uid == container_uid) > + if (acpi_dev_hid_uid_match(acpi_dev, ACPI_PROCESSOR_CONTAINER_HID, container_uid)) > return 0; On second thought, I just realized that this can cause false positive in case container_uid is integer 0. I'm not aware if that's a valid value to match against in APMT. If it is, it's better to drop patches 2 and 5 for now. Raag _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel