From patchwork Fri Aug 21 09:27:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7050751 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 64F5AC05AC for ; Fri, 21 Aug 2015 09:38:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A918205F4 for ; Fri, 21 Aug 2015 09:38:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6074B202FE for ; Fri, 21 Aug 2015 09:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752308AbbHUJiY (ORCPT ); Fri, 21 Aug 2015 05:38:24 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:58894 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753312AbbHUJiU (ORCPT ); Fri, 21 Aug 2015 05:38:20 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTF00O0VERVMOE0@mailout4.samsung.com>; Fri, 21 Aug 2015 18:38:19 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.125]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 34.AF.17770.B81F6D55; Fri, 21 Aug 2015 18:38:19 +0900 (KST) X-AuditID: cbfee691-f79ca6d00000456a-6f-55d6f18b23c0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 36.08.23663.A81F6D55; Fri, 21 Aug 2015 18:38:18 +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 <0NTF008WKEOTM680@mmp1.samsung.com>; Fri, 21 Aug 2015 18:38:18 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vinholikatti@gmail.com, JBottomley@odin.com, Seungwon Jeon Subject: [PATCH 06/10] scsi: ufs: add specific callback for nexus type Date: Fri, 21 Aug 2015 14:57:57 +0530 Message-id: <1440149281-26336-7-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> References: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsWyRsSkVrf747VQg6Mb2Cz+r7/NYnF51xw2 i+7rO9gsPty/yGyxY2GVA6vHzll32T0O//jB7NG3ZRWjx+dNcgEsUVw2Kak5mWWpRfp2CVwZ K7//ZS/4LVax9PtH5gbGlcJdjJwcEgImEhMu/GSEsMUkLtxbz9bFyMUhJLCCUeLYx7nsMEXt 95ZBJZYySvxcchbK+ckosfXQVCaQKjYBbYm707eA2SICNhLnbz4As5kFwiWubZgNNklYwE1i /t1pzCA2i4CqxLrzC4EGcXDwCrhL3JzMB7FMUaL72QQ2EJtTwEPibtM8FhBbCKjk8uVjrCB7 JQSa2SXW/e1kgZgjIPFt8iEWkDkSArISmw4wQ8yRlDi44gbLBEbhBYwMqxhFUwuSC4qT0otM 9YoTc4tL89L1kvNzNzECw/j0v2cTdzDeP2B9iFGAg1GJh3dG5LVQIdbEsuLK3EOMpkAbJjJL iSbnA6MlryTe0NjMyMLUxNTYyNzSTEmcV0f6Z7CQQHpiSWp2ampBalF8UWlOavEhRiYOTilg MNfO/y9qPiWC+f2BRBcmlYAC82h97ozCp35XTp2byxeYocdj8XiudYzB1qbVX1VDeK58Fj6t WLS0vnJuTWHltOqggznP3jVevCTNWXfwRYh1tcWVVs7dz0LsrrV/7vx/4q34jnulB+36fT/8 OeTvMv9B2PL/K3XMdy2drqEU9yK/uLXXfnuBEktxRqKhFnNRcSIA4umt6F4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBIsWRmVeSWpSXmKPExsVy+t9jAd2uj9dCDd6fsrb4v/42i8XlXXPY LLqv72Cz+HD/IrPFjoVVDqweO2fdZfc4/OMHs0ffllWMHp83yQWwRDUw2mSkJqakFimk5iXn p2TmpdsqeQfHO8ebmhkY6hpaWpgrKeQl5qbaKrn4BOi6ZeYA7VVSKEvMKQUKBSQWFyvp22Ga EBripmsB0xih6xsSBNdjZIAGEtYwZqz8/pe94LdYxdLvH5kbGFcKdzFyckgImEi031vGBmGL SVy4tx7I5uIQEljKKPFzyVko5yejxNZDU5lAqtgEtCXuTt8CZosI2Eicv/kAzGYWCJe4tmE2 O4gtLOAmMf/uNGYQm0VAVWLd+YVAgzg4eAXcJW5O5oNYpijR/WwC2GJOAQ+Ju03zWEBsIaCS y5ePsU5g5F3AyLCKUSK1ILmgOCk91zAvtVyvODG3uDQvXS85P3cTIzhWnkntYDy4y/0QowAH oxIP74zIa6FCrIllxZW5hxglOJiVRHitXwCFeFMSK6tSi/Lji0pzUosPMZoC3TWRWUo0OR8Y x3kl8YbGJuamxqaWJhYmZpZK4ryyGzaHCgmkJ5akZqemFqQWwfQxcXBKNTBGXs5u265xQu6B k+n6yycd17MXNgUXufmb3P7y6bF+7v+iL16abvxH+5U5dx+xaFhjadHkNbmd50JWUVW83aVN gfV1Kd8tww/pciv+Tjk6z3Xezvf7H/CqN35n2x9TGXX/USJHvnPyrML0ZK87SkKBzlt0+IRn nhPjP/Bhn2bHgcOdVjvWxSqxFGckGmoxFxUnAgCgwOLzqwIAAA== 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.7 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 | 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 bb143ac..bc27f5e 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 f4ad3df..0b7dde0 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); };