Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1572281imm; Fri, 6 Jul 2018 02:33:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpePhsi5w8+xBX3WdeseaM7VxHopSowTaogJdhQeqCwOAvNFcPWchSbd5fp2+hQy61D9wSQY X-Received: by 2002:a17:902:8:: with SMTP id 8-v6mr9798859pla.287.1530869615943; Fri, 06 Jul 2018 02:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530869615; cv=none; d=google.com; s=arc-20160816; b=S9noBEuzMcK9bJuvDUC0c1WaT3mtQOW4RRrJkxWkm5mW1Fpld2pYyxIhTh/E8H0Jgo 7ryo88O4iOpUKrHYnbPlL+ciiUdgvH3vXF/12uRa9YvVHT0ciFI+hA46cyWvw9r2kIy+ ShvJJsrle/lseU7fzSlj13Vnpt+VLVHcMqyAhSC05EaFz7BpsK2wO+8njHsgSmvYZqpg nDqgimKVBezZCi2+LUNxfRriSG/2QozBq57MZR2q4SU8X1WC0K85r/m9zN2l4GntO4FO I8PZ22F2lEgI81YfHgbkVh+VePvIqc2NxyYDkXNDZjUEh/n3mMD2m99xoJPczqaepUrk Rx7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=uaE0qAiH7NdBhKjA+u3R3aypZTrx5R5zIPtucxmW+IY=; b=YEIuZ8uAMCz4vRI7jwkuQrTUhmNqYN5EpQseP5snE+otoLtzHtBLQ/eAN5RxDRARBK 8MEzXx3LcF4JLrWtgnkTg+Np8tOfi5NtZw2Vg/8LA+IecLa6GsDof0OvsmZLNIQPFA74 kkWcwysu653beHQTpAgolk5WTS6P5rvu/PqqUdd6j2AzpAisBJcI/yWFYSHF2Zw4zNTw PtisXcMlZNZE5iJn81K3E7dP6DEO8L9lyMlWFBwfhMcDnf9bIqjiBVM8NSVYaYjtXh/o AWeRw3c6IuqWTZ+PpXlYG8NSIVaIuBYQJ9MKgpEow77TsCwvK+GDrL0rGQCXpp/IBedM BzmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UA8wMAoa; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q185-v6si7752847pga.322.2018.07.06.02.33.21; Fri, 06 Jul 2018 02:33:35 -0700 (PDT) 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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UA8wMAoa; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753571AbeGFJcD (ORCPT + 99 others); Fri, 6 Jul 2018 05:32:03 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:51864 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753061AbeGFJcB (ORCPT ); Fri, 6 Jul 2018 05:32:01 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w669VneF119633; Fri, 6 Jul 2018 04:31:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1530869509; bh=uaE0qAiH7NdBhKjA+u3R3aypZTrx5R5zIPtucxmW+IY=; h=Subject:To:References:CC:From:Date:In-Reply-To; b=UA8wMAoaBYz+aQOBx4oCK1yP2MXzbxTuswNyKB3ZJXDvRan+QdCODIZvuD5DXeDL5 q2clskOBrG/TZmbtbkB7PEuStBngmSFSci7bqlOZrnH8JLxJnTKmJmnttO46XrFAW6 IizvtZESzEahon1wrmhqGm76pqN7Wx6FHJ1Z4lPg= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w669VnQS020122; Fri, 6 Jul 2018 04:31:49 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 6 Jul 2018 04:31:49 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 6 Jul 2018 04:31:49 -0500 Received: from [172.24.190.233] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w669VjHW009972; Fri, 6 Jul 2018 04:31:46 -0500 Subject: Re: [PATCH v6 11/11] PCI: endpoint: Add MSI set maximum restriction. To: Gustavo Pimentel , , , , , , , References: <5bceea0ec98a7436ac5960635898ddfbec2cf6e1.1529595907.git.gustavo.pimentel@synopsys.com> CC: , , From: Kishon Vijay Abraham I Message-ID: <3a33b9b2-0afa-3639-12af-cea1083e2714@ti.com> Date: Fri, 6 Jul 2018 15:01:44 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <5bceea0ec98a7436ac5960635898ddfbec2cf6e1.1529595907.git.gustavo.pimentel@synopsys.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 21 June 2018 09:31 PM, Gustavo Pimentel wrote: > Add pci_epc_set_msi() maximum 32 interrupts validation. > > Signed-off-by: Gustavo Pimentel Acked-by: Kishon Vijay Abraham I > --- > Change v4->v5: > - New patch file. > Change v5->v6: > - Nothing changed, just to follow the patch set version. > > drivers/pci/endpoint/pci-epc-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c > index c72e656..094dcc3 100644 > --- a/drivers/pci/endpoint/pci-epc-core.c > +++ b/drivers/pci/endpoint/pci-epc-core.c > @@ -201,7 +201,8 @@ int pci_epc_set_msi(struct pci_epc *epc, u8 func_no, u8 interrupts) > u8 encode_int; > unsigned long flags; > > - if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions) > + if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions || > + interrupts > 32) > return -EINVAL; > > if (!epc->ops->set_msi) >