From patchwork Thu Apr 20 14:09:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 9690625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F89960326 for ; Thu, 20 Apr 2017 14:15:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4764828471 for ; Thu, 20 Apr 2017 14:15:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C08328479; Thu, 20 Apr 2017 14:15:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E44C128471 for ; Thu, 20 Apr 2017 14:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032175AbdDTOKn (ORCPT ); Thu, 20 Apr 2017 10:10:43 -0400 Received: from mail.kernel.org ([198.145.29.136]:60070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032171AbdDTOKl (ORCPT ); Thu, 20 Apr 2017 10:10:41 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23BF820121; Thu, 20 Apr 2017 14:10:40 +0000 (UTC) Received: from localhost.localdomain (user-0ccsrjt.cable.mindspring.com [24.206.110.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C0E7D2015A; Thu, 20 Apr 2017 14:10:38 +0000 (UTC) From: Alan Tull To: Moritz Fischer Cc: Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH v2 09/16] fpga: region: fix slow warning with more than one overlay Date: Thu, 20 Apr 2017 09:09:54 -0500 Message-Id: <1492697401-11211-10-git-send-email-atull@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492697401-11211-1-git-send-email-atull@kernel.org> References: <1492697401-11211-1-git-send-email-atull@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Prevent applying more than one overlay to a region. This fixes a slow warning that happens when more than one overlay is applied and then removed. Signed-off-by: Alan Tull --- v2: split out from another patch --- drivers/fpga/fpga-region.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index c2730a8..d6f2313 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c @@ -355,6 +355,11 @@ static int fpga_region_notify_pre_apply(struct fpga_region *region, const char *firmware_name; int ret; + if (region->info) { + dev_err(dev, "Region already has overlay applied.\n"); + return -EINVAL; + } + /* * Reject overlay if child FPGA Regions added in the overlay have * firmware-name property (would mean that an FPGA region that has