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 3CF39C27C79 for ; Mon, 17 Jun 2024 10:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8rLc3bNyAEHaD8GrCxC5nogOkwuQZXP8uI3+OgIG0Gw=; b=PunFNRnaadPRpNIK4Qd0kPrMJ2 Ng48IdH/Fghox/jciouJXqBmP157wui7eQwTd0X/gEwKLzRffGFwirSs8K5jRHtevlYyLOg3UCY68 d5fx+uP+tfR6FB34TAZwW2yH8lbUXS3wbGPE1MwpOivQenw0b9WWW8hRex8s2BF5kTruiFaNr5roI 6Rp/4NE8WnOyGybcICr+c/Q+ApYqCPqFdgArU4MfRlYIyDMw0ZZB2YX3Yq2ygGDz9iO6t5c4k8XSp YmOMktHUWxf4TQqQ7fG06X4g3kSCxKiQ83Yfaf1TgZn3A1M16Xhg/YF02HAJAElG3XxLBnm50mOA+ pEpj2CEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ9mG-0000000AIJ2-2roh; Mon, 17 Jun 2024 10:39:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ9mD-0000000AIIQ-2tBV for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 10:39:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B5115DA7; Mon, 17 Jun 2024 03:40:16 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29D473F6A8; Mon, 17 Jun 2024 03:39:51 -0700 (PDT) Date: Mon, 17 Jun 2024 11:39:48 +0100 From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: alexandru.elisei@arm.com, catalin.marinas@arm.com, maz@kernel.org, will@kernel.org Subject: Re: [PATCH 2/4] irqchip/gic-v3: make distributor priorities variables Message-ID: References: <20240529172116.1313498-1-mark.rutland@arm.com> <20240529172116.1313498-3-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240529172116.1313498-3-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_033953_791294_B28EE2C6 X-CRM114-Status: GOOD ( 11.73 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 29, 2024 at 06:21:14PM +0100, Mark Rutland wrote: > In subsequent patches the GICv3 driver will choose the regular interrupt > priority at boot time. > > In preparation for using dynamic priorities, place the priorities in > variables and update the code to pass these as parameters. Users of > GICD_INT_DEF_PRI_X4 are modified to replicate the priority byte using > REPEAT_BYTE(). > > There should be no functional change as a result of this patch. [...] > - writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i); > + writel_relaxed((u32)REPEAT_BYTE(priority), > + base + GIC_DIST_PRI + i); Sparse is unhappy that this throws away the upper 32 bits, and begins producing warnings of the form: cast truncates bits from constant value (a0a0a0a0a0a0a0a0 becomes a0a0a0a0) I can fix this with: writel_relaxed(lower_32_bits(REPEAT_BYTE(priority)), base + GIC_DIST_PRI + i); ... but that gets a bit verbose, so I'm going to add a REPEAT_BYTE_U32() to and use that here and elsewhere. Mark.