From patchwork Mon Nov 9 05:26:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7581041 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B7EE49F1C2 for ; Mon, 9 Nov 2015 05:30:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C89B7204B0 for ; Mon, 9 Nov 2015 05:30:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B853B20453 for ; Mon, 9 Nov 2015 05:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752154AbbKIF36 (ORCPT ); Mon, 9 Nov 2015 00:29:58 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:51944 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbbKIF34 (ORCPT ); Mon, 9 Nov 2015 00:29:56 -0500 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXJ001Y78LVVN60@mailout1.samsung.com>; Mon, 09 Nov 2015 14:29:55 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.126]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 89.0B.05284.25F20465; Mon, 9 Nov 2015 14:29:55 +0900 (KST) X-AuditID: cbfee68f-f796f6d0000014a4-85-56402f521567 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id EE.99.18629.25F20465; Mon, 9 Nov 2015 14:29:54 +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 <0NXJ002ZM8DXYXP0@mmp1.samsung.com>; Mon, 09 Nov 2015 14:29:54 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: JBottomley@odin.com, vinholikatti@gmail.com, gautam.vivek@samsung.com, essuuj@gmail.com, devicetree@vger.kernel.org, kishon@ti.com Subject: [PATCH v5 07/11] scsi: ufs: add specific callback for nexus type Date: Mon, 09 Nov 2015 10:56:23 +0530 Message-id: <1447046787-480-8-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1447046787-480-1-git-send-email-alim.akhtar@samsung.com> References: <1447046787-480-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRmVeSWpSXmKPExsWyRsSkTjdY3yHMYPE8Rov5R86xWiy/sITJ ou3KQXaL/+tvs1hceNrDZnF51xw2i+7rO9gsdiyscuDw2DnrLrvH4R8/mD36tqxi9Dh+YzuT x+dNcgGsUVw2Kak5mWWpRfp2CVwZ71asZCq4JV2x8mQzawPjWvEuRk4OCQETiV/9W9kgbDGJ C/fWA9lcHEICKxgllh5cxAZTtHPaERaIxFJGic/3V7NDOD8ZJRYv2MACUsUmoC1xd/oWJhBb RMBG4vzNB0wgRcwCHYwSnee2gI0SFvCU6Nu8mRXEZhFQlTiz+iKYzSvgKtG0ZBoLxDpFie5n E8DqOQXcJM7NbGAGsYWAarpenwQ7Q0JgGbvE4p1rGSEGCUh8m3wIKMEBlJCV2HSAGWKOpMTB FTdYJjAKL2BkWMUomlqQXFCclF5krFecmFtcmpeul5yfu4kRGPKn/z3r38F494D1IUYBDkYl Ht6ImfZhQqyJZcWVuYcYTYE2TGSWEk3OB0ZWXkm8obGZkYWpiamxkbmlmZI470Kp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z/Z1P697FWirqNG0VFR78VLBPQsyYh3zT0opsRRnJBpqMRcVJwIA cump3sECAAA= 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=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 | 3 +++ drivers/scsi/ufs/ufshcd.h | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e8b96ec65987..eeb7835c52ab 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1378,6 +1378,7 @@ 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); + ufshcd_vops_specify_nexus_t_xfer_req(hba, tag, lrbp); ufshcd_send_command(hba, tag); out_unlock: spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -1578,6 +1579,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, hba->dev_cmd.complete = &wait; spin_lock_irqsave(hba->host->host_lock, flags); + ufshcd_vops_specify_nexus_t_xfer_req(hba, tag, lrbp); ufshcd_send_command(hba, tag); spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -3842,6 +3844,7 @@ 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 */ + ufshcd_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 500e137bf68a..b3dd08420100 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -259,6 +259,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 * @dbg_register_dump: used to dump controller debug information @@ -280,6 +283,9 @@ struct ufs_hba_variant_ops { enum ufs_notify_change_status status, 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); void (*dbg_register_dump)(struct ufs_hba *hba); @@ -811,4 +817,17 @@ static inline void ufshcd_vops_dbg_register_dump(struct ufs_hba *hba) hba->vops->dbg_register_dump(hba); } +static inline void ufshcd_vops_specify_nexus_t_xfer_req(struct ufs_hba *hba, + int tag, struct ufshcd_lrb *lrbp) +{ + if (hba->vops && hba->vops->specify_nexus_t_xfer_req) + hba->vops->specify_nexus_t_xfer_req(hba, tag, lrbp->cmd); +} + +static inline void ufshcd_vops_specify_nexus_t_tm_req(struct ufs_hba *hba, + int free_slot, u8 tm_function) +{ + if (hba->vops && hba->vops->specify_nexus_t_tm_req) + hba->vops->specify_nexus_t_tm_req(hba, free_slot, tm_function); +} #endif /* End of Header */