Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8593869rwb; Thu, 24 Nov 2022 01:30:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf72F+PZAfXLpw3nXn7tu2dZ7H04CDRVxgcDi7HPoJypbIfF8Vt7qNX3yHc1dmXmcMQu/PYs X-Received: by 2002:a17:906:3e18:b0:78d:8d70:8bf8 with SMTP id k24-20020a1709063e1800b0078d8d708bf8mr11681739eji.15.1669282204179; Thu, 24 Nov 2022 01:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669282204; cv=none; d=google.com; s=arc-20160816; b=iQy6WNHuuMsop2WtIDv8imlhudnSQuN4MLKXflesEGb74WbYI9zSdBGB2DD5bgHVBv OxGVdzKArZOwRb31bKAbeePNbkr2mw1HWM4eh8+KQtxthyNJvwbQRgA+WdtEl5ekmkE+ c+kyr6p+kQu7FLNTKMtWxnjInqIYfAUJBMpqDinj4towEVTa5hYOqTzMxv8x4BbGqbCQ s3xKeYT4ulxJgo5X2MCmtE3KiRKQLre8Thn7S+GbnXb3uqppP1m26gHoL86f4VkmrU4q GQtYf/xbBSFd+dLg78/HIdKVv7oKimqscQuvVd738P62mRdpNsrKl84mHC8rqG8CniFg 7Cbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=TORikMNpewqjUSTSg8RHjgWS+OHYnHpL2PiWb9zaLNw=; b=ixz2ZPLEPFhTxWtoBKKkybfRr6o7/FAXnBfThlgGWSGDVH4YiWvFh57v0jPmYygHWZ 75FhjtZ0Ca3cBhWCg1h1Iq8YBhNMQqbi5+8sjBf3740jxLWSFgO51pwoOOcoKkST6RAQ L6pf97EKU6H7FX63+yef2fn9J92vOfzzs+ec3VUHR0kLPMANMJRUxAwwC0UNHHwfhwTr gpW8xkVH3OKQFzMAyba5xeKhVW0O2Nf288ktjpXoRnhEG8FJe+7MyAthpZTqyIETWPZy o/Kt/Qn92cbnakISFgSPkdAp1vfzvy8XWoyPy45Gwyoom6adStQxIwhKlCAf8EnotOc2 aVjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QJZP8Yxt; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l10-20020a056402254a00b004696e8f74cbsi615175edb.537.2022.11.24.01.29.42; Thu, 24 Nov 2022 01:30:04 -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=@linutronix.de header.s=2020 header.b=QJZP8Yxt; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiKXIgX (ORCPT + 87 others); Thu, 24 Nov 2022 03:36:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbiKXIgS (ORCPT ); Thu, 24 Nov 2022 03:36:18 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EDAFEC084; Thu, 24 Nov 2022 00:36:17 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669278976; 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=TORikMNpewqjUSTSg8RHjgWS+OHYnHpL2PiWb9zaLNw=; b=QJZP8YxtpyCumHuuAH40WhwEe4M+TuoKfhJU8CC+MtQ8PtWpLGnw8paE1F7LepoXBovQaH 95sYVITaB9bGF63n9pQCbtUgmbIKiiEBlN4cBa4cDTesGj453DxJnHEdZT8Lk/fVODXAYc T2nGvYuV2vFe7YcirCwFE9Zf0IJWESejj+qNuM2BknW9w97dCXfQHYRuhjeK7kTgiAmF2e HAIbU1l9hrER2TQVavNJt2VBbDQGtxUn4dI8U8rZzZeUV8RkPZNlZoiPUATcepZcmEMj3K ml8vfkCqWasg2uLwlbdp8kJ6lCxf2Tlz7aHXnFIWL18PnJiX4y3Jpp1wW5Aq1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669278976; 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=TORikMNpewqjUSTSg8RHjgWS+OHYnHpL2PiWb9zaLNw=; b=5p4PBhK3Q5TwSJczVi1PHywg3VLU3Se4ga9MoTivLrMQWgm8OpgAQ4BK/DGYexWkrA7Wiv o+sYJ5ci4Bl9fdCA== To: "Tian, Kevin" , LKML Cc: "x86@kernel.org" , Joerg Roedel , Will Deacon , "linux-pci@vger.kernel.org" , Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , "Jiang, Dave" , Alex Williamson , "Williams, Dan J" , Logan Gunthorpe , "Raj, Ashok" , Jon Mason , Allen Hubbe Subject: RE: [patch V2 07/33] genirq/msi: Provide msi_create/free_device_irq_domain() In-Reply-To: References: <20221121083657.157152924@linutronix.de> <20221121091326.879869866@linutronix.de> <8735a9gau7.ffs@tglx> Date: Thu, 24 Nov 2022 09:36:15 +0100 Message-ID: <87tu2oda0w.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 On Thu, Nov 24 2022 at 01:07, Kevin Tian wrote: >> From: Thomas Gleixner > I looked at it from the outmost invocation: > > @@ -436,6 +436,9 @@ int __pci_enable_msi_range(struct pci_de > if (rc) > return rc; > > + if (!pci_setup_msi_device_domain(dev)) > + return -ENODEV; > + > > the current style kind of converts meaningful -EINVAL/-ENOMEM/etc. > into -ENODEV. But go to the call sites of the various places in drivers which set up MSI or MSI-X and check whether anything evaluates those error codes in a meaningful way. Some of them print the error code, but that does not help much because the error code does not allow you to pin point the place which returns that. If you just analyze the pci_alloc_irq_vectors_affinity() call then you find at least 10 places, which can return -ENOMEM. So how is that meaningful and helpful? All it tells you is that some memory allocation failed. In that case the failure of the PCI/MSI[-X] setup is the least of the problems. Where error codes are mandatory are user space interfaces, but in the kernel a simple fail/success like we have with many interfaces which just return a NULL pointer on fail is sufficient. Just because the kernel historically propagated error codes all over the place does not make them useful or meaningful. Thanks, tglx