From patchwork Thu Oct 20 08:54:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Binoy Jayan X-Patchwork-Id: 78458 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp668776qge; Thu, 20 Oct 2016 01:54:47 -0700 (PDT) X-Received: by 10.99.99.195 with SMTP id x186mr15740087pgb.5.1476953686999; Thu, 20 Oct 2016 01:54:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dz8si36883753pab.18.2016.10.20.01.54.46; Thu, 20 Oct 2016 01:54:46 -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=@linaro.org; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935283AbcJTIyk (ORCPT + 27 others); Thu, 20 Oct 2016 04:54:40 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35221 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935162AbcJTIyS (ORCPT ); Thu, 20 Oct 2016 04:54:18 -0400 Received: by mail-pf0-f174.google.com with SMTP id s8so32655791pfj.2 for ; Thu, 20 Oct 2016 01:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nETM0sEtMgMEdeJeOMgc/BuHbZnhJpogADp1Y1iA7CU=; b=OMXSAGMftEUbHMwJ1tYZoJvzADwanunT6Kd1ch0P8RkXGC6dyEViHixfYOj3ih+zcX 8KEY+PapskFWFk1BEZAfLvN+cYrRLRvk3nSGcBoZLb+3RHyn2SIL39Yj/ykkYFtFjCKz XQuF8uvAaoWtmeXJ0N9VFGGWq25XpxN+Rgif8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nETM0sEtMgMEdeJeOMgc/BuHbZnhJpogADp1Y1iA7CU=; b=SF1vqoABfIdpHIOHWvYjdr9bLC7VBi7PkHTbKy16oFKOVYboz2h+ihKYAoEPIhbItI DuskCxoQflAHbcI0lxNXJtX4vU3OzWznD8cBQ9ehtgDtQwLu6SKyJ1pcAN8XxVxIP2k2 ab0LACtDoTLUb5Ly2Fzk+aYGsjaBGpj2S75G0a9kWqlNHRuVeZAFeWYDddS57sSMJM2w TWp7Ys3zNx/px70ZpSkxyb/bVxae8ILXqumiNdFadEhRVTOfaI7YZuMD8d+/TDlxUdfc /tv4H/vIvasc0wTZMwETqrD/5KgVFQ+fx+GlSdXr3wcy8PT8JAImcKuxDTmp1DdAx/qB JEyQ== X-Gm-Message-State: AA6/9Rl6Ge6PoniVV39v20m7d7TcH8VwkZ8As6MltUhr7TkG2AQ6xjcPov/E4cVMC4sof1qP X-Received: by 10.99.216.21 with SMTP id b21mr16043695pgh.110.1476953657830; Thu, 20 Oct 2016 01:54:17 -0700 (PDT) Received: from blr-ubuntu-59.ap.qualcomm.com ([202.46.23.61]) by smtp.gmail.com with ESMTPSA id s85sm69645878pfi.17.2016.10.20.01.54.14 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Oct 2016 01:54:17 -0700 (PDT) From: Binoy Jayan To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: kevin Barnett , Don Brace , Scott Benesh , Johannes Thumshirn , linux-scsi@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org, Binoy Jayan Subject: [PATCH 2/2] scsi: smartpqi: Replace semaphore lun_reset_sem with mutex Date: Thu, 20 Oct 2016 14:24:02 +0530 Message-Id: <1476953642-2160-3-git-send-email-binoy.jayan@linaro.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1476953642-2160-1-git-send-email-binoy.jayan@linaro.org> References: <1476953642-2160-1-git-send-email-binoy.jayan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Semaphores are going away in the future, so replace the semaphore lun_reset_sem with the a mutex lock. Signed-off-by: Binoy Jayan --- drivers/scsi/smartpqi/smartpqi.h | 2 +- drivers/scsi/smartpqi/smartpqi_init.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project Reviewed-by: Arnd Bergmann diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index b4559b1..3ecec27 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -964,7 +964,7 @@ struct pqi_ctrl_info { struct timer_list heartbeat_timer; struct mutex sync_request_mutex; - struct semaphore lun_reset_sem; + struct mutex lun_reset_mutex; }; enum pqi_ctrl_mode { diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 4974f7e..1e5df85 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -4601,7 +4601,7 @@ static int pqi_lun_reset(struct pqi_ctrl_info *ctrl_info, DECLARE_COMPLETION_ONSTACK(wait); struct pqi_task_management_request *request; - down(&ctrl_info->lun_reset_sem); + mutex_lock(&ctrl_info->lun_reset_mutex); io_request = pqi_alloc_io_request(ctrl_info); io_request->io_complete_callback = pqi_lun_reset_complete; @@ -4627,7 +4627,7 @@ static int pqi_lun_reset(struct pqi_ctrl_info *ctrl_info, rc = io_request->status; pqi_free_io_request(io_request); - up(&ctrl_info->lun_reset_sem); + mutex_unlock(&ctrl_info->lun_reset_mutex); return rc; } @@ -5523,7 +5523,7 @@ static struct pqi_ctrl_info *pqi_alloc_ctrl_info(int numa_node) INIT_DELAYED_WORK(&ctrl_info->update_time_work, pqi_update_time_worker); mutex_init(&ctrl_info->sync_request_mutex); - sema_init(&ctrl_info->lun_reset_sem, PQI_RESERVED_IO_SLOTS_LUN_RESET); + mutex_init(&ctrl_info->lun_reset_mutex); ctrl_info->ctrl_id = atomic_inc_return(&pqi_controller_count) - 1; ctrl_info->max_msix_vectors = PQI_MAX_MSIX_VECTORS;