Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1976292rwl; Thu, 6 Apr 2023 04:15:10 -0700 (PDT) X-Google-Smtp-Source: AKy350bMYTPAVoyp5JIhfge75qoKR7DlP/MsEcrlPBjvH9bNccSwlDNxwmqOeMwZafWtC3oIPGSU X-Received: by 2002:a05:6402:1a49:b0:501:fe46:480b with SMTP id bf9-20020a0564021a4900b00501fe46480bmr4141096edb.15.1680779709886; Thu, 06 Apr 2023 04:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680779709; cv=none; d=google.com; s=arc-20160816; b=OXXpPlZmGAcV7Us+ExCuPvbkSf/FSZ2VO326PFiWkfFmmE1DSSEYOP61gX1JKiQvkS zdNe3kq+MmQqDsdagXnpsj5V0MyAfN6+em8FDtg0QykK5Ok2JyF/Qv5Ojeye0TUJ/COm g4zU6/13iSJpF8+lUdR/O8Lejz+SO8aLm6jTJ4bvRCaME7C5B4Ult6PO8nYOjUS8hzt2 h/eDPUmY+Mt9s8h/KI7apuAklzQo9qb6zlHits9DVmHtb/eCg7CDCZ7Fap9AHDU/bwb6 yoSaPYP8w0KlqPrc51UsXg28Jigfq0xnWNMl4go9KBxe6ap1aHb4iIuLeEUJC7t+yQWY Adpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=kh84Ttd8PQhLx6YIMeWk7qRH7yQ306CMf9ehdZ63wkQ=; b=w8jAx071rG6oTh6ZLmWy+TcpAjrfzOIm4N9CuY4IJSEH4AwMVMykERrlWtUNsXIp1P 0Q1i94vGwUueSwl11sddhelNC20G7qsWf/1XDtd1MrQYbI8prQx5TCi0FHUR3d+BkwLG glhiTkG6e97rerGpte1jVvQBtoN5HlpFszPOYUF8Ay7ixa+mNFYsigzHEC4f9kggKU9t nas4pnvWZv37roZhFpa6WQ046lvY2aIeDd1UJAFMsLoHX/yD+A+HAJJ27v5L2s20/i8V 9I6h3NHGb+6EvkbZDG4Re3QmMMQTGwSNmIBVbmtknfcJw7hrlVuskl2vXyfY88KjLtUg NsOQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m20-20020aa7d354000000b00502250fa5a5si950837edr.470.2023.04.06.04.14.45; Thu, 06 Apr 2023 04:15:09 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236405AbjDFLFf convert rfc822-to-8bit (ORCPT + 99 others); Thu, 6 Apr 2023 07:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235352AbjDFLFd (ORCPT ); Thu, 6 Apr 2023 07:05:33 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF8F86B0 for ; Thu, 6 Apr 2023 04:05:18 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-70-FCYuxC1NPdeaowzkllIknw-1; Thu, 06 Apr 2023 12:05:15 +0100 X-MC-Unique: FCYuxC1NPdeaowzkllIknw-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 6 Apr 2023 12:05:14 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 6 Apr 2023 12:05:14 +0100 From: David Laight To: "linux-kernel@vger.kernel.org" , "Thomas Gleixner" , Jason Gunthorpe , "Bjorn Helgaas" CC: Linus Torvalds , Christoph Hellwig Subject: revert bab65e48cb064 PCI/MSI Sanitize MSI-X checks Thread-Topic: revert bab65e48cb064 PCI/MSI Sanitize MSI-X checks Thread-Index: AdlodgFkFYa3Wd45RlGJwWEgKJXFDw== Date: Thu, 6 Apr 2023 11:05:14 +0000 Message-ID: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 The change in bab65e48cb064 breaks pci_enable_msix_range(). The intent is to optimise the sanity checks, but it is somewhat overenthusiastic. The interface allows you to ask for a lot of vectors and returns the number that were allocated. However, after the change, you can't request a vector that is higher than the largest the hardware supports. Which makes that rather pointless. So code like: for (i = 0; i < 16; i++) msix_tbl[i].entry = i; nvec = pci_enable_msix_range(dev, msix_tbl, 1, 16); Now returns -22 if the hardware only supports 8 interrupts. Previously it returned 8. I can fix my driver, but I suspect that any code that relies on a smaller number of vectors being returned is now broken. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)