From patchwork Tue Dec 31 10:03:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 182667 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp7388410ild; Tue, 31 Dec 2019 02:01:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyYcUPqEh4Ago+jkTNqZ1NJEnbb5lAEYnF0+4c+TCjuboiYEkZ0fagIzQDqQPnOdVzscciR X-Received: by 2002:a9d:67ce:: with SMTP id c14mr53816676otn.106.1577786510200; Tue, 31 Dec 2019 02:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577786510; cv=none; d=google.com; s=arc-20160816; b=MALQd8uafQ2pP+Pb9mnG4j/akTHvgGWbzVQGqPD/hu9JcBk+b2xBf5ZpNy26Y6c5Jd IagUBi1Za94OY23lUsNnKp/Liid1tUgI7lMQ2vxLSyvI5gi2JUak8MaN9s6JoVg6EFdg o1Swts8+v2vVd4S5e61bPQscSCEAmnGeZ1uqfoerc8hdx2zEALOJ9cAxOQ/qA5cze4b4 zdqu+8mxjRogD7nl/cyQGJlxRXnRbwerH1W9Gs0g6m2exrlLvbxMLivftcs0AHoMcpCe eK6AIYUQe5OWJAcFKQsWhLgqNpteiC9nJkkkE1zblrUA0P8t3TquPhTGQNskzkMaLXad DiyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=pZGbRajgB05vkTgu4/ik8qf1XwF0gZdL+BeuszkKc+o=; b=POZQ/QBWI4T7nmEMd84BlymsOOaf000SWiRohq+s2Z8KAXRo1D4HkyGShs/OEZ+SRo jT2BcoUVP6BN6C5VzmrG6thPJYWjE44MiFVsdFCkeRpawpag/S27v6Udi0kb5Nu87qp1 x9C+UW2JL9nN1b9XGXNaoLllG4dX8PKQhdWluLZuzaK6k70Qjo+ceCr9+5041RgNx7Bm gVMPQmhr1eROyC9w/51i3/Chj1ZkgKYfD71JsNxMKuwNvrX0Mi/xocsOqMW+DphsfB5Z 7P3PJZHemmZzcaev61uGTob9v4w+GxmxUezX43iietTjgfgWLC94Ln05F5mPvOdUPIA2 wUjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pzCeHJEy; 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 x20si25345463otq.222.2019.12.31.02.01.49; Tue, 31 Dec 2019 02:01:50 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pzCeHJEy; 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 S1727066AbfLaKBk (ORCPT + 27 others); Tue, 31 Dec 2019 05:01:40 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:34306 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbfLaKBj (ORCPT ); Tue, 31 Dec 2019 05:01:39 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBVA1WAD088940; Tue, 31 Dec 2019 04:01:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577786492; bh=pZGbRajgB05vkTgu4/ik8qf1XwF0gZdL+BeuszkKc+o=; h=From:To:CC:Subject:Date; b=pzCeHJEyyDeaU+bkbIDKIBBjkSbndC/jI9Yr+ac5JUTXk+mddE4GTWKw3B6KD+rN2 NuL/kfXRgZAT63U3YG4OcEAp+ju692MKIBH1+T4z6qMPURdlbS8WIsNLsktEAj8z2a wZC86VXdsDSHt9OM4a83k4ZAiWR2rbNQ1HTKwV+0= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBVA1WS8116823 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Dec 2019 04:01:32 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 31 Dec 2019 04:01:32 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Tue, 31 Dec 2019 04:01:32 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBVA1TZf020876; Tue, 31 Dec 2019 04:01:30 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Bjorn Helgaas , Andrew Murray CC: , Subject: [PATCH 0/5] Improvements to PCIe Endpoint Core Date: Tue, 31 Dec 2019 15:33:26 +0530 Message-ID: <20191231100331.6316-1-kishon@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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 This series adds miscellaneous improvements to PCIe endpoint core. 1) Protect concurrent access to memory allocation in pci-epc-mem 2) Replace spinlock with mutex in pci-epc-core and also use notification chain mechanism to notify EPC events to EPF driver. 3) Since endpoint function device can be created by multiple mechanisms (configfs, devicetree, etc..), allowing each of these mechanisms to assign a function number would result in mutliple endpoint function devices having the same function number. In order to avoid this, let EPC core assign a function number to the endpoint device. This series is created on top of [1] and [2] [1] -> http://lore.kernel.org/r/20191209092147.22901-1-kishon@ti.com [2] -> http://lore.kernel.org/r/20191230123315.31037-1-kishon@ti.com Kishon Vijay Abraham I (5): PCI: endpoint: Use notification chain mechanism to notify EPC events to EPF PCI: endpoint: Replace spinlock with mutex PCI: endpoint: Protect concurrent access to memory allocation with mutex PCI: endpoint: Protect concurrent access to pci_epf_ops with mutex PCI: endpoint: Assign function number for each PF in EPC core drivers/pci/endpoint/functions/pci-epf-test.c | 13 +- drivers/pci/endpoint/pci-ep-cfs.c | 27 +---- drivers/pci/endpoint/pci-epc-core.c | 113 ++++++++---------- drivers/pci/endpoint/pci-epc-mem.c | 10 +- drivers/pci/endpoint/pci-epf-core.c | 33 ++--- include/linux/pci-epc.h | 19 ++- include/linux/pci-epf.h | 9 +- 7 files changed, 108 insertions(+), 116 deletions(-) -- 2.17.1