Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2179439lqb; Mon, 27 May 2024 10:16:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhSHtaPffqNP+pArqcCjnOj/5Ut2N5UzuaNdHs/quSBC/MOKXx8pikljXqCKT6/zoF5NcrkkPhlP1l/2SMjHZEoqkRS0+vcoKscy/3wQ== X-Google-Smtp-Source: AGHT+IGbrnXlCuCrkoNObS8f7e9BjbxS6SCRn6rvbI9JQvwZUIB1kWUmHPqY9vGNxvCpFpZy5Ba6 X-Received: by 2002:a17:902:ea08:b0:1f4:9b26:d031 with SMTP id d9443c01a7336-1f49b26d3e2mr39491475ad.52.1716830171726; Mon, 27 May 2024 10:16:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716830171; cv=pass; d=google.com; s=arc-20160816; b=ULd7heevXMtehlNZtkFHb7TgBsK2U08kEGdcra8iqmJorI5yxt1vf98O9TUO5XM7lJ lYQMsBhifJONlBcW13PB3nklEdP+/n/Gw9cLnc3xwGLC3Auj+i2FYjMErAP2rzjwdtyV rM6vMHwXtsvgKevHfONDaCkuzgnEA/rEnv37lo0ybR6iAl37IRuGT/54wzsGKjUatVwF jfrwBY0YQdaX4UwM+40SkXMsY5k5rNB47XLooTGnhSkmvwvWKO1wdYbgUaoV7SV0MkMG L4UOrZnEk1fiLYLF1J+iBTd1/j26isPF8scy/zZm49s3odr6bupFLqus2aOh9llyOuA3 Qm2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=s3Q03t2/gkENEokyPkV7P5dElLyu639cWywXtfr0+yo=; fh=2UfGwmyHpVQhScA3lmFx7wJ9zJ39k9iY3t9K/r8ebfs=; b=kT5NkBs760PZUTVPlGO7Ie8i7SX4L+rJffJaEeHwuCtyVrErlaC46C2ifdUZvhF3cK SWFBOH+1CTOGw+jxuDKS6dCEloFhHW4lMPm8xl1zudcfMmvS/0PcJplF3FTVX9swXznj yB4ukrqg6cDYue6u2m2YZyRufDUH3PZz45yI4kqdBtkWTMX60gruu86ejhevMTxiMfVS 3cjo+UFsSyH+Gr4ypHboX5rCFWk3NvVUtTZAnVOKVQWG1eA0I8im7dDHo3T9NTHRcSlS 5C61fuxLPn5aQIXu/TjlQU/nVy6cL7AHuB9DTbaTm9sPjKz6XGKYGIQDCXlrOYRUFH7r 2VGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HUMj+oLr; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-190618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c787f9fsi63820235ad.10.2024.05.27.10.16.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 10:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HUMj+oLr; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-190618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8874EB224D2 for ; Mon, 27 May 2024 12:56:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C16B615ECC6; Mon, 27 May 2024 12:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HUMj+oLr" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F0615E5C6; Mon, 27 May 2024 12:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716814565; cv=none; b=DBYNvnJuzK3B3lh+Rft0OKVEt+kkkbQ0FzHFvhhXQEpkW0GaWpNJ47GbWtObsIrx0QGBKW3+4l48OijHbJlH3nBHRX276lSk03jKDlh+W2F+fSoOkZkS+a1T+a0+DrMExYXum5RZ1898eUhpPeqjVgmi/KNkm2/EYPWRUgVi2ps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716814565; c=relaxed/simple; bh=JpZFnOGLPxlVnryQ0+GLWGmjNOXMWnNyZQTAgap75Yc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=QLkFDliik0T5UluLc4pGqfMiFyo0GKfAddOAQu1Q9+7ZahC6YD8HXZ/knbNsLBn+jaaUZDQC5SmIKuAtuSUP4jfo8MAEYTjl6My5504/fhoL0ky8VrFX8cd9ZJ/L2Y3ZSIb/IbbH7yEilVylzTrNMPvckTYOJluxbnS/9eGcHvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HUMj+oLr; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716814563; x=1748350563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JpZFnOGLPxlVnryQ0+GLWGmjNOXMWnNyZQTAgap75Yc=; b=HUMj+oLrLEqGpP+354o2PydNBEZWoT47LkNbbsSA2nr0x5McxLqvS5rk ihVBk7dYAfPp9JqH2qxHM6yJrLRlUO+WlTZ8kp6yPvD4sNs7UE5swbpSR 7oh+R8cCeAGWhkWWc4dc/EOBbH/wWa4ILwKfmy5WlQEeHO9jkB1WrBUm/ MmTuwnOneC/Xlcvy9YaZDG2g+xJLGhGezHrQtPoKfGHG3YjrsKA3G+cS/ M/yIirbG54sdLI0O9qWi5vOUiuVPLk+xhiYe6Q/yxh/ZqsDAsP68dCuwE AM05rjAKscEsN3isF92Qp7WlqrFK3BL9aD6FLIzvB8SXHI/VWKMqQ+1EY Q==; X-CSE-ConnectionGUID: 3S8DwqcWROmy+VB6dSEmHw== X-CSE-MsgGUID: nLfL30CISM6g+voixY8xYQ== X-IronPort-AV: E=McAfee;i="6600,9927,11084"; a="23734117" X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="23734117" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 05:56:02 -0700 X-CSE-ConnectionGUID: kaWJdMYBRqCxCTMNhnyzcQ== X-CSE-MsgGUID: gNkS6SEwTWCYvL0ZT1B5xA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="34643644" Received: from unknown (HELO localhost) ([10.245.247.139]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 05:55:59 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Shevchenko , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , stable@vger.kernel.org Subject: [PATCH 2/4] x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling Date: Mon, 27 May 2024 15:55:36 +0300 Message-Id: <20240527125538.13620-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527125538.13620-1-ilpo.jarvinen@linux.intel.com> References: <20240527125538.13620-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit intel_mid_pci_irq_enable() uses pci_read_config_byte() that returns PCIBIOS_* codes. The error handling, however, assumes the codes are normal errnos because it checks for < 0. intel_mid_pci_irq_enable() also returns the PCIBIOS_* code back to the caller but the function is used as the (*pcibios_enable_irq) function which should return normal errnos. Convert the error check to plain non-zero check which works for PCIBIOS_* return codes and convert the PCIBIOS_* return code using pcibios_err_to_errno() into normal errno before returning it. Fixes: 5b395e2be6c4 ("x86/platform/intel-mid: Make IRQ allocation a bit more flexible") Signed-off-by: Ilpo Järvinen Cc: stable@vger.kernel.org --- arch/x86/pci/intel_mid_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c index 8edd62206604..722a33be08a1 100644 --- a/arch/x86/pci/intel_mid_pci.c +++ b/arch/x86/pci/intel_mid_pci.c @@ -233,9 +233,9 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev) return 0; ret = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi); - if (ret < 0) { + if (ret) { dev_warn(&dev->dev, "Failed to read interrupt line: %d\n", ret); - return ret; + return pcibios_err_to_errno(ret); } id = x86_match_cpu(intel_mid_cpu_ids); -- 2.39.2