Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp285775rdb; Mon, 22 Jan 2024 04:19:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAZLMtlhcm21DPFD3v3foGbMZIzJpcnMHYXpJJSR1Qdq1BRK1mxtDZTPQYoBaxv5aL4jY/ X-Received: by 2002:a17:90b:815:b0:28d:baad:aa41 with SMTP id bk21-20020a17090b081500b0028dbaadaa41mr1226438pjb.18.1705925990812; Mon, 22 Jan 2024 04:19:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705925990; cv=pass; d=google.com; s=arc-20160816; b=zhx/FMpq7pdRHmOB2gX1i7ciVqQ8cgGEnxc1Nbb9Rx2nJkBnOlknfqWvWp1j7quWTO Hjj7piXAFR3Dsy+5gS6lScTLAXoydyT4z4EMoR7/kbpux7WRg0tG0K1y+pQf0u9Exwl7 ivHR82ks2PSkcF7AtwoE3W1LoeowxlkR4l618r6SqynifkRm4fQnItNdkb+PLo5cwLU0 m0GNHNPzaqzVbhqYVwEHxyQuS7k7uV/6c+sHfzgBfaUFhVlTFe35PTTfu4A4ZvQT7b2O RvBGce4zCkVbqI7/SSehPz/Yp/xVhbj7mJHEs7L+47PTZ8ZOpSpuEzLGfF5vY0c547uj SNNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=riQqxqcCMG9kFQapL/gNYoUtbP5fQJDMoi01u205GP8=; fh=+Dj7Fm9+4LcQbF/oddv8Y5rnAye8SsB/37vQhmGW9Pw=; b=zyO7WT5Yn3zJw3nIm0G6hSHcH+2ZguFwNi55r4c+KT1aQYdel+ykHx2PC1uZCtjPEW TqoZ4QFzFgGW9HOB0HzPfkVQFlvSc6JuvmxQPCRWFCIjpvIApGPsPHm3W6NfAbwGlmDc Y1DAODPQP3h8ARoln5FYplNBYHi5X0rD00ykEhare/ON3374K26IaCu0bIsIY4FKyTWR YRf76+LmHNVedrBUegSWQG1gsTraUEuP80Ci9/x6L3qbTk6rKhXtjR2XaZ1ZNbMTfBK6 QIjKuR392MG+85YYW1IJ+lbZXRSqaJupX52Xb6Z2qBtWsx9t1EQzQ2ROxfKEVE3tQ2fQ DMmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZmZLyxD1; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-32917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w2-20020a17090a1b8200b0028ff71b108dsi8037247pjc.40.2024.01.22.04.19.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:19:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZmZLyxD1; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-32917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 679ED295661 for ; Mon, 22 Jan 2024 11:35:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3E2F3E481; Mon, 22 Jan 2024 11:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZmZLyxD1" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 84ADF3E47C for ; Mon, 22 Jan 2024 11:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705922732; cv=none; b=rjVuEzpN3/tKcTegtWXXK6OK1M9C2h82QG5sShrG6XCe8rCVX8pBB9UPRL1tKkq57FVxcN+ZhfyUAquZzOtqFi2I1cS36BCi2z5ju7JaVllDqLJOPjDttEUPaqr6RLhJ7qnMQqEtga2E13Lf+sJQkxI6E/2kmr/n87URFyuCYos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705922732; c=relaxed/simple; bh=yXc/8XLOOLR6Z9plLFl2z0OyNMPhY1UIiDGVUTzvafo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S4iNtG2cu+UgNpQNDH3dp8qopknPQly7vndznW/VKaKW1lHMovaH7MHJAQRCLwMHJJr6tZmIXfqZTjOE2sHtfr3vHVrPVHCNA4Oj3hK2C3u274dRuV+kOKF0GHhGYMGWp5nZoqvPVjKjVtgSyHGtF4ejBAjJ4VD3OzZYGSM7Npo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZmZLyxD1; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705922728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=riQqxqcCMG9kFQapL/gNYoUtbP5fQJDMoi01u205GP8=; b=ZmZLyxD1l7+xm7jnYnOyo2sM+VsQKj0hxsNAsE8HQXxJQ1mGIsruwU2uWgejrgJw2pAe7V PH+45HXaQsjtyIa/z3kxSl2Si4dMmOinsOrJlZjaP+sqOPfAuCAjXgtmt0Kkv/w8uPnW3O IqeC8li9NNghZG6ZZNfxNH7993aTf4o= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-457-_ud-2dD-MIOk4mScLrS1nw-1; Mon, 22 Jan 2024 06:25:26 -0500 X-MC-Unique: _ud-2dD-MIOk4mScLrS1nw-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a2ecf1de44fso101354866b.2 for ; Mon, 22 Jan 2024 03:25:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705922725; x=1706527525; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=riQqxqcCMG9kFQapL/gNYoUtbP5fQJDMoi01u205GP8=; b=uRkO4hkNGJjFJi2C7UrYdbs4aeRxpfCq/cCdvNx1sTkpXr8Wby+1LyKuNZm/MvMjay yAsPDyE8wvV4eWGm2JEOhwMT3EihH1YLZlpgOant5t26O2qeZJZk0mOEzvJ2SLrvoo6M /UU25ElfsgUKW1FwKKuaO44GFDk/iYk1yGet3N4uBFsEHVCVhh07YKOf/yKOkpJEw8jf hnmTn0sRDiB1Qr2H+6BbfEtuGYlzDOUwi2k4L9Auybyd8r44HqRqQmWc5MkoXiNMZem9 8g5lEprXSRZaijz3Aunskn1g0PYwVPebjprB6wiHCgguFmG/k3igSEgViO+fCkYrA+v1 041w== X-Gm-Message-State: AOJu0YzDkeRrJhhDD3lYOFulpWi8QvI0g/C2TS6fMcb9WRavX5GAw+mX t0y5Tnxf1wYe25VQ0OuQBXhkA/WYdNuATf5LXVAjj8BZYaqioGGZVuC1Q7MsupSoPBYqTgRTnuk otzwyM2Tpp3QyxijKesRMdghtrq2VA66+QUHRNrHzfoR56UlbqdJ/7FkMwqSyDA== X-Received: by 2002:a05:6402:3551:b0:55a:4c93:5f18 with SMTP id f17-20020a056402355100b0055a4c935f18mr2395877edd.56.1705922725771; Mon, 22 Jan 2024 03:25:25 -0800 (PST) X-Received: by 2002:a05:6402:3551:b0:55a:4c93:5f18 with SMTP id f17-20020a056402355100b0055a4c935f18mr2395872edd.56.1705922725450; Mon, 22 Jan 2024 03:25:25 -0800 (PST) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id fi6-20020a056402550600b0055c38f3ca66sm1057376edb.29.2024.01.22.03.25.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 03:25:25 -0800 (PST) Message-ID: <866474df-04b4-4b60-87af-6add6b80db5a@redhat.com> Date: Mon, 22 Jan 2024 12:25:24 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/1] platform/mellanox: mlxbf-pmc: Fix offset calculation for crspace events Content-Language: en-US, nl To: Shravan Kumar Ramani , Ilpo Jarvinen , Vadim Pasternak , David Thompson Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <8834cfa496c97c7c2fcebcfca5a2aa007e20ae96.1705485095.git.shravankr@nvidia.com> From: Hans de Goede In-Reply-To: <8834cfa496c97c7c2fcebcfca5a2aa007e20ae96.1705485095.git.shravankr@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 1/17/24 11:01, Shravan Kumar Ramani wrote: > The event selector fields for 2 counters are contained in one > 32-bit register and the current logic does not account for this. > > Fixes: 423c3361855c ("platform/mellanox: mlxbf-pmc: Add support for BlueField-3") > Signed-off-by: Shravan Kumar Ramani > Reviewed-by: David Thompson > Reviewed-by: Vadim Pasternak Thank you for your patch/series, I've applied this patch (series) to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in the pdx86 review-hans branch once I've pushed my local branch there, which might take a while. I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle. Regards, Hans > --- > drivers/platform/mellanox/mlxbf-pmc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c > index 1dd84c7a79de..b1995ac268d7 100644 > --- a/drivers/platform/mellanox/mlxbf-pmc.c > +++ b/drivers/platform/mellanox/mlxbf-pmc.c > @@ -1170,7 +1170,7 @@ static int mlxbf_pmc_program_crspace_counter(int blk_num, uint32_t cnt_num, > int ret; > > addr = pmc->block[blk_num].mmio_base + > - (rounddown(cnt_num, 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ); > + ((cnt_num / 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ); > ret = mlxbf_pmc_readl(addr, &word); > if (ret) > return ret; > @@ -1413,7 +1413,7 @@ static int mlxbf_pmc_read_crspace_event(int blk_num, uint32_t cnt_num, > int ret; > > addr = pmc->block[blk_num].mmio_base + > - (rounddown(cnt_num, 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ); > + ((cnt_num / 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ); > ret = mlxbf_pmc_readl(addr, &word); > if (ret) > return ret;