From patchwork Wed Nov 23 08:56:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Pagani X-Patchwork-Id: 24803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2673059wrr; Wed, 23 Nov 2022 01:01:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4534aXRPmIcpPlKgH8GpAz7cSFjEiANi5cVI2hJk7kRU7m1kOFZd9Kl2jVZgsdNXJ9lObS X-Received: by 2002:aa7:d88c:0:b0:468:ffca:6982 with SMTP id u12-20020aa7d88c000000b00468ffca6982mr22119596edq.282.1669194070622; Wed, 23 Nov 2022 01:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669194070; cv=none; d=google.com; s=arc-20160816; b=dHacyF0fLYcCwq8VI9+8ca1IA25Tr9Ps73oWvurtGIUboMeAmMoY5xw0+LkaARSr+l ivqvP0P9s8lVdLZ5F70/6o+frbT30+bw9LajVNRm7e4x38Oba11GUEPyK9YoAs2kJpiE 7doQszED1f6nEunwYgcVUHhIGBis52pQZCufzg3MGCiCgBiBInULeTrP7tCYTpUnVQi3 4EqSESUa+Gv9kq2onx/ZB8p/hkMYqRAhz85ypiq2mEBCnO0/seeKI8fz/C30/5AfU//v xOz8ojcfbtP/U5Ew2hU9DEaRLHEPSh1haqzG58C3K0qqMvYWS15Q9ua9Dc3KI9ujMIEw p4Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nznTvXnBCa/8GStBK6Y61dElxd8Nw2xcab+uDMFbqOc=; b=nQROeToNRRWOkBXkSIZKfcMIIEu4jo50xPQA3NKi/TSt/k4I51P+yhlnUJxHAcjlEz nRzEzZZTGPxK8zSdVM8v1pPdvvaCXMCoPEtMYg0TULeme0kuewfKWgFh+CVUnw5+0Pvj 7B1lNgCmazcri6mUzihnU1AP6YuLCYc+ddj9ii890uLXm9KawxhqaM0+lPmG3NUP7pq1 fSI76xghYY/4HC8f7Rnyv1y+kmTjTmjLHrk1N2s67LBCQrMEBwmDnwFf8pWAaR8swMDY BBe7brM7DC3GT7odMDESAtb6hKetwmh3UH2y9czYH6AT/vSih8pynRYi8mudQY5UY9oC laFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DbjeZvRW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a056402441100b00458b71488bdsi15246450eda.388.2022.11.23.01.00.46; Wed, 23 Nov 2022 01:01:10 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=DbjeZvRW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236857AbiKWJAc (ORCPT + 99 others); Wed, 23 Nov 2022 04:00:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236858AbiKWJA1 (ORCPT ); Wed, 23 Nov 2022 04:00:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CFDE1001FC for ; Wed, 23 Nov 2022 00:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669193974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nznTvXnBCa/8GStBK6Y61dElxd8Nw2xcab+uDMFbqOc=; b=DbjeZvRW2wxRj76bldeiWoUUumupMh6U91vx/1MQjlTIs4MyDTlM3IJsnhnZuCPUbxXVE4 xCHi7AnDyOGcxWmidgca/hNp18CvOfDVJ2x4PqcvDf0EKNk5hf9opf9Bc1xHqm+sOwacop oxIZyDG7n+arZktX8uhszzchr5SUGUA= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-338-3n9aylo2PgOJZE7hyyIkDA-1; Wed, 23 Nov 2022 03:59:32 -0500 X-MC-Unique: 3n9aylo2PgOJZE7hyyIkDA-1 Received: by mail-ej1-f71.google.com with SMTP id sg37-20020a170907a42500b007adaedb5ba2so9601639ejc.18 for ; Wed, 23 Nov 2022 00:59:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nznTvXnBCa/8GStBK6Y61dElxd8Nw2xcab+uDMFbqOc=; b=fanP80VPtDXGDjs6LfQrzOdrGD5Q+XIMTiqdC8C1yiE87kI5wuk1epNHKgClPgVOU+ M13ywc8WE9MUud0v820hKGQFEFZ845ofTjzMN5Rk6ksalQaLvzxqFhE5jGWK79qbyVAz GNij58vZsioqfuL7RSBDAujJCvRirqWiU4UdvadO1wVj+nqd2EZx8nMTZEw5h2028MJS LTw0FlZoIGs+mRJHHIw9e6eGKSp1FuptCnEOyjGOQTE+U5Ul+TWRYMf0YX1NrcPecBk/ Z2krr8+8LUt7tJYxAtIo9VVksD5kCwkuIGe9fbGiF42UVjb+xjUmG6imZi/FnW8Dt8if UsQg== X-Gm-Message-State: ANoB5pm+LSpof6ekOvhtEA1cnzytxJze6XuZgzGeYc7/k//pKyCzSU3Q 2+KMFzv7Fpo3XtKraVCgOv5SDoTVQuGc+5fGrgs+0pRc4epBNXtRp0kaSCWWq96pwWy8Y+7QMIf ZNCEhNjcMV6TyglQCwjv3cts= X-Received: by 2002:a17:906:b51:b0:7ad:da22:c396 with SMTP id v17-20020a1709060b5100b007adda22c396mr23388639ejg.653.1669193971823; Wed, 23 Nov 2022 00:59:31 -0800 (PST) X-Received: by 2002:a17:906:b51:b0:7ad:da22:c396 with SMTP id v17-20020a1709060b5100b007adda22c396mr23388621ejg.653.1669193971521; Wed, 23 Nov 2022 00:59:31 -0800 (PST) Received: from klayman.station (net-2-34-28-144.cust.vodafonedsl.it. [2.34.28.144]) by smtp.gmail.com with ESMTPSA id k21-20020a17090632d500b007ae32daf4b9sm6951686ejk.106.2022.11.23.00.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 00:59:31 -0800 (PST) From: Marco Pagani To: Oded Gabbay , Arnd Bergmann , Greg Kroah-Hartman , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: Marco Pagani , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] habanalabs/gaudi2: added memset for the cq_size register Date: Wed, 23 Nov 2022 09:56:39 +0100 Message-Id: <20221123085640.103084-1-marpagan@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750276841987003485?= X-GMAIL-MSGID: =?utf-8?q?1750276841987003485?= The clang-analyzer reported a warning: "Value stored to 'cq_size_addr' is never read". The cq_size register of dcore0 is not being zeroed using gaudi2_memset_device_lbw(), along with the other cq_* registers, even though the corresponding cq_size_addr variable is set. Signed-off-by: Marco Pagani Reviewed-by: Oded Gabbay --- drivers/misc/habanalabs/gaudi2/gaudi2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/habanalabs/gaudi2/gaudi2.c b/drivers/misc/habanalabs/gaudi2/gaudi2.c index 65e6cae6100a..05f30adefb32 100644 --- a/drivers/misc/habanalabs/gaudi2/gaudi2.c +++ b/drivers/misc/habanalabs/gaudi2/gaudi2.c @@ -9165,6 +9165,7 @@ static void gaudi2_restore_user_sm_registers(struct hl_device *hdev) gaudi2_memset_device_lbw(hdev, cq_lbw_data_addr, size, 0); gaudi2_memset_device_lbw(hdev, cq_base_l_addr, size, 0); gaudi2_memset_device_lbw(hdev, cq_base_h_addr, size, 0); + gaudi2_memset_device_lbw(hdev, cq_size_addr, size, 0); cq_lbw_l_addr = mmDCORE0_SYNC_MNGR_GLBL_LBW_ADDR_L_0 + DCORE_OFFSET; cq_lbw_h_addr = mmDCORE0_SYNC_MNGR_GLBL_LBW_ADDR_H_0 + DCORE_OFFSET;