Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1670000rda; Mon, 23 Oct 2023 22:32:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEKcC9rZNOBGR/Xn2YXch0Tjzi97ytkDlKrA3A5qJnmn20waAx8BAVB4BV7t8WiNFderA5 X-Received: by 2002:a17:902:e5d0:b0:1c9:d236:b2b with SMTP id u16-20020a170902e5d000b001c9d2360b2bmr18149428plf.12.1698125531730; Mon, 23 Oct 2023 22:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698125531; cv=none; d=google.com; s=arc-20160816; b=d/J6gqcSJyIMl1S9GjQpaB6UPn66GCe9CnjdGvSihm0cI3jlVC/A8nRg+1euZvYzLK 7G5mNQIE6KgpUR48r/0746Td/rLTW+S2PvMCi4o3kS2DW1kPIQzr4h5FuB3hNCvPpijA JE1MdEQcCXTF4QpNXX7hE9GqbJSNP32d6sBlhU8GO3qaHTG+HxjsrdAH1MFGJjUV4vyT wP8if1OnXfw0ljnznjVbZOvyrAJzqhEw2FVMf7kf3eYW2kAmr3X79yYUgMPu8zBZkwcp RXxl22UpySVdtSwEqckTu7XWTp7lemF7vPvhmSju/Em4BETcG+5Nu5vAN7V/hz3aKJgt sdUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TMgZBMWXzo4q6vwznsY5I4wwZsoXDFPKydTpbp5gDQw=; fh=Fb9rbdiZ7DDTkpeobI2hIA6xe/roqTTF2BHgVr/tBTk=; b=IVP7Fudu3Cv8mpnAtDRHeRI15MDqLnnHnTPXVfwZKdjxnq9EeYm5kC6fElxWiNsreV kmiK80Pze9UVz3nq++ouregUaddbkincqoxF3t5i4vQJHOVTNXKvUNy9je9R6oigBjWM wSmxq9aVUJB6S3calyytCjzGfRJtnbJvx4VB3yYciCop3uAuDMykJrPJzd9NvjVMC33z 6oU4DPn0cfY0z2974kIcY2r9tkxe6UDBRZBmqNxW4kRtAXir6Hb2TKXv2OpiPSeqC4t7 ZF6yu60qaJVkh2xWUCxoGI/LMRC/S0uvtG51D1lEyxc0aXoRtWGjNNCUc5SHa+gvqXNl 2QfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=JKroqlfc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q123-20020a632a81000000b005ad8009e304si7961950pgq.784.2023.10.23.22.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 22:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=JKroqlfc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7830E805B206; Mon, 23 Oct 2023 22:32:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbjJXFb6 (ORCPT + 99 others); Tue, 24 Oct 2023 01:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232051AbjJXFb4 (ORCPT ); Tue, 24 Oct 2023 01:31:56 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06CABE9 for ; Mon, 23 Oct 2023 22:31:55 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6bd73395bceso2992312b3a.0 for ; Mon, 23 Oct 2023 22:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698125514; x=1698730314; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TMgZBMWXzo4q6vwznsY5I4wwZsoXDFPKydTpbp5gDQw=; b=JKroqlfcHG8a6N6YvGdwfOhxawfooodjYM0sMf7u1n2XvdJKgBRVvlXS303QotoGo8 XgJVqiLnq9Qy/W6lpRtsp2rPHRX7g+d5DEpLykgIkHlrnD0KmYt3BJFJ7FvHhm7EHcao DLFJaIHXHQkXR32FiQXVPsRUzkjojKN5IK27jqP9+4eqV3B/pCk25ucgPEe4q7NGCSb1 l7LDZoQEm/1zeGWiVeHuimbZC8KTg1SKU+yhGBEEVZghGfcQ2kTMRbo4stf8vSO4rq1n o2r2nGy/kKMgIaumLtBvfPZHe5ZBNyiiFzZrMczFzSTaujCiYHdNBRjczMI785zEWFZD o/8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698125514; x=1698730314; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TMgZBMWXzo4q6vwznsY5I4wwZsoXDFPKydTpbp5gDQw=; b=v7etYk6I48BeJCUZjarMQHbXgPOjzIWY2L5NKJQ9EaavRCu5OYytVthH7IfKrwotrB lE8e323iNTbPU6H0/XEBKhZkkhZzT2tI5ivK3d5gKnxQPk7MmHaoy4mYxcjeAI4yvaJA rMRk5LCB5yXAyJ/fMb8Jr88OsXQoZVzUuw1VVN7y9+MHVYtzdkrAxkG7tQhnFt+aiF2H VDNys+JxL3gCwv5JYjZCFthLQjaiZ6rdHTHyEw8MQhiC0M6J6hGrEamWWjZ1NRn308fR alQw7hxgUpec6OU2KkbphEKIfMSae07VsrWV6zK0YTU2D+c95oRcEzvmrjoXoFf9Dp51 DuMA== X-Gm-Message-State: AOJu0YxAe5n+nIB3XnZeSOriw1LvL1iwhuPSI4Ue16BJnqFoCPp6Omem Rlay6b2GDjITFIdsD/JGumaEVQ== X-Received: by 2002:a05:6a20:7348:b0:17b:2c56:70bc with SMTP id v8-20020a056a20734800b0017b2c5670bcmr2083668pzc.10.1698125514459; Mon, 23 Oct 2023 22:31:54 -0700 (PDT) Received: from sunil-laptop ([2409:4071:6e9d:1e7:259:d68d:db3b:3cc]) by smtp.gmail.com with ESMTPSA id y15-20020aa79aef000000b0068883728c16sm7216982pfp.144.2023.10.23.22.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 22:31:53 -0700 (PDT) Date: Tue, 24 Oct 2023 11:01:37 +0530 From: Sunil V L To: Anup Patel Cc: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley , Marc Zyngier , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Atish Patra , Andrew Jones , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v11 12/14] irqchip/riscv-aplic: Add support for MSI-mode Message-ID: References: <20231023172800.315343-1-apatel@ventanamicro.com> <20231023172800.315343-13-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231023172800.315343-13-apatel@ventanamicro.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 22:32:08 -0700 (PDT) Hi Anup, On Mon, Oct 23, 2023 at 10:57:58PM +0530, Anup Patel wrote: > The RISC-V advanced platform-level interrupt controller (APLIC) has > two modes of operation: 1) Direct mode and 2) MSI mode. > (For more details, refer https://github.com/riscv/riscv-aia) > > In APLIC MSI-mode, wired interrupts are forwared as message signaled > interrupts (MSIs) to CPUs via IMSIC. > > We extend the existing APLIC irqchip driver to support MSI-mode for > RISC-V platforms having both wired interrupts and MSIs. > > Signed-off-by: Anup Patel > --- [...] > +int aplic_msi_setup(struct device *dev, void __iomem *regs) > +{ > + const struct imsic_global_config *imsic_global; > + struct irq_domain *irqdomain; > + struct aplic_priv *priv; > + struct aplic_msicfg *mc; > + phys_addr_t pa; > + int rc; > + > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > + if (!priv) > + return -ENOMEM; > + > + rc = aplic_setup_priv(priv, dev, regs); > + if (!priv) { This should check rc instead of priv. > + dev_err(dev, "failed to create APLIC context\n"); > + return rc; > + } > + mc = &priv->msicfg; > + > + /* > + * The APLIC outgoing MSI config registers assume target MSI > + * controller to be RISC-V AIA IMSIC controller. > + */ > + imsic_global = imsic_get_global_config(); > + if (!imsic_global) { > + dev_err(dev, "IMSIC global config not found\n"); > + return -ENODEV; For all error return paths, priv should be freed. Thanks, Sunil