From patchwork Tue Dec 22 02:06:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 11985611 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, 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 2325CC433E0 for ; Tue, 22 Dec 2020 02:18:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAF5F22AED for ; Tue, 22 Dec 2020 02:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbgLVCSY (ORCPT ); Mon, 21 Dec 2020 21:18:24 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:38724 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgLVCSY (ORCPT ); Mon, 21 Dec 2020 21:18:24 -0500 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20201222021741epoutp01012dc5fbbd4d2ab50189ccefa4929898~S6FNOmGO81804918049epoutp01Y for ; Tue, 22 Dec 2020 02:17:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20201222021741epoutp01012dc5fbbd4d2ab50189ccefa4929898~S6FNOmGO81804918049epoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608603461; bh=6otfCUScQsQqUhT8MT7TE9t5Yf/LoIlk1bakCNDOfgs=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=kKSE00OyrdZ/y6rYy7OoUaRs57XeD8zndDo/FP5oTKTTSJv2jRCpBsrw2kLzSIUaQ +ifQiU0+jZbsp4UvQM00oWL8kVUPaWVBcxLXY9x32SYOiBx9HP/8SvtZOX5YR/XZLK aaAdrTMwfEnsdMTbB0Zf5gcWeqsiHrKfvCrhaOcc= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20201222021740epcas2p40768d6d079dcea6fd6f2b05779b8d9ce~S6FMmtC9z1254512545epcas2p4v; Tue, 22 Dec 2020 02:17:40 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4D0Kjv4M2Jz4x9Q6; Tue, 22 Dec 2020 02:17:39 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 9E.52.05262.34751EF5; Tue, 22 Dec 2020 11:17:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20201222021738epcas2p2e7527ad5ab8a7af8149574516bc1209f~S6FK8FRC53122631226epcas2p26; Tue, 22 Dec 2020 02:17:38 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201222021738epsmtrp28368c0e665a19bdd1d82de6b91335c4a~S6FK63mLD0835108351epsmtrp2J; Tue, 22 Dec 2020 02:17:38 +0000 (GMT) X-AuditID: b6c32a47-b81ff7000000148e-f8-5fe15743a44f Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 8A.9C.13470.24751EF5; Tue, 22 Dec 2020 11:17:38 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201222021738epsmtip1482ceb54fcce53641be8a6e0708cdb75~S6FKu4zeV0722807228epsmtip1F; Tue, 22 Dec 2020 02:17:38 +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 v2 1/2] ufs: add a vops to configure block parameter Date: Tue, 22 Dec 2020 11:06:46 +0900 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAJsWRmVeSWpSXmKPExsWy7bCmha5z+MN4g+VtChYP5m1js9jbdoLd 4uXPq2wWBx92slh8XfqM1WLah5/MFp/WL2O1+PV3PbvF6sUPWCwW3djGZHFzy1EWi+7rO9gs lh//x2TRdfcGo8XSf29ZHPg9Ll/x9rjc18vkMWHRAUaP7+s72Dw+Pr3F4tG3ZRWjx+dNch7t B7qZAjiicmwyUhNTUosUUvOS81My89JtlbyD453jTc0MDHUNLS3MlRTyEnNTbZVcfAJ03TJz gI5XUihLzCkFCgUkFhcr6dvZFOWXlqQqZOQXl9gqpRak5BQYGhboFSfmFpfmpesl5+daGRoY GJkCVSbkZGx5eYGp4At3xcwtb9gbGN9zdjFycEgImEhsfM/dxcjFISSwg1Hi58WbzBDOJ0aJ WwumMEE43xglehq+snUxcoJ1tLVsY4dI7GWU6Hy+lhHC+cEosevAerAqNgFNiac3p4K1iwic YZK41nqWFSTBLKAusW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YxcnJICJhItLVsY+9i5OIQ EtjNKDFx8ix2iISkxImdzxkhbGGJ+y1HWCGKvjFKzG+8wgaSYBPQlHh6cyoTSEJE4B6TxKUJ c5lBEswC6hK7JpxgArGFBVwkrlzeDzaVRUBV4trrGSwgNq9AtMTaPR1sEBvkJG6e6wTr5RSw lLh6fw0riC0kYCGxdtFENlziExgFFjAyrGKUTC0ozk3PLTYsMMxLLdcrTswtLs1L10vOz93E CI4KLc0djNtXfdA7xMjEwXiIUYKDWUmE10zqfrwQb0piZVVqUX58UWlOavEhRmkOFiVx3gtd J+OFBNITS1KzU1MLUotgskwcnFINTLOlKh/1nu9l+b3d5HKw9JrnPJ2pzUcuLZR193A6d1vW 9f+x05mrD8n52p86+vk2S9X1mBT7x4diHz90qG2dKSGUcq1rnejHzHcyGb/l9qyfvWnZp6jj nLc5+u5lW+1Vnzb9zS3X+W6aPvxGM7eZb/TdO3/R4Q7b3fN+fXy+2Gz+CrX0CY6rkq9r7ZrK zL8mhTfChf/TjuupLt/WcHT7xxhst3vzUSOqpzdS9LyERfoBZskHQvJ/zn9kj5k1deaSf48l XvOXvbS20cg45G65/8hL+6aAKAcBfyvrv0W7j1xJkO/4f9Od1+p7R9qeUydur5hyleXtXJOg V7+9ntvnz7FR5N8e0N59himem1st10+JpTgj0VCLuag4EQAFFI7d+QIAAA== X-CMS-MailID: 20201222021738epcas2p2e7527ad5ab8a7af8149574516bc1209f X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201222021738epcas2p2e7527ad5ab8a7af8149574516bc1209f References: Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There could be some cases to set block paramters per host, because of its own dma structure or whatever. Signed-off-by: Kiwoong Kim --- 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 Tue Dec 22 02:06:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 11985613 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, 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 0C3CCC433E6 for ; Tue, 22 Dec 2020 02:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC30F22ADC for ; Tue, 22 Dec 2020 02:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725961AbgLVCSZ (ORCPT ); Mon, 21 Dec 2020 21:18:25 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:38737 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgLVCSZ (ORCPT ); Mon, 21 Dec 2020 21:18:25 -0500 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20201222021742epoutp01109e01fe7346220c3a5982eb7f93b131~S6FN0M98g1752717527epoutp01H for ; Tue, 22 Dec 2020 02:17:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20201222021742epoutp01109e01fe7346220c3a5982eb7f93b131~S6FN0M98g1752717527epoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608603462; bh=Cvf+OC80gBYPC5u3wt1AfMt70HIPfTUiDHhhhgEAQSM=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=seWqdWx6ciDgl9YfiajTbXpkWcyVfYA5f7VH38qlGq+vaEd9LSxwnjLOw6WPvJLk4 +gNEagq+dR0ZX9fxyy3PvU6NHLwFbq2SX1FanWFIHke/p3odn2xkcuKzkzFupn/9/v T1hpkUIn15kfOCIENqBBwFaJHDCqWJcrA1zuSrC8= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20201222021741epcas2p348dc9ea9d590bf0b74df3c7f2fd10784~S6FNLCcMV2886528865epcas2p37; Tue, 22 Dec 2020 02:17:41 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4D0Kjw1Kwrz4x9Pw; Tue, 22 Dec 2020 02:17:40 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id ED.48.52511.34751EF5; Tue, 22 Dec 2020 11:17:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20201222021739epcas2p306802e943b386815e819259681c9efd4~S6FLh-bQN2888128881epcas2p32; Tue, 22 Dec 2020 02:17:39 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201222021739epsmtrp237c805a36316345df67b6f9dae752fb4~S6FLgUQcA0835008350epsmtrp2N; Tue, 22 Dec 2020 02:17:39 +0000 (GMT) X-AuditID: b6c32a48-4f9ff7000000cd1f-00-5fe15743f6f3 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id BF.73.08745.34751EF5; Tue, 22 Dec 2020 11:17:39 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201222021739epsmtip11682bd4a14c30e72e0a1e78f77567a8a~S6FLPSWeR0722207222epsmtip1t; Tue, 22 Dec 2020 02:17:39 +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 v2 2/2] ufs: ufs-exynos: set dma_alignment to 4095 Date: Tue, 22 Dec 2020 11:06:47 +0900 Message-Id: <750d12f8707189b51d0f1befb5f264a247e05cef.1608602725.git.kwmad.kim@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIJsWRmVeSWpSXmKPExsWy7bCmua5z+MN4g6sHLC0ezNvGZrG37QS7 xcufV9ksDj7sZLH4uvQZq8W0Dz+ZLT6tX8Zq8evvenaL1YsfsFgsurGNyeLmlqMsFt3Xd7BZ LD/+j8mi6+4NRoul/96yOPB7XL7i7XG5r5fJY8KiA4we39d3sHl8fHqLxaNvyypGj8+b5Dza D3QzBXBE5dhkpCampBYppOYl56dk5qXbKnkHxzvHm5oZGOoaWlqYKynkJeam2iq5+AToumXm AB2vpFCWmFMKFApILC5W0rezKcovLUlVyMgvLrFVSi1IySkwNCzQK07MLS7NS9dLzs+1MjQw MDIFqkzIyTjZ18tSMEWgYvnBu6wNjNN4uxg5OSQETCT6385k72Lk4hAS2MEo0bT5FxOE84lR 4ur8vYwQzmdGiTurH7PCtLTe6oSq2sUo8fD9DBYI5wejxP7G6ywgVWwCmhJPb04FqxIROMMk ca31LFg7s4C6xK4JJ5hAbGEBJ4n3f18wg9gsAqoSbS+WMYLYvALREqsX3GKDWCcncfNcJ1gN p4ClxNX7a1hR2VxANTM5JGZcusgM0eAiceHFJKhmYYlXx7ewQ9hSEp/f7YWK10vsm9oA1dzD KPF03z9GiISxxKxn7UA2B9ClmhLrd+mDmBICyhJHbrFA3M8n0XH4LztEmFeio00IolFZ4tek yVBDJCVm3rwDtdVD4u6STayQAALaNHHidJYJjPKzEBYsYGRcxSiWWlCcm55abFRgghx/mxjB aVXLYwfj7Lcf9A4xMnEwHmKU4GBWEuE1k7ofL8SbklhZlVqUH19UmpNafIjRFBiQE5mlRJPz gYk9ryTe0NTIzMzA0tTC1MzIQkmct8jgQbyQQHpiSW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ek8Mz6GdpU/sxWQDThmPTc3rT/f9Rbbh6PyVRtXZydYro0+6lp1+Kjj 5Ev3+dZ5FtqEG1mdKJ4VWfdmYdILlUUPomuOByeLLfyzcYLr1PW3L99Om/Jg/8F7h/jf5L9V Wl6THGjf+qsiUVRs2yXlpMJEaRmRL7+ecIX2nTroIxE5Pajg3wWe7msPv9yz/F11t88w8qW5 Swqjr/ENj6UcjyKNP7GLmls3vT8ae6fJRXiN3MPbKeL/3rcFX+3etmK6wwY/nfRe87ZZP58f e/kr8+SqA4nvbzs6tSpe6ej3VGIpzkg01GIuKk4EAAKkaf35AgAA X-CMS-MailID: 20201222021739epcas2p306802e943b386815e819259681c9efd4 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201222021739epcas2p306802e943b386815e819259681c9efd4 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 consequebnce, 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..1fd5265 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_config_request_queue(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, + .config_request_queue = exynos_ufs_config_request_queue, }; static int exynos_ufs_probe(struct platform_device *pdev)