Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1355906rdb; Fri, 16 Feb 2024 13:05:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU3jQd7CalKaEMx8YrMI+BJJ9Tec6aYTlUEn/JVRFspg+y+iwkOwQa4xREJor+0bIr8QVIiqJWfkZygROTTGzHWQh2SYC7HYYqv3XNwBg== X-Google-Smtp-Source: AGHT+IGKITZ9ZPPqCIpIzSqrfkbqkfiaeu4xUc7EeanOjNBC8LHfPAqlSO2fmKW8wsOCnCKuIQ95 X-Received: by 2002:a05:6808:3192:b0:3c0:3c85:1ca4 with SMTP id cd18-20020a056808319200b003c03c851ca4mr7564827oib.1.1708117535552; Fri, 16 Feb 2024 13:05:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708117535; cv=pass; d=google.com; s=arc-20160816; b=Q32QM0TWeOaOBHYU7L19JYbmWwqKcNBfWaUdvBQz0eVb4FGPROHHJIopos3hD4d8M8 plkirZsT+LdoTOT643LAuQ+IPidGdba38wWEhtIP4osjE1Xl9qeUDGuQGee8ghKHDkqL oIBkl4uYnPIw+NS2EMVFyl5YlUJnA9k77sVH5YGVWrQEU6ykXAJNkR59xg3Qkh/k/4hx XBr6YD/znItNP6zhCD8v+XGwZnAzAgWs5AYeW5J6fL0JVcrtqKxQPqzi22NyaPAEALZ2 XGA3h3/Wch3NqE7alKtD5T9GQqJKhnM9GSsjVJqKihZOCWXi26ID4IArhZqnqe2mlkeK zC5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=aPil28lXVu/5EuMTMJHAF2NuE7S20nDRKRUxcPw2x9A=; fh=rCriQtwhQmVS08jLZJl9ivITmgScFIQvSeqDaPufk2o=; b=rs68MCwc8XF/QzF4PO2axNjKN09edmGykiz0zoYjP5sbgXNbffWV0pkWhfdwTxcw16 H0N6Xp17gRxV4uflFzv4pSmScZh1qhfPPhynIQnHzdLHwSYgeEeTI2lq/yj6Z+Zt8qBM 7Dd5vF0VCJZxsS7U1BbiuCRRCrXKOUtzshjirKPAMTaT49h4Wz3HOPOOsfTFKGMH4joS APM2/MqWDSs5Jemadij74GQnmge+kWfidziRadWRh2rpQeLxudsiqFfENg1FA+UqaCie sTsNAo9du1OuWbnAWFN5G7TmJhZcNfQ/ZfPyadJoHCNu0lPK967bWsLWvenbl5TFtdx3 ROjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=09tYLByR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=sTHsysm3; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-69345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iy7-20020a0562140f6700b0068cd84a4d53si822001qvb.44.2024.02.16.13.05.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 13:05:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=09tYLByR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=sTHsysm3; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-69345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A72941C26974 for ; Fri, 16 Feb 2024 21:04:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A1B712CDBC; Fri, 16 Feb 2024 21:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="09tYLByR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sTHsysm3" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 3967F145B13; Fri, 16 Feb 2024 21:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708117447; cv=none; b=XFagkPgZTvWKMx38WIufHi007H+N+g2CmhV48lSUq2S8UP/ua5/98uUBXLg8hsLvlYQO8QAtmqXe57wflGN8dlhlSfuX/pwkcD8XwWJRgPmpzfy9abRkoLml3Ty9Niky8/D4Tnr6e9YIVFXYvaMH1YadnSl307xsbRLN8JZyh40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708117447; c=relaxed/simple; bh=2HGv2SAPNP/8SNhuPL7jV7rNyYJBGuWopRtV7aLEqMM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=pkf9Ekz/V8TWMeNcNaXeYlx2twoDzdgLkEPulmX7DnhlzkcRUkwKyccTA0Xoc7i1gpsT4vzfrnoYpK8beDnez47dFB5eaLfPjUfN6YYe5I5HGivJwLMAu1srzLqS59YAPtCNyzZ2eH5i4y9N0R+M+WyKBSK/9Gl2jEnVXcbRZVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=09tYLByR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sTHsysm3; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708117444; 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: in-reply-to:in-reply-to:references:references; bh=aPil28lXVu/5EuMTMJHAF2NuE7S20nDRKRUxcPw2x9A=; b=09tYLByROgD3bDLYAoILh20drVnloPdm8qHaCVHSa8YslAkk+vHe5GCMRqEPgmXapRXwp7 haMLpBFhy7xqoxZcqtyf08Ob2ZjGCB9hHnx50L0qLeyomv7uwZvRwLH5+eCY0q2Kl3SlS8 wMobBVNcDkGtumiuGA36kP32BR/n7Od+jQT19U9Hk6sC/MdjnDn31ojtc+Xf3o707kLWlw hJHDBj443oH4lxAbBirQ48SRQP4as2LG7Q3yN3yRzLeFpVFJFq5MfBoxZW7EXofWFsaCyK Owe5hwIfmeW55ddNzU4jbNTyfHMS0Z8JV9K5LFqZln4wBoUDprmPjYu1DfgFbQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708117444; 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: in-reply-to:in-reply-to:references:references; bh=aPil28lXVu/5EuMTMJHAF2NuE7S20nDRKRUxcPw2x9A=; b=sTHsysm3f+56VNyke1nWTeQXTpJX/RT7U3ejiMXUtOjW65iwO9Uv6f1hJoBVOWapBEc/Mk 3esMRQST3WxV1PBg== To: Anup Patel , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley Cc: Marc Zyngier , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Atish Patra , Andrew Jones , Sunil V L , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: Re: [PATCH v12 23/25] irqchip/riscv-aplic: Add support for MSI-mode In-Reply-To: <20240127161753.114685-24-apatel@ventanamicro.com> References: <20240127161753.114685-1-apatel@ventanamicro.com> <20240127161753.114685-24-apatel@ventanamicro.com> Date: Fri, 16 Feb 2024 22:04:03 +0100 Message-ID: <8734tsce9o.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Sat, Jan 27 2024 at 21:47, Anup Patel wrote: > We extend the existing APLIC irqchip driver to support MSI-mode for > RISC-V platforms having both wired interrupts and MSIs. We? Just s/We// > + > +static void aplic_msi_irq_unmask(struct irq_data *d) > +{ > + aplic_irq_unmask(d); > + irq_chip_unmask_parent(d); > +} > + > +static void aplic_msi_irq_mask(struct irq_data *d) > +{ > + aplic_irq_mask(d); > + irq_chip_mask_parent(d); > +} Again asymmetric vs. unmask() > +static void aplic_msi_irq_eoi(struct irq_data *d) > +{ > + struct aplic_priv *priv = irq_data_get_irq_chip_data(d); > + u32 reg_off, reg_mask; > + > + /* > + * EOI handling only required only for level-triggered > + * interrupts in APLIC MSI mode. > + */ > + > + reg_off = APLIC_CLRIP_BASE + ((d->hwirq / APLIC_IRQBITS_PER_REG) * 4); > + reg_mask = BIT(d->hwirq % APLIC_IRQBITS_PER_REG); > + switch (irqd_get_trigger_type(d)) { > + case IRQ_TYPE_LEVEL_LOW: > + if (!(readl(priv->regs + reg_off) & reg_mask)) > + writel(d->hwirq, priv->regs + APLIC_SETIPNUM_LE); A comment what this condition is for would be nice. Thanks, tglx