From patchwork Tue Dec 22 02:21: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: 11985623 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 D8C8FC433E6 for ; Tue, 22 Dec 2020 02:33:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AFE422B3B for ; Tue, 22 Dec 2020 02:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725825AbgLVCdd (ORCPT ); Mon, 21 Dec 2020 21:33:33 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:24099 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgLVCdd (ORCPT ); Mon, 21 Dec 2020 21:33:33 -0500 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20201222023249epoutp02df68fb4f4a761287c89b1a27504cf0c5~S6Sajx9JP0084200842epoutp02q for ; Tue, 22 Dec 2020 02:32:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20201222023249epoutp02df68fb4f4a761287c89b1a27504cf0c5~S6Sajx9JP0084200842epoutp02q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608604369; bh=6otfCUScQsQqUhT8MT7TE9t5Yf/LoIlk1bakCNDOfgs=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=skG1zs2MXQPwGixaVIQ/ZQuVLik1AhNgCAGRxmo6lfdfSh3JzGUr7DlGlsY0c6fna tdA7gTJfUamS9marzDq2eZ4BwpONYAa8obtQly1ygvUHF5a780GqRR+50Auy3RAzgN k3oZ6qswNk4iFW4RckvdnVB4ZO2a8Lgz8hRxsUrc= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20201222023243epcas2p179fd04267ca6df915faa21f5ff9d6baa~S6SVQjvd_2557125571epcas2p13; Tue, 22 Dec 2020 02:32:43 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.183]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4D0L3F6jDfzMqYkZ; Tue, 22 Dec 2020 02:32:41 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 9D.01.52511.9CA51EF5; Tue, 22 Dec 2020 11:32:41 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20201222023238epcas2p14c4beca3db4c11e98cde7e7c037fd4b5~S6SQbIdzL2759527595epcas2p1U; Tue, 22 Dec 2020 02:32:38 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201222023238epsmtrp236bc23534f911247f17aaf9c8cec302a~S6SQZOtIA1587315873epsmtrp2G; Tue, 22 Dec 2020 02:32:38 +0000 (GMT) X-AuditID: b6c32a48-4f9ff7000000cd1f-9a-5fe15ac9a18d Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 92.6E.13470.5CA51EF5; Tue, 22 Dec 2020 11:32:37 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201222023237epsmtip1d9299c62ce724b890a75c6fba1a1d840~S6SQGz5j81491814918epsmtip11; Tue, 22 Dec 2020 02:32:37 +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 v3 1/2] ufs: add a vops to configure block parameter Date: Tue, 22 Dec 2020 11:21:46 +0900 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA1WSb0xbVRjGc27vvS0slZsO9YzEye6cExTWImUHMuY/Qm42jXXOD2PTUuGm dLS3pbc16oeJOhgrG5YN5lgHbFMkm5tdEJGg4NaBK4mYmTqkbAYw0A3kX1cYDFqw5bKo337n vM9znjfveSUiWT0ZJ9FxFtbMafQ0GY23XEtQJnXnDKnlnmolGqxrIVF7qVuMRh/cJNHVocM4 mm3wEejE9AMRuuf8ikALIacYff3FII7O9bVgyNvchaPyP1pJ1Hh9CUO2P/sAaliawF+MYTy/ 72Q8FUcxxn7uCmDmnGUk4x/px5mK5guACTStZw5dKcdUkhz9tgJWk8+a41kuz5iv47SZ9M43 1a+olWlyRZIiHW2l4zmNgc2ks15VJWXr9OHm6fj3NHpr+Eql4Xl6y/ZtZqPVwsYXGHlLJs2a 8vUmhcKUzGsMvJXTJucZDRkKuTxFGVbm6guaR29gppk179c0j4uLwVSUDURJIJUKTwaDRIRl VCuAx0dIG4gO8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zC+5+xi5OSQEDCR+NO9hrGLkYtD SGA3o8Tn71fYIRKSEid2PmeEsIUl7rccYYUo+sYose3SXRaQBJuApsTTm1OZQBIiAveYJC5N mMsMkmAWUJfYNeEEE4gtLOAisfDhO7AGFgFVia0fp7OC2LwC0RIn5p5ghdggJ3HzXCdYL6eA pcS+edfA4kICFhJ/dn5iwyU+gVFgASPDKkbJ1ILi3PTcYsMCw7zUcr3ixNzi0rx0veT83E2M 4KjQ0tzBuH3VB71DjEwcjIcYJTiYlUR4zaTuxwvxpiRWVqUW5ccXleakFh9ilOZgURLnvdB1 Ml5IID2xJDU7NbUgtQgmy8TBKdXAVDeFPy3VtImz9f02w2zDtDK71Beb3//RfdPzNuOvhvWX MO5rTRf7N3ze4i65VrHxrfZ9LcYLDk6Szn9y/iw/EK1rwxX79cgfE73OgDjFRUdyV0R2rzh6 sfpT62vxS+dC6+9sNvii8HD+zbU595tqI+/GfncqCOJc/6swXTtp/ocsxeN/dzVPs5sX8mbq tO75+d5OE7QjVVlehOc3nZWYtvPlswkuNnUFH018mdpblcUL6v9tV/fU3Xgn+eI9fuYOG+6N qj/PHEuNrMk/9vmSTs7Nro0H5Et3LHA2+jqZebptoe+S5PT4GQWLTB8rnlMu3PmEr+NU39k3 /WK+W7mkUv6fsHRVPHEx41pF0sunSizFGYmGWsxFxYkAm75lofkCAAA= X-CMS-MailID: 20201222023238epcas2p14c4beca3db4c11e98cde7e7c037fd4b5 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201222023238epcas2p14c4beca3db4c11e98cde7e7c037fd4b5 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 Reviewed-by: Can Guo --- 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:21: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: 11985621 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 B86FBC433DB for ; Tue, 22 Dec 2020 02:33:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8024822B2B for ; Tue, 22 Dec 2020 02:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725820AbgLVCdd (ORCPT ); Mon, 21 Dec 2020 21:33:33 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:48563 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgLVCdc (ORCPT ); Mon, 21 Dec 2020 21:33:32 -0500 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20201222023250epoutp0152ef0d56db3458dc38818b07ffd91022~S6SbuNsBS3031530315epoutp01c for ; Tue, 22 Dec 2020 02:32:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20201222023250epoutp0152ef0d56db3458dc38818b07ffd91022~S6SbuNsBS3031530315epoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608604370; bh=2/CTmTPc5wn62J2yW6zlmKXNQvZr7UTGRwmPhSaBEJU=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=Bpy3xjDSpo3W9OZjARjPJ2afyrxwLUJIcIDsqsHkJTTNlmWeXK0htdnmDuWdygogf yQY/EZNXeiVezpA27AmQ2mOqG22xDl/kizweWVi1fIyoz3F7nwwGZlsVo7WmCVrjOa mIoebqVWZwVVoMoodLdVrxHLY6vHbUPfAUQjq4rw= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20201222023246epcas2p35d277d31a27545dcd4d0fbaa0c86a879~S6SYnE6oa0622506225epcas2p3o; Tue, 22 Dec 2020 02:32:46 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.187]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4D0L3K6Nymz4x9Pw; Tue, 22 Dec 2020 02:32:45 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 1F.47.10621.DCA51EF5; Tue, 22 Dec 2020 11:32:45 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20201222023244epcas2p2cb8f4f0b0b41a0eeb0207cd1b12ddd8c~S6SWfl44N1441014410epcas2p2o; Tue, 22 Dec 2020 02:32:44 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201222023244epsmtrp2b06d52b9305a81d31d22935e54319ba1~S6SWecU8j1587315873epsmtrp2M; Tue, 22 Dec 2020 02:32:44 +0000 (GMT) X-AuditID: b6c32a45-34dff7000001297d-68-5fe15acda81a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 83.55.08745.CCA51EF5; Tue, 22 Dec 2020 11:32:44 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201222023244epsmtip1c49f38f6b21b88f20eb2797f3ab6883d~S6SWMGZpN1490314903epsmtip1q; Tue, 22 Dec 2020 02:32:44 +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 v3 2/2] ufs: ufs-exynos: set dma_alignment to 4095 Date: Tue, 22 Dec 2020 11:21:47 +0900 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAJsWRmVeSWpSXmKPExsWy7bCmhe7ZqIfxBo8WGFk8mLeNzWJv2wl2 i5c/r7JZHHzYyWLxdekzVotpH34yW3xav4zV4tff9ewWqxc/YLFYdGMbk8XNLUdZLLqv72Cz WH78H5NF190bjBZL/71lceD3uHzF2+NyXy+Tx4RFBxg9vq/vYPP4+PQWi0ffllWMHp83yXm0 H+hmCuCIyrHJSE1MSS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LIS8xNtVVy8QnQdcvM ATpeSaEsMacUKBSQWFyspG9nU5RfWpKqkJFfXGKrlFqQklNgaFigV5yYW1yal66XnJ9rZWhg YGQKVJmQk7FlxxPWglaBinvXdrE2MLbzdjFyckgImEisXveMpYuRi0NIYAejxMpdfxghnE+M EjuP9DFBOJ8ZJWY828cM0zL5dRsrRGIXo0T30R3sEM4PRokzU16xglSxCWhKPL05FaxdROAM k8S11rNgCWYBdYldE04AJTg4hAWcJC60uICEWQRUJbZvW8ACYvMKREts+vuMEWKbnMTNc51g mzkFLCX2zbvGisrmAqqZyyFx6nYDE0SDi8SGP5ugmoUlXh3fwg5hS0l8freXDcKul9g3tQGq uYdR4um+f1ANxhKznrUzghzHDPTB+l36IKaEgLLEkVssEOfzSXQc/ssOEeaV6GgTgmhUlvg1 aTLUEEmJmTfvQG31kDjcvBAavkCb9p48yzSBUX4WwoIFjIyrGMVSC4pz01OLjQoMkaNvEyM4 qWq57mCc/PaD3iFGJg7GQ4wSHMxKIrxmUvfjhXhTEiurUovy44tKc1KLDzGaAgNyIrOUaHI+ MK3nlcQbmhqZmRlYmlqYmhlZKInzFhs8iBcSSE8sSc1OTS1ILYLpY+Lgl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yLVu/kEtWTq/ge8E6peMfutMNRDcesRTY/WCXNe717ot3hyIvvG15GXMuKfy2t fv3zqrfJJ9Mu3r3I9Svvo7o+Sxdbl8/slTtyr/oVnbL5wjun58LL+rknM2u65/ut/nD2QCLD POd86XP+96fs7pjcIPGp9fm76kWfUq9x82y8cKb5+f5XT79zC/NuyXafzea0QmLfiT8rNq46 qvWz8eDJygf6cw8Lzv9ldvLMlpvLdukG/luQ9vna/URFl8tH527Lf7v/CtOGrE3/10UUZ9dc YVkr5mF2ozf996f9ms27/r0quRmpxFKckWioxVxUnAgA6PVAQPcCAAA= X-CMS-MailID: 20201222023244epcas2p2cb8f4f0b0b41a0eeb0207cd1b12ddd8c X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201222023244epcas2p2cb8f4f0b0b41a0eeb0207cd1b12ddd8c 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..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)