From patchwork Wed Dec 23 02:05:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 11987531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8851C43381 for ; Wed, 23 Dec 2020 02:16:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82C9F2312E for ; Wed, 23 Dec 2020 02:16:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbgLWCQt (ORCPT ); Tue, 22 Dec 2020 21:16:49 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:43433 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgLWCQs (ORCPT ); Tue, 22 Dec 2020 21:16:48 -0500 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20201223021605epoutp03152c5a89e28b30d2643fa5cb23c29972~TNtGIgOj-0236402364epoutp03J for ; Wed, 23 Dec 2020 02:16:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20201223021605epoutp03152c5a89e28b30d2643fa5cb23c29972~TNtGIgOj-0236402364epoutp03J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608689765; bh=D/uvCRGnNJdq79Xp4FdfH6T9EVfI76KEykrDHLjFiXc=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=Fsx44hJAR2aVy8ViXcO9ewjWriSpU75cVAeGSzP4wB72iNg+MJRuI59x2GsoQ/+RY ORnywWRCSFzD+VeYjIeDBHnF+1j8uX7sWQiO3/QrfCVlaSZrLBIKtZ/05tKBr6Abu0 15GP4gLufqT2GVC1dcMPHMVsA5wR5wasOZN68lXM= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20201223021604epcas2p41e758b56f4d7bdd1fbf9af3d913a81cb~TNtE9mZQg1663116631epcas2p4d; Wed, 23 Dec 2020 02:16:04 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.182]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4D0xdZ38R0zMqYl3; Wed, 23 Dec 2020 02:16:02 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 49.35.56312.268A2EF5; Wed, 23 Dec 2020 11:16:02 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20201223021601epcas2p1311bd2ee57014e3b536de5a5ca286f85~TNtCsBHlw2896728967epcas2p1J; Wed, 23 Dec 2020 02:16:01 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201223021601epsmtrp22823f0cdfaec2efe95334133ea95ad9b~TNtCrLk_j0278402784epsmtrp2O; Wed, 23 Dec 2020 02:16:01 +0000 (GMT) X-AuditID: b6c32a46-1efff7000000dbf8-75-5fe2a86261ea Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 47.56.13470.168A2EF5; Wed, 23 Dec 2020 11:16:01 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201223021601epsmtip14e529502be8126a69f4e7704c240c2bd~TNtCee9Je1422114221epsmtip1p; Wed, 23 Dec 2020 02:16:01 +0000 (GMT) From: Kiwoong Kim To: linux-scsi@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, asutoshd@codeaurora.org, cang@codeaurora.org, bvanassche@acm.org, grant.jung@samsung.com, sc.suh@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com, bhoon95.kim@samsung.com Cc: Kiwoong Kim Subject: [PATCH v4 1/2] ufs: add a vops to configure block parameter Date: Wed, 23 Dec 2020 11:05:07 +0900 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPJsWRmVeSWpSXmKPExsWy7bCmqW7SikfxBjf/c1g8mLeNzWJv2wl2 i5c/r7JZHHzYyWLxdekzVotpH34yW3xav4zV4tff9ewWqxc/YLFYdGMbk8XNLUdZLLqv72Cz WH78H5NF190bjBZL/71lceD3uHzF2+NyXy+Tx4RFBxg9vq/vYPP4+PQWi0ffllWMHp83yXm0 H+hmCuCIyrHJSE1MSS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LIS8xNtVVy8QnQdcvM ATpeSaEsMacUKBSQWFyspG9nU5RfWpKqkJFfXGKrlFqQklNgaFigV5yYW1yal66XnJ9rZWhg YGQKVJmQk/Hs6UzGgq/cFU9WTGZuYPzA2cXIySEhYCLR+34/SxcjF4eQwA5GiYW/rzBBOJ8Y JZbtvcUI4XxjlGg+upoJpmX9nolsILaQwF5GiavPaiGKfjBKLD/2kxEkwSagKfH05lSwUSIC Z5gkrrW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xi5OSQEDCRWL9nIlsXIxeH kMBuRonbP74yQSQkJU7sfM4IYQtL3G85wgpR9I1R4uueTjaQBJuApsTTm1OZQBIiAveYJC5N mMsMkmAWUJfYNeEE2CRhAReJHxc2gDWwCKhKbLv3jQXE5hWIlpjddpAZYoOcxM1znWA2p4Cl xK7FzUC9HEDbLCQef2DFITyBUWABI8MqRsnUguLc9NxiwwLDvNRyveLE3OLSvHS95PzcTYzg iNDS3MG4fdUHvUOMTByMhxglOJiVRHjNpO7HC/GmJFZWpRblxxeV5qQWH2KU5mBREue90HUy XkggPbEkNTs1tSC1CCbLxMEp1cBknWV8ZsHN3k+bzeUzj1oFvD/z44KG0BKZsOggzVMcAut3 Jm6V0DqTrHWe52LEL7Xq8IjpCwQ2bJm5OZOj5eQ3Vg51Vv+juyfO+sy/ePJv5pOXLAv69hTx laZyHD4UMWnFdCsnwxOZ+3rNy1cZHQ3j+cH/4b6ynEWOsvLG5Tcfz7j8zKPg4xI9m5nu+9ic ns0o3ht4d7PA/OoQd7afO/5NrpexbkqX/vyzqd7d+1jJhni7C/4WVhFRz3lFWg893z1xgWCv bdmpoIRNX7wuLTzSyqbT26mSNVn9qiCXxf1H9l+O/Tkrax6au+jxwfA9dlyqdjLib5adSMpy PrO+LXIyI0vKw6sun64Y7I2fdXSdEktxRqKhFnNRcSIATcjifPcCAAA= X-CMS-MailID: 20201223021601epcas2p1311bd2ee57014e3b536de5a5ca286f85 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201223021601epcas2p1311bd2ee57014e3b536de5a5ca286f85 References: Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There could be some cases to set block parameters per host, because of its own dma structure or whatever. Signed-off-by: Kiwoong Kim Reviewed-by: Can Guo Reviewed-by: Stanley Chu --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 92d433d..5f89b0e 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4758,6 +4758,8 @@ static int ufshcd_slave_configure(struct scsi_device *sdev) ufshcd_crypto_setup_rq_keyslot_manager(hba, q); + ufshcd_vops_slave_configure(hba, sdev); + return 0; } diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 61344c4..4bf4fed 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -329,6 +329,7 @@ struct ufs_hba_variant_ops { void *data); int (*program_key)(struct ufs_hba *hba, const union ufs_crypto_cfg_entry *cfg, int slot); + void (*slave_configure)(struct scsi_device *sdev); }; /* clock gating state */ @@ -1228,6 +1229,13 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba, hba->vops->config_scaling_param(hba, profile, data); } +static inline void ufshcd_vops_slave_configure(struct ufs_hba *hba, + struct scsi_device *sdev) +{ + if (hba->vops && hba->vops->slave_configure) + hba->vops->slave_configure(sdev); +} + extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; /* From patchwork Wed Dec 23 02:05:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 11987533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B52C6C433E9 for ; Wed, 23 Dec 2020 02:16:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BF352313C for ; Wed, 23 Dec 2020 02:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbgLWCQy (ORCPT ); Tue, 22 Dec 2020 21:16:54 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:34769 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbgLWCQx (ORCPT ); Tue, 22 Dec 2020 21:16:53 -0500 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20201223021609epoutp049cd624255aa55b01c6a9186fc93cdaa4~TNtKBA4fr1311813118epoutp04f for ; Wed, 23 Dec 2020 02:16:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20201223021609epoutp049cd624255aa55b01c6a9186fc93cdaa4~TNtKBA4fr1311813118epoutp04f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608689769; bh=lwAQ1PzW0VMl9CBiHdgxELLV18mjj2JnxwNzqNXeoZI=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=iZkFP7Jxe/D09n9FICgWYqXDekm9N5cil4owHC4d8kb7t0vX9jr8bvVy3MkrTf4zm zWz6DAElrIodX4uLriYU142OhjWUKfcpSyEM3/l1B3Cn34ZTunDrfR7Y5FwSj1BZdL S6qLzwa3KTIG2EtH0t97xe5NYIHmfTrwM8fMzT0k= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20201223021608epcas2p356fb0a890bc5066b9b5ccbff0d856549~TNtJSQAP11049510495epcas2p3z; Wed, 23 Dec 2020 02:16:08 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.181]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4D0xdg4kMxzMqYks; Wed, 23 Dec 2020 02:16:07 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 88.C9.05262.368A2EF5; Wed, 23 Dec 2020 11:16:03 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20201223021602epcas2p343141ccef708e29f424d390da5324177~TNtDWEdZL1049510495epcas2p3f; Wed, 23 Dec 2020 02:16:02 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201223021602epsmtrp10b01c0b16a52b62401b49e987f1e64de~TNtDVNduy0837708377epsmtrp1f; Wed, 23 Dec 2020 02:16:02 +0000 (GMT) X-AuditID: b6c32a47-b81ff7000000148e-14-5fe2a8634968 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 78.56.13470.268A2EF5; Wed, 23 Dec 2020 11:16:02 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201223021602epsmtip12a897e3937a6464b1669d71d0593fc9f~TNtDCLhwR1422114221epsmtip1q; Wed, 23 Dec 2020 02:16:02 +0000 (GMT) From: Kiwoong Kim To: linux-scsi@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, asutoshd@codeaurora.org, cang@codeaurora.org, bvanassche@acm.org, grant.jung@samsung.com, sc.suh@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com, bhoon95.kim@samsung.com Cc: Kiwoong Kim Subject: [PATCH v4 2/2] ufs: ufs-exynos: set dma_alignment to 4095 Date: Wed, 23 Dec 2020 11:05:08 +0900 Message-Id: <6fd23159db1254b1a5076d0aec9567e71e1aae27.1608689016.git.kwmad.kim@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIJsWRmVeSWpSXmKPExsWy7bCmmW7yikfxBod6eSwezNvGZrG37QS7 xcufV9ksDj7sZLH4uvQZq8W0Dz+ZLT6tX8Zq8evvenaL1YsfsFgsurGNyeLmlqMsFt3Xd7BZ LD/+j8mi6+4NRoul/96yOPB7XL7i7XG5r5fJY8KiA4we39d3sHl8fHqLxaNvyypGj8+b5Dza D3QzBXBE5dhkpCampBYppOYl56dk5qXbKnkHxzvHm5oZGOoaWlqYKynkJeam2iq5+AToumXm AB2vpFCWmFMKFApILC5W0rezKcovLUlVyMgvLrFVSi1IySkwNCzQK07MLS7NS9dLzs+1MjQw MDIFqkzIyfh78CZjQYtAxcbzTawNjG28XYycHBICJhIrL95i6mLk4hAS2MEoMeHpXijnE6PE 4TdPWCGcb4wSxw+vYodpWXXkGFRiL6NEf9sOZgjnB6PE3tWrWUCq2AQ0JZ7enAo2S0TgDJPE tdazrCAJZgF1iV0TTjCB2MICThLfVi1lBLFZBFQldmyfCxbnFYiWOHVtLgvEOjmJm+c6mUFs TgFLiV2Lm5lQ2VxANTM5JM7/+MoM0eAiceL5NCYIW1ji1fEtUHdLSbzsb4Oy6yX2TW1ghWju YZR4uu8fI0TCWGLWs3YgmwPoUk2J9bv0QUwJAWWJI7dYIO7nk+g4/JcdIswr0dEmBNGoLPFr 0mSoIZISM2/egdrkIfH51ypoaAFtmvp6DesERvlZCAsWMDKuYhRLLSjOTU8tNiowRo6/TYzg tKrlvoNxxtsPeocYmTgYDzFKcDArifCaSd2PF+JNSaysSi3Kjy8qzUktPsRoCg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/OWHWJcHM6fvaVgn6PwvY1/+t9vZ54Y9dTLM15/ifX3 N0ffy/bW/ugM11rydq1vY/7JmyfvtOi3BTouzPzH/aXueCKD+sSDcrMLZx/t4GXTVl9zUjhK IKJUwsT6/5Mz/kvljI5WmrEe2+T2sT+L+cofLgeWv2zBJkoG01WlX+15q3R1us3cnGlL/zHx dXaeaXwkcUt7RuG5qtLjaTbTAlMEpoWcnDarXHu2+clO554rvcl1XBVF7N9Nc4zlrW5lLTzv dJOJaUlObAM/YzOjdcz2bPs7p6PXvJ54dn/zgy5Z/VUZnlFNHiltjXXJsROn+f+2DAxWzJt8 V0raYPmnU2v+7Ds2xdiR1S9TiaU4I9FQi7moOBEAiI7opvcCAAA= X-CMS-MailID: 20201223021602epcas2p343141ccef708e29f424d390da5324177 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201223021602epcas2p343141ccef708e29f424d390da5324177 References: Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Exynos requires one scatterlist entry for smaller than page size, i.e. 4KB. For the cases of dispatching commands with more than one scatterlist entry and under 4KB size, Exynos behaves as follows: Given that a command to read something from device is dispatched with two scatterlist entries that are named AAA and BBB. After dispatching, host builds two PRDT entries and during transmission, device sends just one DATA IN because device doesn't care on host dma. The host then tranfers the whole data from start address of the area named AAA. In consequence, the area that follows AAA would be corrupted. |<------------->| +-------+------------ +-------+ + AAA + (corrupted) ... + BBB + +-------+------------ +-------+ Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufs-exynos.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index a8770ff..8635d9d 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "ufshcd.h" #include "ufshcd-pltfrm.h" @@ -1193,6 +1194,13 @@ static int exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) return 0; } +static void exynos_ufs_slave_configure(struct scsi_device *sdev) +{ + struct request_queue *q = sdev->request_queue; + + blk_queue_update_dma_alignment(q, PAGE_SIZE - 1); +} + static struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .name = "exynos_ufs", .init = exynos_ufs_init, @@ -1204,6 +1212,7 @@ static struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .hibern8_notify = exynos_ufs_hibern8_notify, .suspend = exynos_ufs_suspend, .resume = exynos_ufs_resume, + .slave_configure = exynos_ufs_slave_configure, }; static int exynos_ufs_probe(struct platform_device *pdev)