* [RFC PATCH v1 0/2] permit to set block parameters per vendor [not found] <CGME20201219044914epcas2p45c64d96a9a9097cc100f6d477c0c36ce@epcas2p4.samsung.com> @ 2020-12-19 4:38 ` Kiwoong Kim [not found] ` <CGME20201219044916epcas2p16927b09270a3d829520af414dd64d80f@epcas2p1.samsung.com> [not found] ` <CGME20201219044917epcas2p271c5a6dbbab952f8f1ba1e6a56f91bca@epcas2p2.samsung.com> 0 siblings, 2 replies; 5+ messages in thread From: Kiwoong Kim @ 2020-12-19 4:38 UTC (permalink / raw) To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen, beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo, sh425.lee, bhoon95.kim Cc: Kiwoong Kim There are some cases of dispatching a command with more than one scatterlist entry and under 4KB size. Device sends just one DATA IN but some SoCs transfer could tranfer data to a physically continuous area, which should have done per each scatterlist entry. Kiwoong Kim (2): ufs: add a vops to configure block parameter ufs: ufs-exynos: set dma_alignment to 4095 drivers/scsi/ufs/ufs-exynos.c | 9 +++++++++ drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 8 ++++++++ 3 files changed, 19 insertions(+) -- 2.7.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CGME20201219044916epcas2p16927b09270a3d829520af414dd64d80f@epcas2p1.samsung.com>]
* [RFC PATCH v1 1/2] ufs: add a vops to configure block parameter [not found] ` <CGME20201219044916epcas2p16927b09270a3d829520af414dd64d80f@epcas2p1.samsung.com> @ 2020-12-19 4:38 ` Kiwoong Kim 2020-12-21 2:57 ` Can Guo 0 siblings, 1 reply; 5+ messages in thread From: Kiwoong Kim @ 2020-12-19 4:38 UTC (permalink / raw) To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen, beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo, sh425.lee, bhoon95.kim Cc: Kiwoong Kim Thers could be some cases to set block paramters per host, because of its own dma structurs or whatever. Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com> --- 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..58f9cb6 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_config_request_queue(hba, sdev); + return 0; } diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 61344c4..657bdbd 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 (*config_request_queue)(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_config_request_queue(struct ufs_hba *hba, + struct scsi_device *sdev) +{ + if (hba->vops && hba->vops->config_request_queue) + hba->vops->config_request_queue(sdev); +} + extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; /* -- 2.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC PATCH v1 1/2] ufs: add a vops to configure block parameter 2020-12-19 4:38 ` [RFC PATCH v1 1/2] ufs: add a vops to configure block parameter Kiwoong Kim @ 2020-12-21 2:57 ` Can Guo 2020-12-21 4:28 ` Kiwoong Kim 0 siblings, 1 reply; 5+ messages in thread From: Can Guo @ 2020-12-21 2:57 UTC (permalink / raw) To: Kiwoong Kim Cc: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen, beanhuo, asutoshd, bvanassche, grant.jung, sc.suh, hy50.seo, sh425.lee, bhoon95.kim On 2020-12-19 12:38, Kiwoong Kim wrote: > Thers could be some cases to set block paramters s/Thers/There/g > per host, because of its own dma structurs or whatever. s/structurs/structure/g > > Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com> > --- > 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..58f9cb6 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_config_request_queue(hba, sdev); How about make it more univeral, like ufshcd_vops_slave_configure()? Thanks, Can Guo. > + > return 0; > } > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index 61344c4..657bdbd 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 (*config_request_queue)(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_config_request_queue(struct ufs_hba > *hba, > + struct scsi_device *sdev) > +{ > + if (hba->vops && hba->vops->config_request_queue) > + hba->vops->config_request_queue(sdev); > +} > + > extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; > > /* ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [RFC PATCH v1 1/2] ufs: add a vops to configure block parameter 2020-12-21 2:57 ` Can Guo @ 2020-12-21 4:28 ` Kiwoong Kim 0 siblings, 0 replies; 5+ messages in thread From: Kiwoong Kim @ 2020-12-21 4:28 UTC (permalink / raw) To: 'Can Guo'; +Cc: linux-scsi > > Thers could be some cases to set block paramters > > s/Thers/There/g > > > per host, because of its own dma structurs or whatever. > > s/structurs/structure/g > > > > > Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com> > > --- > > 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..58f9cb6 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_config_request_queue(hba, sdev); > > How about make it more univeral, like ufshcd_vops_slave_configure()? > > Thanks, > > Can Guo. > Will refer and thanks for all of your comments Thanks. Kiwoong Kim > > + > > return 0; > > } > > > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > > index 61344c4..657bdbd 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 (*config_request_queue)(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_config_request_queue(struct ufs_hba > > *hba, > > + struct scsi_device *sdev) > > +{ > > + if (hba->vops && hba->vops->config_request_queue) > > + hba->vops->config_request_queue(sdev); > > +} > > + > > extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; > > > > /* ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CGME20201219044917epcas2p271c5a6dbbab952f8f1ba1e6a56f91bca@epcas2p2.samsung.com>]
* [RFC PATCH v1 2/2] ufs: ufs-exynos: set dma_alignment to 4095 [not found] ` <CGME20201219044917epcas2p271c5a6dbbab952f8f1ba1e6a56f91bca@epcas2p2.samsung.com> @ 2020-12-19 4:38 ` Kiwoong Kim 0 siblings, 0 replies; 5+ messages in thread From: Kiwoong Kim @ 2020-12-19 4:38 UTC (permalink / raw) To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen, beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo, sh425.lee, bhoon95.kim Cc: Kiwoong Kim 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 <kwmad.kim@samsung.com> --- 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 <linux/of_address.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/blkdev.h> #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) -- 2.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-12-21 4:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20201219044914epcas2p45c64d96a9a9097cc100f6d477c0c36ce@epcas2p4.samsung.com> 2020-12-19 4:38 ` [RFC PATCH v1 0/2] permit to set block parameters per vendor Kiwoong Kim [not found] ` <CGME20201219044916epcas2p16927b09270a3d829520af414dd64d80f@epcas2p1.samsung.com> 2020-12-19 4:38 ` [RFC PATCH v1 1/2] ufs: add a vops to configure block parameter Kiwoong Kim 2020-12-21 2:57 ` Can Guo 2020-12-21 4:28 ` Kiwoong Kim [not found] ` <CGME20201219044917epcas2p271c5a6dbbab952f8f1ba1e6a56f91bca@epcas2p2.samsung.com> 2020-12-19 4:38 ` [RFC PATCH v1 2/2] ufs: ufs-exynos: set dma_alignment to 4095 Kiwoong Kim
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).