From patchwork Thu Sep 17 09:45:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7205261 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30D12BF036 for ; Thu, 17 Sep 2015 10:02:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55E63207B8 for ; Thu, 17 Sep 2015 10:02:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 551EA207F5 for ; Thu, 17 Sep 2015 10:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753918AbbIQKBm (ORCPT ); Thu, 17 Sep 2015 06:01:42 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:55923 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbbIQJyw (ORCPT ); Thu, 17 Sep 2015 05:54:52 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NUT00A8NFJDMW60@mailout1.samsung.com>; Thu, 17 Sep 2015 18:54:49 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 0F.C1.20564.9ED8AF55; Thu, 17 Sep 2015 18:54:49 +0900 (KST) X-AuditID: cbfee690-f796f6d000005054-41-55fa8de9b603 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 87.A3.18629.8ED8AF55; Thu, 17 Sep 2015 18:54:49 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NUT000DPFIZ1D40@mmp1.samsung.com>; Thu, 17 Sep 2015 18:54:48 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: JBottomley@odin.com, vinholikatti@gmail.com, amit.daniel@samsung.com, essuuj@gmail.com, devicetree@vger.kernel.org Subject: [PATCH v2 06/11] scsi: ufs: add specific callback for nexus type Date: Thu, 17 Sep 2015 15:15:32 +0530 Message-id: <1442483137-32376-7-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1442483137-32376-1-git-send-email-alim.akhtar@samsung.com> References: <1442483137-32376-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsWyRsSkVvdl769QgymNnBYNV0Ms5h85x2qx /MISJov/62+zWFzeNYfNovv6DjaLHQurHNg9ds66y+5x+McPZo++LasYPT5vkgtgieKySUnN ySxLLdK3S+DKuL3pJkvBZ7GKlXMWsjcwLhTuYuTkkBAwkZi84hIzhC0mceHeerYuRi4OIYEV jBIPJyxg6WLkACt689sLIr6UUWLxownMEM5PRolZx3ewg3SzCWhL3J2+hQnEFhGwkTh/8wGY zSxQIXHrzAQWEFtYwFNizfXJbCA2i4CqxKRXy8A28wq4SzRd2ssKcYWiRPezCWA1nAIeEq/+ L2IFOUIIqOb8hlqQvRIC09klFr2Zxg4xR0Di2+RDUIfKSmw6APWMpMTBFTdYJjAKL2BkWMUo mlqQXFCclF5kolecmFtcmpeul5yfu4kRGNan/z2bsIPx3gHrQ4wCHIxKPLwKLr9ChVgTy4or cw8xmgJtmMgsJZqcD4yevJJ4Q2MzIwtTE1NjI3NLMyVx3tdSP4OFBNITS1KzU1MLUovii0pz UosPMTJ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SS3FGoqEWc1FxIgCUpfdlswIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Seungwon Jeon Some host controller needs nexus type information for handling command. This change adds specific callback function to support vendor's implementation. Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 6 ++++++ drivers/scsi/ufs/ufshcd.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 0fcfa71..2f0de4b 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1377,6 +1377,8 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) /* issue command to the controller */ spin_lock_irqsave(hba->host->host_lock, flags); + if (hba->vops && hba->vops->specify_nexus_t_xfer_req) + hba->vops->specify_nexus_t_xfer_req(hba, tag, lrbp->cmd); ufshcd_send_command(hba, tag); out_unlock: spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -1577,6 +1579,8 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, hba->dev_cmd.complete = &wait; spin_lock_irqsave(hba->host->host_lock, flags); + if (hba->vops && hba->vops->specify_nexus_t_xfer_req) + hba->vops->specify_nexus_t_xfer_req(hba, tag, lrbp->cmd); ufshcd_send_command(hba, tag); spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -3848,6 +3852,8 @@ static int ufshcd_issue_tm_cmd(struct ufs_hba *hba, int lun_id, int task_id, task_req_upiup->input_param2 = cpu_to_be32(task_id); /* send command to the controller */ + if (hba->vops && hba->vops->specify_nexus_t_tm_req) + hba->vops->specify_nexus_t_tm_req(hba, free_slot, tm_function); __set_bit(free_slot, &hba->outstanding_tasks); ufshcd_writel(hba, 1 << free_slot, REG_UTP_TASK_REQ_DOOR_BELL); diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index c6dc107..149d74e 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -257,6 +257,9 @@ struct ufs_pwr_mode_info { * @pwr_change_notify: called before and after a power mode change * is carried out to allow vendor spesific capabilities * to be set. + * @specify_nexus_t_xfer_req: + * @specify_nexus_t_tm_req: called before command is issued to allow vendor + * specific handling to be set for nexus type. * @suspend: called during host controller PM callback * @resume: called during host controller PM callback */ @@ -273,6 +276,9 @@ struct ufs_hba_variant_ops { int (*pwr_change_notify)(struct ufs_hba *, bool, struct ufs_pa_layer_attr *, struct ufs_pa_layer_attr *); + void (*specify_nexus_t_xfer_req)(struct ufs_hba *, + int, struct scsi_cmnd *); + void (*specify_nexus_t_tm_req)(struct ufs_hba *, int, u8); int (*suspend)(struct ufs_hba *, enum ufs_pm_op); int (*resume)(struct ufs_hba *, enum ufs_pm_op); };