Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1327538img; Tue, 26 Feb 2019 19:31:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IYHnIwPNaPiykk0infU5TfYMKRuwTtZlXjaXhqqgtdE/6ftXhFuvZqGGzjWsaCndoutqB8q X-Received: by 2002:a17:902:24c:: with SMTP id 70mr14416536plc.54.1551238280517; Tue, 26 Feb 2019 19:31:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551238280; cv=none; d=google.com; s=arc-20160816; b=vI2gMKyNnaqIMZLaVGID/cNcOrAz5WN4j6/2NRV9Io0vAh4wyp/owVIL6XP7BNeBcJ MEX5eut/XGoJLp/4eEKljFhKZHHDXUTSZMOaXQ1T2bxmVSDbXyTuxcgGvmT/U1DyYUq6 sSeoHgRUGaFdQ2FNo6cG9dC+IREN6aF3tRTv2qJgdu4se33cknbv2Ts0k2JO5w7l1b4T zPiesJst+ucpCD9OIT4lKGaxbbZtqnbDfNZS7E6YIOXblvzAAU/Kw8EwVlIsEGrcSsxZ nA/6F7aotQvuREqxZc2N/4eZqILUfxFwtWuoApdUitTHwHZJEDvRbvU6OWXrJQjDwILI 0J/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=F2O95rA4maqUnDnbDvNvJPqSN9wnFulk/QFNdg8W9yg=; b=kxFeHFml0PnYFCx0DqWKDTozANfyRwMbJUdFnwFLX6Gn464adcwrxt127NCfPVDX5j 1tqhxJ2b+3h/zRIqJojYcVbU3wAYO45GJCF/oUPVGBdWtMSOGINO5sAGgRihqygOFS31 OFf36jp7zbjPOKzO9MH/HL/zmCRXTJU/y+k/Q2rCBicka89pNIQm9KsviQHuiU6UrZ9M WO98D8aBD1Xr0L7pfUjGUd/VvvZNd13nsAnneSgj6KTnnmpl5j87GpEzT2Xpikv1CqPu VFXAJl2lpFwMjgMnSA6OWcUknGAlAURSO/5FJ2HtMYnmFHh7NZ7bp/XkdHibWiYUz18E xBuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si5813104pll.382.2019.02.26.19.31.05; Tue, 26 Feb 2019 19:31:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729609AbfB0Dal (ORCPT + 99 others); Tue, 26 Feb 2019 22:30:41 -0500 Received: from mx0a-002e3701.pphosted.com ([148.163.147.86]:59806 "EHLO mx0a-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729128AbfB0Dal (ORCPT ); Tue, 26 Feb 2019 22:30:41 -0500 Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1R3LeTP005273; Wed, 27 Feb 2019 03:30:35 GMT Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 2qwcbqtfr0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Feb 2019 03:30:35 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 697B165; Wed, 27 Feb 2019 03:30:34 +0000 (UTC) Received: from blofly.tw.rdlabs.hpecorp.net (blofly.tw.rdlabs.hpecorp.net [15.119.208.30]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 475FB3A; Wed, 27 Feb 2019 03:30:32 +0000 (UTC) From: Matt Hsiao To: linux-kernel@vger.kernel.org Cc: arnd@arndb.de, gregkh@linuxfoundation.org, david.altobelli@hpe.com, mark.rusk@hpe.com, jerry.hoemann@hpe.com, Matt Hsiao Subject: [PATCH v2 1/2] misc: hpilo: Exclude unsupported device via blacklist Date: Wed, 27 Feb 2019 11:25:29 +0800 Message-Id: <1551237930-28823-2-git-send-email-matt.hsiao@hpe.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551237930-28823-1-git-send-email-matt.hsiao@hpe.com> References: <1551237930-28823-1-git-send-email-matt.hsiao@hpe.com> X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-27_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902270022 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of having explicit if statements excluding devices, use a pci_device_id table of devices to blacklist. HPE will put out minor updates to the iLO using the same device info except for the subsystem device id. hpilo driver takes the approach to claim based upon {Vendor, Device, SubVendor} and it allows old software to work on new hardware without patching. As our primary way to support our customers is via distros, the patching process could take months to go upstream and then backported to multiple releases of multiple distros. This approach worked fairly well as this is only the second time in 10+ years that we need to blacklist an instance. Signed-off-by: Matt Hsiao --- drivers/misc/hpilo.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index e9c9ef5..0224e50 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -29,6 +29,11 @@ static unsigned int ilo_major; static unsigned int max_ccb = 16; static char ilo_hwdev[MAX_ILO_DEV]; +static const struct pci_device_id ilo_blacklist[] = { + /* auxiliary iLO */ + {PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3307, PCI_VENDOR_ID_HP, 0x1979)}, + {} +}; static inline int get_entry_id(int entry) { @@ -763,9 +768,10 @@ static int ilo_probe(struct pci_dev *pdev, int devnum, minor, start, error = 0; struct ilo_hwinfo *ilo_hw; - /* Ignore subsystem_device = 0x1979 (set by BIOS) */ - if (pdev->subsystem_device == 0x1979) - return 0; + if (pci_match_id(ilo_blacklist, pdev)) { + dev_dbg(&pdev->dev, "Not supported on this device\n"); + return -ENODEV; + } if (max_ccb > MAX_CCB) max_ccb = MAX_CCB; -- 1.8.3.1