From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750884AbdAPR41 (ORCPT ); Mon, 16 Jan 2017 12:56:27 -0500 Received: from mga03.intel.com ([134.134.136.65]:41615 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbdAPR40 (ORCPT ); Mon, 16 Jan 2017 12:56:26 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,240,1477983600"; d="scan'208";a="809527085" Message-ID: <1484589382.2133.150.camel@linux.intel.com> Subject: Re: [PATCH 1/1] x86/ioapic: Return suitable error code in mp_map_gsi_to_irq() From: Andy Shevchenko To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org Date: Mon, 16 Jan 2017 19:56:22 +0200 In-Reply-To: <20170116133015.146012-1-andriy.shevchenko@linux.intel.com> References: <20170116133015.146012-1-andriy.shevchenko@linux.intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)? >   >   return mp_map_pin_to_irq(gsi, idx, ioapic, pin, flags, info); >  } -- Andy Shevchenko Intel Finland Oy