RE: [PATCH v6 1/9] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-09-23 Thread Avri Altman
> > Signed-off-by: Tomas Winkler > Signed-off-by: Alexander Usyskin Tested-by: Avri Altman - mmc - full functionality. One issue found that was fixed on V6: patch V6 2/9. - ufs - read & read counter only. Testing is still wip. > +static int rpmb_request_verify(struc

RE: [PATCH 1/1] scsi: ufs: make sure all interrupts are processed

2018-01-30 Thread Avri Altman
Hi, Can you elaborate how this can even happen? Isn't the interrupt aggregation capability should attend for those cases? Thanks, Avri > -Original Message- > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > ow...@vger.kernel.org] On Behalf Of Asutosh Das > Sent: Tuesday, Janua

RE: [PATCH v9] mmc: Export host capabilities to debugfs.

2018-03-12 Thread Avri Altman
> -Original Message- > From: Andy Shevchenko [mailto:andriy.shevche...@linux.intel.com] > Sent: Monday, March 12, 2018 12:08 PM > To: Harish Jenny K N ; ulf.hans...@linaro.org; > linus.wall...@linaro.org; adrian.hun...@intel.com; shawn.lin@rock- > chips.com; Avri A

RE: [PATCH v9] mmc: Export host capabilities to debugfs.

2018-03-12 Thread Avri Altman
> -Original Message- > From: Harish Jenny K N [mailto:harish_kand...@mentor.com] > Sent: Monday, March 12, 2018 1:17 PM > To: Avri Altman ; Andy Shevchenko > ; ulf.hans...@linaro.org; > linus.wall...@linaro.org; adrian.hun...@intel.com; shawn@rock-chi

RE: [PATCH v6] mmc: Export host capabilities to debugfs.

2018-03-06 Thread Avri Altman
> -Original Message- > From: Harish Jenny K N [mailto:harish_kand...@mentor.com] > Sent: Wednesday, March 07, 2018 7:38 AM > To: ulf.hans...@linaro.org; linus.wall...@linaro.org; > adrian.hun...@intel.com; shawn@rock-chips.com; Avri Altman > ; andriy.shevche...@li

RE: [PATCH 5/8] bsg: refactor bsg_ioctl

2018-11-19 Thread Avri Altman
; > --- > > block/bsg.c | 158 > > 1 file changed, 72 insertions(+), 86 deletions(-) > > > > Looks fine to me. Did ran the same small test-tool I ran against Jens' > patches, nothing broke. > > Reviewed-by: Benjamin Block > Tested-by: Benjamin Block Test

RE: [PATCH 6/8] bsg-lib: handle bidi requests without block layer help

2018-11-19 Thread Avri Altman
owing for the eventual > removal of the latter. > > Signed-off-by: Christoph Hellwig Tested-by: Avri Altman Regardless of the ongoing discussion with Benjamin - Tested the scsi pass-through (ufs-bsg) path - nothing is broken.

RE: [PATCH] scsi: ufs: revamp string descriptor reading

2018-12-11 Thread Avri Altman
Hello Tomas, > > Define new a type: uc_string_id for easier string > handling and less casting. Reduce number or string > copies in price of a dynamic allocation. > > Signed-off-by: Tomas Winkler Tested-by: Avri Altman Just one nit - doesn't really matters. Cheers,

RE: [PATCH 1/7] mmc-utils: interpret OPTIMAL_*_SIZE fields in extcsd

2018-10-10 Thread Avri Altman
Looks fine. Thanks, Avri > eMMC 5.0 introduced OPTIMAL_READ_SIZE, OPTIMAL_WRITE_SIZE and > OPTIMAL > TRIM_UNIT_SIZE fields in the extcsd > > Interpret these fields when reading out the extcsd with human-readable > results > > Signed-off-by: James Nuss Reviewed-by: Avri Altman

RE: [PATCH 2/7] mmc-utils: treat FIRMWARE_VERSION as binary field instead of string

2018-10-10 Thread Avri Altman
> +++ b/mmc_cmds.c > @@ -1758,8 +1758,15 @@ int do_read_extcsd(int nargs, char **argv) > } > > if (ext_csd_rev >= 7) { > - printf("eMMC Firmware Version: %s\n", > - (char*)&ext_csd[EXT_CSD_FIRMWARE_VERSION]); > + printf("Firmware Version: >

RE: [PATCH 2/7] mmc-utils: treat FIRMWARE_VERSION as binary field instead of string

2018-10-10 Thread Avri Altman
> > On Wed, Oct 10, 2018 at 4:43 AM Avri Altman wrote: > > > > > > > +++ b/mmc_cmds.c > > > @@ -1758,8 +1758,15 @@ int do_read_extcsd(int nargs, char **argv) > > > } > > > > > > if (ext_csd_rev

RE: [PATCH v3 1/2] mmc: block: Issue flush only if allowed

2021-04-20 Thread Avri Altman
> On 20/04/21 8:53 am, Avri Altman wrote: > > The cache may be flushed to the nonvolatile storage by writing to > > FLUSH_CACHE byte (EXT_CSD byte [32]). When in command queueing mode, > the > > cache may be flushed by issuing a CMDQ_TASK_ DEV_MGMT (CMD48) with a > >

[PATCH v4 0/2] Do not flush cache when it is disabled

2021-04-20 Thread Avri Altman
red to an access to the main nonvolatile storage. The cache function can be turned ON and OFF. Once OFF, the host is not expected to issue a flush-cache command to the device. Avri Altman (2): mmc: block: Issue flush only if allowed mmc: block: Update ext_csd.cache_ctrl if it was written

[PATCH v4 1/2] mmc: block: Issue flush only if allowed

2021-04-20 Thread Avri Altman
so. fixes: 1e8e55b67030 (mmc: block: Add CQE support) Reported-by: Brendan Peter Tested-by: Brendan Peter Signed-off-by: Avri Altman --- drivers/mmc/core/block.c | 9 + drivers/mmc/core/mmc.c | 2 +- drivers/mmc/core/mmc_ops.h | 5 + 3 files changed, 15 insertions(+), 1

[PATCH v4 2/2] mmc: block: Update ext_csd.cache_ctrl if it was written

2021-04-20 Thread Avri Altman
The cache function can be turned ON and OFF by writing to the CACHE_CTRL byte (EXT_CSD byte [33]). However, card->ext_csd.cache_ctrl is only set on init if cache size > 0. Fix that by explicitly setting ext_csd.cache_ctrl on ext-csd write. Signed-off-by: Avri Altman Acked-by: Adrian

RE: [PATCH v32 4/4] scsi: ufs: Add HPB 2.0 support

2021-04-20 Thread Avri Altman
> Hi, > > if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION && > > (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) { > > - dev_info->hpb_enabled = true; > > + bool hpb_en = false; > > + > > ufshpb_get_dev_info(hba, desc_buf); > > +

RE: [PATCH 4/4] scsi: ufs: make ufshcd_config_pwr_mode of non-static func

2018-05-16 Thread Avri Altman
the same. > > Signed-off-by: Seungwon Jeon > Signed-off-by: Alim Akhtar Acked-by: Avri Altman Might be also useful exporting an API for all uic commands? Thanks, Avri

RE: [PATCH v1] mmc: core: Verify SD bus width

2019-04-16 Thread Avri Altman
bus width. > > verified it didn't mount. > > Signed-off-by: Raul E Rangel Acked-by: Avri Altman > --- > AMD SDHC Device 7806 can get into a bad state after a card disconnect > where anything transferred via the DATA lines will always result in a > zero filled buffer.

RE: [PATCH v1 1/4] mmc: core: Add trace event for SD SCR response

2019-04-16 Thread Avri Altman
> > On Mon, 15 Apr 2019 16:52:38 -0600 > Raul E Rangel wrote: > > > Example: > > sd_scr: mmc0: version: 2, spec3: 1, width: 5, cmds: 0, raw: {0x2b58000,0x0} > > > > Signed-off-by: Raul E Rangel > > --- > > > > drivers/mmc/core/sd.c | 4 > > include/trace/events/mmc.h | 42 >

RE: [PATCH v2] mmc: core: Verify SD bus width

2019-04-17 Thread Avri Altman
he > DATA lines. By checking that the response was invalid, we can abort > mounting the card. > > Acked-by: Avri Altman > > Signed-off-by: Raul E Rangel Reviewed-by: Avri Altman Thanks, Avri

RE: [PATCH v4 3/3] scsi: ufs-bsg: Allow reading descriptors

2019-02-05 Thread Avri Altman
Martin, Any further comments? Thanks, Avri > -Original Message- > From: Evan Green > Sent: Monday, January 28, 2019 8:42 PM > To: Avri Altman > Cc: James E.J. Bottomley ; Martin K. Petersen > ; SCSI ; LKML > ; Avi Shchislowski ; > Alex Lemberg > Subject: R

RE: [PATCH 1/3] mmc: core: Calculate the discard arg only once

2019-02-05 Thread Avri Altman
> On Sun, 3 Feb 2019 at 09:51, Avri Altman wrote: > > > > The discard arg is a read-only ext_csd parameter - > > set it once on card init. > > I like the idea here. There is really no point checking this for every > corresponding request, nice! > > However,

[PATCH v2 1/3] mmc: core: Calculate the discard arg only once

2019-02-06 Thread Avri Altman
In MMC, the discard arg is a read-only ext_csd parameter - set it once on card init. To be consistent, do that for SD as well even though its discard arg is always 0x0. Signed-off-by: Avri Altman --- drivers/mmc/core/block.c | 12 +++- drivers/mmc/core/core.c | 4 ++-- drivers/mmc

[PATCH v2 2/3] mmc: core: Indicate SD specs higher than 4.0

2019-02-06 Thread Avri Altman
SD specs version 4.x and 5.x have a dedicated slices in the SCR register. Higher versions will rely on a combination of the existing fields. Signed-off-by: Avri Altman --- drivers/mmc/core/sd.c| 5 + include/linux/mmc/card.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers

[PATCH v2 0/3] mmc: core: Add SD Discard support

2019-02-06 Thread Avri Altman
o "erase_arg", and elaborate the change log. Avri Altman (3): mmc: core: Calculate the discard arg only once mmc: core: Indicate SD specs higher than 4.0 mmc: core: Add discard support to sd drivers/mmc/core/block.c | 12 +++- drivers/mmc/core/core.c | 8 ++-- d

[PATCH v2 3/3] mmc: core: Add discard support to sd

2019-02-06 Thread Avri Altman
version that introduce it. Signed-off-by: Avri Altman --- drivers/mmc/core/core.c | 6 +- drivers/mmc/core/sd.c | 10 +- include/linux/mmc/sd.h | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index de0f1a1

RE: [PATCH v3 6/8] scsi: ufs: qcom: Expose the reset controller for PHY

2019-02-06 Thread Avri Altman
Hi, > On 06/02/19 12:29 AM, Evan Green wrote: > > Expose a reset controller that the phy will later use to control its > > own PHY reset in the UFS controller. This will enable the combining > > of PHY init functionality into a single function. > > > > Signed-off-by: Evan Green > > I'd like to g

[PATCH v4 1/3] scsi: ufs-bsg: Change the calling convention for write descriptor

2019-01-26 Thread Avri Altman
bytes), is by using the job request payload data buffer. So change this ABI now, while ufs-bsg is still new, and nobody is actually using it. Signed-off-by: Avri Altman Reviewed-by: Evan Green --- Documentation/scsi/ufs.txt | 6 ++ drivers/scsi/ufs/ufs_bsg.c | 47

[PATCH v4 0/3] scsi: ufs-bsg: Add read descriptor

2019-01-26 Thread Avri Altman
by tag. v1->v2: Withdraw from the attempt to change the reply buffer, instead place the descriptor being read in the actual data buffer in the bio. Avri Altman (3): scsi: ufs-bsg: Change the calling convention for write descriptor scsi: ufs: Allow reading descriptor via raw upiu scsi

[PATCH v4 3/3] scsi: ufs-bsg: Allow reading descriptors

2019-01-26 Thread Avri Altman
write descriptor, and din_xferp for read descriptor. Signed-off-by: Avri Altman --- Documentation/scsi/ufs.txt | 7 ++- drivers/scsi/ufs/ufs_bsg.c | 20 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Documentation/scsi/ufs.txt b/Documentation/scsi/ufs.txt

[PATCH v4 2/3] scsi: ufs: Allow reading descriptor via raw upiu

2019-01-26 Thread Avri Altman
Allow to read descriptors via raw upiu. This in fact was forbidden just as a precaution, as ufs-bsg actually enforces which functionality is supported. Signed-off-by: Avri Altman Reviewed-by: Evan Green --- drivers/scsi/ufs/ufshcd.c | 20 ++-- 1 file changed, 14 insertions

RE: [PATCH v2 3/3] mmc: core: Add discard support to sd

2019-02-25 Thread Avri Altman
Ulf hi, Thanks a lot for your comments. > > On Wed, 6 Feb 2019 at 12:29, Avri Altman wrote: > > > > SD spec v5.1 adds discard support. The flows and commands are similar to > > mmc, so just set the discard arg in CMD38. > > So this means that we from now on, if th

RE: [PATCH v5 1/2] scsi: ufs: Do not disable vccq in UFSHC driver

2019-02-26 Thread Avri Altman
t all in the DT. > > Working around that fact in the driver is detrimental, as evidenced > by the failure to initialize the host controller on MSM8998. > > Revert the original patch, and clean up loose ends in the next patch. > > Relevant patches: > > 60f0187031c05e04cbadffb62f557d0ff3564490 > c58ab7aab71e2c783087115f0ce1623c2fdcf0b2 > 46c1cf706076500cdcde3445be97233793eec7f1 > > Signed-off-by: Marc Gonzalez Acked-by: Avri Altman

RE: [PATCH v5 2/2] scsi: ufs: Remove unused device quirks

2019-02-26 Thread Avri Altman
> > The UFSHC driver defines a few quirks that are not used anywhere: > > UFS_DEVICE_QUIRK_BROKEN_LCC > UFS_DEVICE_NO_VCCQ > UFS_DEVICE_QUIRK_NO_LINK_OFF > UFS_DEVICE_NO_FASTAUTO > > Let's remove them. > > Signed-off-by: Marc Gonzalez Acked-by: Avri Altman

RE: [REPOST PATCH v4 0/3] scsi: ufs-bsg: Add read descriptor

2019-02-26 Thread Avri Altman
t; Update Reviewed-by tag. > > V2->v3: > Add a prep patch with write descriptor calling convention changes. > Elaborate the commit log of ufs-bsg: Allow reading descriptors > Add Reviewed-by tag. > > v1->v2: > Withdraw from the attempt to change the reply buffer,

[PATCH v3 0/2] mmc: core: Add SD Discard support

2019-02-26 Thread Avri Altman
ean some inconsistency in arg checking in mmc_erase(). Add a patch to set the timeout for sd discard. V1->v2: In the first patch, assign the discard arg for SD cards as well to keep the code consistent. Rename "discard_arg" to "erase_arg", and elaborate the change log. Av

[PATCH v3 1/2] mmc: core: Add discard support to sd

2019-02-26 Thread Avri Altman
ntain either '0's or '1's, depends on the content of DATA_STAT_AFTER_ERASE (b55) in the scr register. One more important difference compared to ERASE is the busy timeout which we will address on the next patch. Signed-off-by: Avri Altman --- drivers/mmc/core/core.c | 8 --

[PATCH v3 2/2] mmc: core: Add sd discard timeout

2019-02-26 Thread Avri Altman
The busy timeout is 250msec per discard command. Signed-off-by: Avri Altman --- drivers/mmc/core/core.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index b7367ac..4979d4e 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core

RE: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-13 Thread Avri Altman
> + } else { Is it possible to get here? Scsi_scan_host is called only after successful add_wluns > + /* device wlun is probed */ > + hba->luns_avail--; > + } > +} > + > > /** > @@ -7254,6 +7312,14 @@ static int ufshcd_scsi_add_wlus(struct ufs_hba > *hba

RE: [PATCH v22 2/4] scsi: ufs: L2P map management for HPB read

2021-02-22 Thread Avri Altman
> +/* > + * This function will parse recommended active subregion information in > sense > + * data field of response UPIU with SAM_STAT_GOOD state. > + */ > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > +{ > + struct ufshpb_lu *hpb; > + struct scsi_device *sdev;

RE: [PATCH v22 2/4] scsi: ufs: L2P map management for HPB read

2021-02-22 Thread Avri Altman
> + if (!ufshpb_is_hpb_rsp_valid(hba, lrbp, rsp_field)) > + return; > + > + hpb->stats.rb_noti_cnt++; > + switch (rsp_field->hpb_op) { > + case HPB_RSP_NONE: > + /* nothing to do */ > + break; Maybe checks this too in ufshpb_is_hpb

RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Avri Altman
> + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1, > &ppn); > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags); > + if (unlikely(err < 0)) { > + /* > +* In this case, the region state is active, > +* but the pp

RE: RE: RE: [PATCH v22 2/4] scsi: ufs: L2P map management for HPB read

2021-02-23 Thread Avri Altman
> > > +/* > > > + * This function will parse recommended active subregion information in > > > sense > > > + * data field of response UPIU with SAM_STAT_GOOD state. > > > + */ > > > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > > > +{ > > > + struct ufshpb_lu *hpb; >

RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Avri Altman
> > > > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1, > &ppn); > > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags); > > > + if (unlikely(err < 0)) { > > > + /* > > > +* In this case, the region state is active, > > > +

RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Avri Altman
> > > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1, > > &ppn); > > > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags); > > > > + if (unlikely(err < 0)) { > > > > + /* > > > > +* In this case, the region state is active, >

RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-23 Thread Avri Altman
> @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct Scsi_Host > *host, struct scsi_cmnd *cmd) > > lrbp->req_abort_skip = false; > > - ufshpb_prep(hba, lrbp); > + err = ufshpb_prep(hba, lrbp); > + if (err == -EAGAIN) { > + lrbp->cmd = NULL; > +

RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Avri Altman
> +static int ufshpb_fill_ppn_from_page(struct ufshpb_lu *hpb, > +struct ufshpb_map_ctx *mctx, int pos, > +int len, u64 *ppn_buf) > +{ > + struct page *page; > + int index, offset; > + int copied; > + > +

RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> + copied = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, > + pre_req->wb.len - offset, > + &addr[offset]); > + > + if (copied < 0) > + goto mctx_error; > + > + offset += co

RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> > > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct > Scsi_Host > > > *host, struct scsi_cmnd *cmd) > > > > > > lrbp->req_abort_skip = false; > > > > > > - ufshpb_prep(hba, lrbp); > > > + err = ufshpb_prep(hba, lrbp); > > > + if (err == -EAGAIN) { > > > +

RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> > > > > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct > > Scsi_Host > > > > *host, struct scsi_cmnd *cmd) > > > > > > > > lrbp->req_abort_skip = false; > > > > > > > > - ufshpb_prep(hba, lrbp); > > > > + err = ufshpb_prep(hba, lrbp); > > > > + if (err ==

RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION && > (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) { > - dev_info->hpb_enabled = true; > + bool hpb_en = false; > + > ufshpb_get_dev_info(hba, desc_buf); > + > + e

RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb) Maybe ufshpb_issue_umap_all_req is just a wrapper for ufshpb_issue_umap_req? e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ? Then on host mode inactivation: static int ufshpb_issue_umap_single_req(struct ufshpb_lu *

RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> > > > +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb) > Maybe ufshpb_issue_umap_all_req is just a wrapper for > ufshpb_issue_umap_req? > e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ? > Then on host mode inactivation: > static int ufshpb_issue_umap_single_req(s

RE: RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Avri Altman
> > > > > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct > > > > Scsi_Host > > > > > > *host, struct scsi_cmnd *cmd) > > > > > > > > > > > > lrbp->req_abort_skip = false; > > > > > > > > > > > > - ufshpb_prep(hba, lrbp); > > > > > > + err = ufshpb_prep(hba, lrbp

RE: [PATCH v19 3/3] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-10 Thread Avri Altman
> +static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx, > + int srgn_idx, int srgn_offset, int cnt) > +{ > + struct ufshpb_region *rgn; > + struct ufshpb_subregion *srgn; > + int bitmap_len = hpb->entries_per_srgn; > + int bi

RE: [PATCH V2 1/4] scsi: ufs: Add exception event tracepoint

2021-02-10 Thread Avri Altman
rker/2:2-173 [002] 731.486419: ufshcd_exception_event: > :00:12.5: status 0x0 >kworker/2:2-173 [002] 732.608918: ufshcd_exception_event: > :00:12.5: status 0x4 >kworker/2:2-173 [002] 732.609312: ufshcd_exception_event: > :00:12.5: status 0x4 > > Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman

[PATCH] scsi: ufs: Fix a duplicate dev quirk number

2021-02-11 Thread Avri Altman
fixes: 2b2bfc8aa519 (scsi: ufs: Introduce a quirk to allow only page-aligned sg entries) Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index ee61f821f75d

RE: [PATCH v20 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-18 Thread Avri Altman
> > + /* for pre_req */ > + hpb->pre_req_min_tr_len = HPB_MULTI_CHUNK_LOW; This actually needs to be bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD. Also wasn't able to find any reference to fHPBen? Thanks, Avri

[PATCH v3 5/9] scsi: ufshpb: Region inactivation in host mode

2021-02-18 Thread Avri Altman
I host mode, the host is expected to send HPB-WRITE-BUFFER with buffer-id = 0x1 when it inactivates a region. Use the map-requests pool as there is no point in assigning a designated cache for umap-requests. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 120

[PATCH v3 3/9] scsi: ufshpb: Add region's reads counter

2021-02-18 Thread Avri Altman
ate it. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 108 -- drivers/scsi/ufs/ufshpb.h | 7 +++ 2 files changed, 100 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c index e052260868ad..348185964c

[PATCH v3 4/9] scsi: ufshpb: Make eviction depends on region's reads

2021-02-18 Thread Avri Altman
In host mode, eviction is considered an extreme measure. verify that the entering region has enough reads, and the exiting region has much less reads. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git

[PATCH v3 7/9] scsi: ufshpb: Add "Cold" regions timer

2021-02-18 Thread Avri Altman
to-be-inactivated" list, unless it is clean and did not exhaust its READ_TO_EXPIRIES - another parameter. All this does not apply to pinned regions. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 70 ++- drivers/scsi/ufs/ufshpb.h | 7 +++

[PATCH v3 9/9] scsi: ufshpb: Make host mode parameters configurable

2021-02-18 Thread Avri Altman
We can make use of this commit, to elaborate some more of the host control mode logic, explaining what role play each and every variable. While at it, allow those parameters to be configurable. Signed-off-by: Avri Altman --- Documentation/ABI/testing/sysfs-driver-ufs | 68 ++ drivers/scsi

[PATCH v3 8/9] scsi: ufshpb: Add support for host control mode

2021-02-18 Thread Avri Altman
Support devices that report they are using host control mode. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c index 9a1c525204f7..2c0f63a828ca 100644 --- a/drivers/scsi/ufs

[PATCH v3 6/9] scsi: ufshpb: Add hpb dev reset response

2021-02-18 Thread Avri Altman
The spec does not define what is the host's recommended response when the device send hpb dev reset response (oper 0x2). We will update all active hpb regions: mark them and do that on the next read. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c

[PATCH v3 1/9] scsi: ufshpb: Cache HPB Control mode on init

2021-02-18 Thread Avri Altman
We will use it later, when we'll need to differentiate between device and host control modes. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.h | 2 ++ drivers/scsi/ufs/ufshpb.c | 8 +--- drivers/scsi/ufs/ufshpb.h | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --

[PATCH v3 0/9] Add Host control mode to HPB

2021-02-18 Thread Avri Altman
d Xiaomi Mi10 pro. Your meticulous review and testing is mostly welcome and appreciated. Thanks, Avri Avri Altman (9): scsi: ufshpb: Cache HPB Control mode on init scsi: ufshpb: Add host control mode support to rsp_upiu scsi: ufshpb: Add region's reads counter scsi: ufshpb: Make evi

[PATCH v3 2/9] scsi: ufshpb: Add host control mode support to rsp_upiu

2021-02-18 Thread Avri Altman
on to update an active and clean subregion, it is better to follow those recommendation because otherwise the host has no other way to know that some internal relocation took place. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 34 +- drivers/scs

RE: [PATCH v3 9/9] scsi: ufshpb: Make host mode parameters configurable

2021-02-18 Thread Avri Altman
> > +What: > /sys/class/scsi_device/*/device/hpb_param_sysfs/timeout_polling_interval_ms > > +Date:February 2021 > > +Contact: Avri Altman > > +Description: the frequency in which the delayed worker that checks the > > +

RE: [PATCH] scsi: ufs: convert sysfs sprintf/snprintf family to sysfs_emit

2021-02-02 Thread Avri Altman
NG: use scnprintf or > sprintf. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong Reviewed-by: Avri Altman

RE: [PATCH 1/8] scsi: ufshpb: Cache HPB Control mode on init

2021-01-30 Thread Avri Altman
> > > > +static enum UFSHPB_MODE ufshpb_mode; > > How are you allowed to have a single variable for a device-specific > thing? What happens when you have two controllers or disks or whatever > you are binding to here? How does this work at all? > > This should be per-device, right? Right. Done.

RE: [PATCH 2/8] scsi: ufshpb: Add host control mode support to rsp_upiu

2021-01-30 Thread Avri Altman
> > > On Wed, Jan 27, 2021 at 05:12:11PM +0200, Avri Altman wrote: > > There are some limitations to activations / inactivations in host > > control mode - Add those. > > I can not understand this changelog text, please make it more > descriptive as I have no

RE: [PATCH 1/8] scsi: ufshpb: Cache HPB Control mode on init

2021-01-30 Thread Avri Altman
> On Sun, Jan 31, 2021 at 07:08:00AM +0000, Avri Altman wrote: > > > > > > > > +static enum UFSHPB_MODE ufshpb_mode; > > > > > > How are you allowed to have a single variable for a device-specific > > > thing? What happens when you have two

RE: [PATCH 3/8] scsi: ufshpb: Add region's reads counter

2021-01-30 Thread Avri Altman
> > > > + if (ufshpb_mode == HPB_HOST_CONTROL) > > + reads = atomic64_inc_return(&rgn->reads); > > + > > if (!ufshpb_is_support_chunk(transfer_len)) > > return; > > > > + if (ufshpb_mode == HPB_HOST_CONTROL) { > > + /* > > + * in host

RE: [PATCH 7/8] scsi: ufshpb: Add "Cold" regions timer

2021-01-30 Thread Avri Altman
> > + /* region "cold" timer - for host mode */ > > + ktime_t read_timeout; > > + atomic_t read_timeout_expiries; > > Why does this have to be an atomic when you have a lock to protect this > structure already taken? Done. You are right, it is protected by the hpb state lock. Will fi

RE: [PATCH V1 1/3] scsi: ufs: export api for use in vendor file

2021-01-31 Thread Avri Altman
> > Exporting functions ufshcd_set_dev_pwr_mode, ufshcd_disable_vreg > and ufshcd_enable_vreg so that vendor drivers can make use of > them in setting vendor specific regulator setting > in vendor specific file. As for ufshcd_{enable,disable}_vreg - maybe inline ufshcd_toggle_vreg and use it inst

RE: [PATCH V1 0/3] scsi: ufs: Add a vops to configure VCC voltage level

2021-01-31 Thread Avri Altman
> > UFS specification allows different VCC configurations for UFS devices, > for example, > (1)2.70V - 3.60V (For UFS 2.x devices) > (2)2.40V - 2.70V (For UFS 3.x devices) > For platforms supporting both ufs 2.x (2.7v-3.6v) and > ufs 3.x (2.4v-2.7v), the voltage requirements (VCC)

RE: [PATCH 3/8] scsi: ufshpb: Add region's reads counter

2021-01-31 Thread Avri Altman
> > +#define WORK_PENDING 0 > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */ > Rather than fixing it with macro, how about using sysfs and make it > configurable? Yes. I will add a patch making all the logic configurable. As all those are hpb-related parameters, I think module parameters are more ade

RE: [PATCH 4/8] scsi: ufshpb: Make eviction depends on region's reads

2021-01-31 Thread Avri Altman
> > > Hi Avri, > > > + /* > > + * in host control mode, verify that the exiting region > > + * has less reads > > + */ > > + if (ufshpb_mode == HPB_HOST_CONTROL && > > + atomic64_read(&rgn->reads) > (EVICTION_THRSHLD

RE: [PATCH 6/8] scsi: ufshpb: Add hpb dev reset response

2021-01-31 Thread Avri Altman
> > Hi Avri, > > > + list_for_each_entry_safe(rgn, next_rgn, &lru_info->lh_lru_rgn, > > + list_lru_rgn) > How about replace list_for_each_entry_safe to list_for_each_entry? Done. Can also use the relaxed version in the timeout handler as well (patch 7/8). Thanks,

RE: [PATCH 3/8] scsi: ufshpb: Add region's reads counter

2021-01-31 Thread Avri Altman
> > On Mon, Feb 01, 2021 at 07:12:53AM +, Avri Altman wrote: > > > > +#define WORK_PENDING 0 > > > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */ > > > Rather than fixing it with macro, how about using sysfs and make it > > > configurable? >

RE: [PATCH 3/8] scsi: ufshpb: Add region's reads counter

2021-02-01 Thread Avri Altman
> > On Mon, Feb 01, 2021 at 07:51:19AM +, Avri Altman wrote: > > > > > > On Mon, Feb 01, 2021 at 07:12:53AM +, Avri Altman wrote: > > > > > > +#define WORK_PENDING 0 > > > > > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */ > >

RE: [PATCH 3/8] scsi: ufshpb: Add region's reads counter

2021-02-01 Thread Avri Altman
> On Mon, Feb 01, 2021 at 08:17:59AM +0000, Avri Altman wrote: > > > > > > On Mon, Feb 01, 2021 at 07:51:19AM +, Avri Altman wrote: > > > > > > > > > > On Mon, Feb 01, 2021 at 07:12:53AM +, Avri Altman wrote: > > >

RE: [PATCH v19 1/3] scsi: ufs: Introduce HPB feature

2021-02-01 Thread Avri Altman
Daejun, > static const struct attribute_group *ufshcd_driver_groups[] = { > &ufs_sysfs_unit_descriptor_group, > &ufs_sysfs_lun_attributes_group, > +#ifdef CONFIG_SCSI_UFS_HPB > + &ufs_sysfs_hpb_stat_group, > +#endif > NULL, > }; Aren’t you creating a hpb_stats entri

[PATCH v2 1/9] scsi: ufshpb: Cache HPB Control mode on init

2021-02-02 Thread Avri Altman
We will use it later, when we'll need to differentiate between device and host control modes. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.h | 2 ++ drivers/scsi/ufs/ufshpb.c | 8 +--- drivers/scsi/ufs/ufshpb.h | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --

[PATCH v2 2/9] scsi: ufshpb: Add host control mode support to rsp_upiu

2021-02-02 Thread Avri Altman
on to update an active and clean subregion, it is better to follow those recommendation because otherwise the host has no other way to know that some internal relocation took place. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 35 +++ drivers/scs

[PATCH v2 4/9] scsi: ufshpb: Make eviction depends on region's reads

2021-02-02 Thread Avri Altman
In host mode, eviction is considered an extreme measure. verify that the entering region has enough reads, and the exiting region has much less reads. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 42 --- 1 file changed, 39 insertions(+), 3

[PATCH v2 3/9] scsi: ufshpb: Add region's reads counter

2021-02-02 Thread Avri Altman
ate it. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 109 -- drivers/scsi/ufs/ufshpb.h | 6 +++ 2 files changed, 100 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c index 61de80a778a7..de4866d42d

[PATCH v2 5/9] scsi: ufshpb: Region inactivation in host mode

2021-02-02 Thread Avri Altman
I host mode, the host is expected to send HPB-WRITE-BUFFER with buffer-id = 0x1 when it inactivates a region. Use the map-requests pool as there is no point in assigning a designated cache for umap-requests. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 119

[PATCH v2 0/9] Add Host control mode to HPB

2021-02-02 Thread Avri Altman
4e6282b76ad9ae6c99e3ab5@epcms2p6 in lore.kernel.org. The patches are also available in wdc ufs repo: https://github.com/westerndigitalcorporation/WDC-UFS-REPO/tree/hpb-v19 This version was tested on Galaxy S20, and Xiaomi Mi10 pro. Your meticulous review and testing is mostly welcome and appreciated. Th

[PATCH v2 6/9] scsi: ufshpb: Add hpb dev reset response

2021-02-02 Thread Avri Altman
The spec does not define what is the host's recommended response when the device send hpb dev reset response (oper 0x2). We will update all active hpb regions: mark them and do that on the next read. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c

[PATCH v2 9/9] scsi: ufshpb: Make host mode parameters configurable

2021-02-02 Thread Avri Altman
the read_timeouts is awaken. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 1 + drivers/scsi/ufs/ufshpb.c | 284 +++--- drivers/scsi/ufs/ufshpb.h | 22 +++ 3 files changed, 290 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.

[PATCH v2 7/9] scsi: ufshpb: Add "Cold" regions timer

2021-02-02 Thread Avri Altman
to-be-inactivated" list, unless it is clean and did not exhaust its READ_TO_EXPIRIES - another parameter. All this does not apply to pinned regions. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 76 ++- drivers/scsi/ufs/ufshpb.h | 6 +++

[PATCH v2 8/9] scsi: ufshpb: Add support for host control mode

2021-02-02 Thread Avri Altman
Support devices that report they are using host control mode. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshpb.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c index c61fda95e35a..cec6f641a103 100644 --- a/drivers/scsi/ufs

RE: [PATCH v2 9/9] scsi: ufshpb: Make host mode parameters configurable

2021-02-02 Thread Avri Altman
> > On Tue, Feb 02, 2021 at 10:30:07AM +0200, Avri Altman wrote: > > +struct attribute_group ufs_sysfs_hpb_param_group = { > > + .name = "hpb_param_sysfs", > > Shouldn't this be "hpb_param"? Why the trailing "_sysfs", doesn't that > look odd in the directory path? Done.

RE: [PATCH v2 9/9] scsi: ufshpb: Make host mode parameters configurable

2021-02-02 Thread Avri Altman
> > > > - timeout_polling_interval_ms - the frequency in which the delayed > > worker that checks the read_timeouts is awaken. > > You create new sysfs files, but fail to document them in > Documentation/ABI/ which is where the above information needs to go :( Done. Will wait to see where Dae

RE: [PATCH v2 3/9] scsi: ufshpb: Add region's reads counter

2021-02-02 Thread Avri Altman
> > > > +#define WORK_PENDING 0 > > This should be next to the variable you define that uses this, right? > Otherwise we would think this is a valid value, when in reality it is > the bit number, correct? Done. > > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */ > > You can spell things out "ACTIVA

RE: [PATCH v2 2/9] scsi: ufshpb: Add host control mode support to rsp_upiu

2021-02-02 Thread Avri Altman
> > On Tue, Feb 02, 2021 at 10:30:00AM +0200, Avri Altman wrote: > > diff --git a/drivers/scsi/ufs/ufshpb.h b/drivers/scsi/ufs/ufshpb.h > > index afeb6365daf8..5ec4023db74d 100644 > > --- a/drivers/scsi/ufs/ufshpb.h > > +++ b/drivers/scsi/ufs/ufshpb.h > >

RE: [PATCH v2 3/9] scsi: ufshpb: Add region's reads counter

2021-02-02 Thread Avri Altman
> > > On Tue, Feb 02, 2021 at 10:30:01AM +0200, Avri Altman wrote: > > @@ -175,6 +179,8 @@ struct ufshpb_lu { > > > > /* for selecting victim */ > > struct victim_select_info lru_info; > > + struct work_struct ufshpb_normalization_work;

RE: [PATCH v2 2/9] scsi: ufshpb: Add host control mode support to rsp_upiu

2021-02-02 Thread Avri Altman
> On Tue, Feb 02, 2021 at 11:24:04AM +0000, Avri Altman wrote: > > > > > > > > On Tue, Feb 02, 2021 at 10:30:00AM +0200, Avri Altman wrote: > > > > diff --git a/drivers/scsi/ufs/ufshpb.h b/drivers/scsi/ufs/ufshpb.h > > > > index afeb6365daf8.

  1   2   3   4   5   6   >