Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1764074pxb; Wed, 2 Feb 2022 11:59:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9F10Dy7FdqBTznGB1p9umSeVgE3cgPMJxhiqcNUJ8ZqlYwDB7yyMf+1qTsUZMuxbQ+pco X-Received: by 2002:a17:906:1291:: with SMTP id k17mr26127750ejb.451.1643831991860; Wed, 02 Feb 2022 11:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643831991; cv=none; d=google.com; s=arc-20160816; b=lLYpAdcT0UOXAP7d2eVY4ZS4C672GzKyKuvm95BO8/hdtdwztWfKfXGawSjUKCiePO CkIarglM7djAR5IlUE6g8Y5a0ucvMnol5fkat5/75jNxpXp0snTBk5qW39UgExWyn+KA /VaOtQ+rOLfFRoZyI6Zy3oEH6a2wvPagz7+ANB/UguDzZG0YT8R/v6zGBdYyO1ECfA3+ zxP88OHs0kKsZht6xzKrPM0F5K4aJNOgJuyPSJN6p0icodHz4rpBv/DKymu6RzuOZRFx bRFR8EUhjcnfd6a1hA6c7lplOkVkppoJqir8CPtoIq6IYIdbN3wal7qtZrXcJ9xSJRBY r4wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=B7faoXI4FIzKTP+IkgJnJYtxPJzPPHmyjySPNh1MjYc=; b=vZP9hNYkB6O8cCOr/s5R2/LYeN/ERAQan4iXEyUZjAC4wQ1xtxL9UU1yKGMvFb5bi0 HKcdMKKBL2GqcNOfw9sj4JxkOetqlq45HoyYHmDMvtNi6D46uCGWlADRNKRo5QKVlCQ1 VZPoveALME8mmZC7FspclCzQp5F7/wkhoIsHwQmbv29lJjRy3q8yMIDAwcpoey1041OD BfWMVd2FiXMJ8fZPF4wsd/dUzKrZWMgZwTBy1CS13OhDk3JB5PHLUXsfEgbbk2BOVqGM AXAFscpjD0NniAiVIrwatcve/xE30RGA7RVhkfTvpgtFEgwSlO8pUX4EnkChMiLhLZvc eeRw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11si13199949eda.480.2022.02.02.11.59.26; Wed, 02 Feb 2022 11:59:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239204AbiBAOXo (ORCPT + 99 others); Tue, 1 Feb 2022 09:23:44 -0500 Received: from 3.mo548.mail-out.ovh.net ([188.165.32.156]:51183 "EHLO 3.mo548.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239185AbiBAOXm (ORCPT ); Tue, 1 Feb 2022 09:23:42 -0500 X-Greylist: delayed 2700 seconds by postgrey-1.27 at vger.kernel.org; Tue, 01 Feb 2022 09:23:42 EST Received: from mxplan5.mail.ovh.net (unknown [10.109.143.188]) by mo548.mail-out.ovh.net (Postfix) with ESMTPS id A45B120B2A; Tue, 1 Feb 2022 13:28:30 +0000 (UTC) Received: from kaod.org (37.59.142.97) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 1 Feb 2022 14:28:29 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-97G002ded4642f-2264-41dd-88eb-91ec928a76b3, FC28BB27814F05D37416E671BAFA2F1ED858982E) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: Date: Tue, 1 Feb 2022 14:28:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v2] powerpc/xive: Add some error handling code to 'xive_spapr_init()' Content-Language: en-US To: Christophe JAILLET , , , , , , , CC: , , References: <564998101804886b151235c8a9f93020923bfd2c.1643718324.git.christophe.jaillet@wanadoo.fr> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <564998101804886b151235c8a9f93020923bfd2c.1643718324.git.christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.97] X-ClientProxiedBy: DAG8EX1.mxp5.local (172.16.2.71) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 4ec3683f-a038-485c-ad83-90f117bf23d3 X-Ovh-Tracer-Id: 3854518332830878709 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrgeefgdehfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeuveelvdejteegteefieevfeetffefvddvieekteevleefgeelgfeutedvfedvfeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehgrhhouhhgsehkrghougdrohhrgh Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/1/22 13:31, Christophe JAILLET wrote: > 'xive_irq_bitmap_add()' can return -ENOMEM. > In this case, we should free the memory already allocated and return > 'false' to the caller. > > Also add an error path which undoes the 'tima = ioremap(...)' > > Signed-off-by: Christophe JAILLET Reviewed-by: Cédric Le Goater > --- > NOT compile tested (I don't have a cross compiler and won't install one). > So if some correction or improvement are needed, feel free to propose and > commit it directly. A cross compiler takes a couple of seconds to install on any distro. It takes a little more to compile the pseries defconfig. To test with QEMU, grab the disk image here : https://github.com/legoater/qemu-ppc-boot/blob/main/buildroot/qemu_ppc64le_pseries-2021.11-7-g3058e75456-20211206 run : qemu-system-ppc64 -M pseries -cpu POWER9 -kernel vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=rootfs.ext2,if=scsi,index=0,format=raw -nographic -net nic -net user -serial mon:stdio and you will have a pseries machine with network and disk using the XIVE interrupt controller. To get more info on the genirq layer and the XIVE driver, simply append : dyndbg="file arch/powerpc/sysdev/xive/* +p; file kernel/irq/* +p" Thanks, C.