From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751292AbdAPS7o (ORCPT ); Mon, 16 Jan 2017 13:59:44 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:41847 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbdAPS7l (ORCPT ); Mon, 16 Jan 2017 13:59:41 -0500 Date: Mon, 16 Jan 2017 19:58:33 +0100 (CET) From: Thomas Gleixner To: Andy Shevchenko cc: Ingo Molnar , "H . Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 1/1] x86/ioapic: Return suitable error code in mp_map_gsi_to_irq() In-Reply-To: <1484589382.2133.150.camel@linux.intel.com> Message-ID: References: <20170116133015.146012-1-andriy.shevchenko@linux.intel.com> <1484589382.2133.150.camel@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1898341080-1484593114=:3923" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1898341080-1484593114=:3923 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 16 Jan 2017, Andy Shevchenko wrote: > On Mon, 2017-01-16 at 15:30 +0200, Andy Shevchenko wrote: > > mp_map_gsi_to_irq() in some cases might return legacy -1, which would > > be > > wrongly interpreted as -EPERM. > > > > Correct those cases to return proper error codes. > > > > Signed-off-by: Andy Shevchenko > > --- > >  arch/x86/kernel/apic/io_apic.c | 4 ++-- > >  1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/kernel/apic/io_apic.c > > b/arch/x86/kernel/apic/io_apic.c > > index 945e512a112a..99cee86b7d17 100644 > > --- a/arch/x86/kernel/apic/io_apic.c > > +++ b/arch/x86/kernel/apic/io_apic.c > > @@ -1107,12 +1107,12 @@ int mp_map_gsi_to_irq(u32 gsi, unsigned int > > flags, struct irq_alloc_info *info) > >   > >   ioapic = mp_find_ioapic(gsi); > >   if (ioapic < 0) > > - return -1; > > + return -EINVAL; > >   > >   pin = mp_find_ioapic_pin(ioapic, gsi); > >   idx = find_irq_entry(ioapic, pin, mp_INT); > >   if ((flags & IOAPIC_MAP_CHECK) && idx < 0) > > - return -1; > > + return -ENODEV; > > Looking one more time... > Or should it be other way around: -ENODEV (ioapic < 0), -EINVAL (here)? ENODEV for both cases I think, --8323329-1898341080-1484593114=:3923--