From patchwork Sun Jun 25 21:39:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAllah-MEZITI X-Patchwork-Id: 9808421 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 873A66022E for ; Sun, 25 Jun 2017 21:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C312271BC for ; Sun, 25 Jun 2017 21:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FED22833C; Sun, 25 Jun 2017 21:39:40 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 4FBEB271BC for ; Sun, 25 Jun 2017 21:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbdFYVjh (ORCPT ); Sun, 25 Jun 2017 17:39:37 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35742 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbdFYVjg (ORCPT ); Sun, 25 Jun 2017 17:39:36 -0400 Received: by mail-wr0-f193.google.com with SMTP id z45so26638382wrb.2; Sun, 25 Jun 2017 14:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=eRC24pUhU+1vcCvG1qlYPI3mV5EJoYSyLpbigxCCEl0=; b=NWB9/uCFEFp06gUCtM/180BX1RMFzQulfhpPRCGUZC3gWF9vKxnKT5ejp3oqWgzeTs 9Qxb7PHJleAKZ3TwIhje/vCpewupogs/0C2ScIgsie7fnCnXQCWTXC63CDZgPzOMKthu xhW3hZLKm8edzAzxk4/sHmVGkVmOo8G1RG/GbRG1CdU4c8bB01FxY3nHX16Nv17/HcXr bhTbsAe/EUL74Jz9imQMBV20uu4QrlMknmVRufnYYhulHLhMDxZn3CCjfMn4EWJNVShQ KC0kOAtIcmKONuqlDpcfN97K8Zg1pfUNbnnf2uV7OwIDhwndHXay9GEpypolFsAAUPBi Emww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eRC24pUhU+1vcCvG1qlYPI3mV5EJoYSyLpbigxCCEl0=; b=sz7hRXruMKs+LeP2gsW3YrZORaGF07x19hS8V6Mw5q0/A7XJjIPU8qvjotlv3RL/Zf XoX+Qt6yRP1pY8r138snGQMMJzxrwHXAFD/46IUSfvdumsdxzF0Lm/s+ujIwDwLHpD1j /Gg8+J7xyRMcUIDzpORsmtsKPxURrmwfRYuiHP5HdBNJEQR/gziSa+0DT3SYHOgG+OYB ZcuTJt9NwW/Ukdrge7UGIaiEi8j384yuxE6j57fG6/MyEio0b3Yubn/xApBJKbhMuOfQ wmvd2sbXUfm/pjtnms8uUXN9IvJu+4lgUlgHHyH0BOkldjvD1F7YF3B5awBmn0XAAGel o6NA== X-Gm-Message-State: AKS2vOyqvbT96SMyfUSQ6uhEcGYfIlDjFuqkPbhPzOVl05AbQYnrwI/a qy3lutEUzkDQaw== X-Received: by 10.28.172.4 with SMTP id v4mr11346349wme.72.1498426775237; Sun, 25 Jun 2017 14:39:35 -0700 (PDT) Received: from localhost.localdomain (bty91-h01-176-179-209-84.dsl.sta.abo.bbox.fr. [176.179.209.84]) by smtp.gmail.com with ESMTPSA id e17sm7536121wma.1.2017.06.25.14.39.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jun 2017 14:39:34 -0700 (PDT) From: AbdAllah-MEZITI To: sudipm.mukherjee@gmail.com Cc: AbdAllah MEZITI , Teddy Wang , Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: sm750fb: always take the lock Date: Sun, 25 Jun 2017 23:39:20 +0200 Message-Id: <1498426764-14913-1-git-send-email-abdallah.meziti.pro@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: AbdAllah MEZITI --- drivers/staging/sm750fb/sm750.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 386d4ad..4a22190 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -186,16 +186,14 @@ static void lynxfb_ops_fillrect(struct fb_info *info, * If not use spin_lock,system will die if user load driver * and immediately unload driver frequently (dual) */ - if (sm750_dev->fb_count > 1) - spin_lock(&sm750_dev->slock); + spin_lock(&sm750_dev->slock); sm750_dev->accel.de_fillrect(&sm750_dev->accel, base, pitch, Bpp, region->dx, region->dy, region->width, region->height, color, rop); - if (sm750_dev->fb_count > 1) - spin_unlock(&sm750_dev->slock); + spin_unlock(&sm750_dev->slock); } static void lynxfb_ops_copyarea(struct fb_info *info, @@ -220,16 +218,14 @@ static void lynxfb_ops_copyarea(struct fb_info *info, * If not use spin_lock, system will die if user load driver * and immediately unload driver frequently (dual) */ - if (sm750_dev->fb_count > 1) - spin_lock(&sm750_dev->slock); + spin_lock(&sm750_dev->slock); sm750_dev->accel.de_copyarea(&sm750_dev->accel, base, pitch, region->sx, region->sy, base, pitch, Bpp, region->dx, region->dy, region->width, region->height, HW_ROP2_COPY); - if (sm750_dev->fb_count > 1) - spin_unlock(&sm750_dev->slock); + spin_unlock(&sm750_dev->slock); } static void lynxfb_ops_imageblit(struct fb_info *info, @@ -269,8 +265,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info, * If not use spin_lock, system will die if user load driver * and immediately unload driver frequently (dual) */ - if (sm750_dev->fb_count > 1) - spin_lock(&sm750_dev->slock); + spin_lock(&sm750_dev->slock); sm750_dev->accel.de_imageblit(&sm750_dev->accel, image->data, image->width >> 3, 0, @@ -278,8 +273,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info, image->dx, image->dy, image->width, image->height, fgcol, bgcol, HW_ROP2_COPY); - if (sm750_dev->fb_count > 1) - spin_unlock(&sm750_dev->slock); + spin_unlock(&sm750_dev->slock); } static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,