[PATCH v1 0/8] phy: qcom-ufs: Enable regulators to be off in suspend

2019-01-11 Thread Evan Green
int out any (hopefully obvious) bugs in the 8996 portion, I'd be grateful. This patch is based atop phy-next, plus the UFS DT nodes, which are now patch 3, 4, 5 of [1]. [1] https://lore.kernel.org/lkml/20181210192826.241350-1-evgr...@chromium.org/ Evan Green (8): dt-bindings: phy-qcom-q

[PATCH v1 5/8] scsi: ufs: qcom: Expose the reset controller for PHY

2019-01-11 Thread Evan Green
Expose a reset controller that the phy can use to perform its initialization in a single callback. Also, change the use of the phy functions from ufs-qcom such that phy_poweron actually fires up the phy, and phy_poweroff actually powers it down. Signed-off-by: Evan Green --- Note: This change

[PATCH] scsi: ufs: Remove select of phy-qcom-ufs from ufs-qcom

2019-01-11 Thread Evan Green
o the build. Signed-off-by: Evan Green --- drivers/scsi/ufs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index 2ddbb26d9c265..6db37cf306b05 100644 --- a/drivers/scsi/ufs/Kconfig +++ b/drivers/scsi/ufs/Kconfig @@ -99,7 +99,6 @@ c

Re: [PATCH] scsi: ufs: Remove select of phy-qcom-ufs from ufs-qcom

2019-01-14 Thread Evan Green
On Mon, Jan 14, 2019 at 9:08 AM Doug Anderson wrote: > > Hi, > > On Fri, Jan 11, 2019 at 7:37 PM Martin K. Petersen > wrote: > > > > > > Evan, > > > > > CONFIG_SCSI_UFS_QCOM selects CONFIG_PHY_QCOM_UFS, assuming that > > > this was the only possible PHY driver Qualcomm's UFS controller > > > woul

[PATCH] arm64: defconfig: Add Qualcomm UFS PHY

2019-01-14 Thread Evan Green
lected, and Qualcomm platforms except for SDM845 need it. Fixes: 326a859b2814 ("scsi: ufs: Remove select of phy-qcom-ufs from ufs-qcom") Signed-off-by: Evan Green --- I unfortunately don't have a non-SDM845 device to test this on. I'm hoping it Just Works, or someone might be will

Re: [PATCH] scsi: ufs: Remove select of phy-qcom-ufs from ufs-qcom

2019-01-14 Thread Evan Green
On Mon, Jan 14, 2019 at 10:41 AM Evan Green wrote: > > On Mon, Jan 14, 2019 at 9:08 AM Doug Anderson wrote: > > > > Hi, > > > > On Fri, Jan 11, 2019 at 7:37 PM Martin K. Petersen > > wrote: > > > > > > > > > Evan, > > >

Re: dd hangs when reading large partitions

2019-01-22 Thread Evan Green
FWIW, I am unable to repro this in our 4.19 kernel [1]. I put mem=4G on the command line, and can dd till the cows come home. Seems like you're leaking buffers somewhere? localhost ~ # dd if=/dev/sda of=/dev/null bs=4M status=progress 12683575296 bytes (13 GB, 12 GiB) copied, 125.004 s, 101 MB/s^C

Re: [PATCH v1 5/8] scsi: ufs: qcom: Expose the reset controller for PHY

2019-01-22 Thread Evan Green
On Fri, Jan 18, 2019 at 2:31 PM Stephen Boyd wrote: > > Quoting Evan Green (2019-01-11 15:01:26) > > diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c > > index 3aeadb14aae1e..db46f9a64b54c 100644 > > --- a/drivers/scsi/ufs/ufs-qcom.c > > +++

Re: [RESEND PATCH v1] scsi: ufs: Use explicit access size in ufshcd_dump_regs

2019-01-22 Thread Evan Green
t+0x3c8/0x550 > [3.883264] ufs_qcom_probe+0x24/0x60 > [3.887188] platform_drv_probe+0x50/0xa0 > > Assuming aligned 32-bit registers, let's use readl, after making sure > that 'offset' and 'len' are indeed multiples of 4. > > Fixes: ba80917d9932d ("scsi: ufs: ufshcd_dump_regs to use memcpy_fromio") > Acked-by: Tomas Winkler > Reviewed-by: Jeffrey Hugo > Signed-off-by: Marc Gonzalez Tested-by: Evan Green

[PATCH v2 0/9] phy: qcom-ufs: Enable regulators to be off in suspend

2019-01-23 Thread Evan Green
Stephen). - Remove include of reset.h (Stephen) - Fix error print of phy_power_on (Stephen) - Comment for reset controller warnings on id != 0 (Stephen) - Add static to ufs_qcom_reset_ops (Stephen). - Use devm_* to get the reset (Stephen) - Clear ufs_reset on error getting it - Remove needless error pri

[PATCH v2 6/9] scsi: ufs: qcom: Expose the reset controller for PHY

2019-01-23 Thread Evan Green
Expose a reset controller that the phy can use to perform its initialization in a single callback. Also, change the use of the phy functions from ufs-qcom such that phy_poweron actually fires up the phy, and phy_poweroff actually powers it down. Signed-off-by: Evan Green --- Note: This change

Re: [ 1/1] scsi: qcom-ufs: Add support for bus voting using ICB framework

2019-01-24 Thread Evan Green
On Wed, Jan 23, 2019 at 11:02 PM Asutosh Das wrote: > > Adapt to the new ICB framework for bus bandwidth voting. > > This requires the source/destination port ids. > Also this requires a tuple of values. > > The tuple is for two different paths - from UFS master > to BIMC slave. The other is from

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

2019-01-25 Thread Evan Green
On Fri, Jan 25, 2019 at 2:13 PM Avri Altman wrote: > > Add this functionality, placing the descriptor being read in the actual > data buffer in the bio. > > That is, for both read and write descriptors query upiu, we are using > the job's request_payload. This in turn, is mapped back in user land

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

2019-01-25 Thread Evan Green
On Fri, Jan 25, 2019 at 2:12 PM Avri Altman wrote: > > 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: Christoph Hellwi

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

2019-01-25 Thread Evan Green
: Christoph Hellwig I'm not an expert of the BSG stuff, but FWIW: Reviewed-by: Evan Green

Re: [ 1/1] scsi: qcom-ufs: Add support for bus voting using ICB framework

2019-01-25 Thread Evan Green
On Fri, Jan 25, 2019 at 2:29 AM Asutosh Das (asd) wrote: > > On 1/24/2019 10:22 PM, Evan Green wrote: > > On Wed, Jan 23, 2019 at 11:02 PM Asutosh Das > > wrote: > >> > >> Adapt to the new ICB framework for bus bandwidth voting. > >> > >> Th

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

2019-01-28 Thread Evan Green
is mapped back in user land to > the applicable sg_io_v4 xferp: dout_xferp for write descriptor, > and din_xferp for read descriptor. > > Signed-off-by: Avri Altman Reviewed-by: Evan Green

Re: [PATCH v2 6/9] scsi: ufs: qcom: Expose the reset controller for PHY

2019-02-05 Thread Evan Green
On Fri, Feb 1, 2019 at 9:56 AM Stephen Boyd wrote: > > Quoting Evan Green (2019-01-23 14:11:34) > > Expose a reset controller that the phy can use to perform its > > initialization in a single callback. > > > > Also, change the use of the phy functions from ufs-

Re: [PATCH v3 5/5] Revert "scsi: ufs: disable vccq if it's not needed by UFS device"

2019-02-05 Thread Evan Green
On Tue, Feb 5, 2019 at 9:52 AM Marc Gonzalez wrote: > > On 05/02/2019 18:24, Marc Gonzalez wrote: > > > /*** system hangs here for several seconds, then reboots ***/ > > Silly me. The system crashes in ufshcd_dump_regs() which is a bug > I fixed myself. Once I cherry-pick the appropriate fix, the

[PATCH v3 7/8] phy: qcom: Utilize UFS reset controller

2019-02-05 Thread Evan Green
Move the PHY reset from ufs-qcom into the respective PHYs. This will allow us to merge the two phases of UFS PHY initialization. Signed-off-by: Evan Green --- Changes in v3: - Refactored to move reset control in a single commit (Stephen) - Use no_pcs_sw_reset as an indicator of UFS reset in

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

2019-02-05 Thread Evan Green
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 --- Note: The remaining changes in this series need this change, since the PHYs

[PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend

2019-02-05 Thread Evan Green
ps (Stephen). - Use devm_* to get the reset (Stephen) - Clear ufs_reset on error getting it - Remove needless error print (Stephen) - Use devm_ to get the reset (Stephen) - Removed whitespace changes (Stephen) Evan Green (8): dt-bindings: ufs: Add #reset-cells for Qualcomm controllers dt-bin

[PATCH v3 8/8] phy: ufs-qcom: Refactor all init steps into phy_poweron

2019-02-05 Thread Evan Green
allback specific to 14/20nm. Signed-off-by: Evan Green --- Changes in v3: - Refactor init => poweron for all PHYs and UFS in one step (Stephen) Changes in v2: - Use devm_ to get the reset (Stephen) - Removed whitespace changes (Stephen) drivers/phy/qualcomm/phy-qcom-qmp.c | 80 +++

Re: [PATCH v3 7/8] phy: qcom: Utilize UFS reset controller

2019-02-08 Thread Evan Green
On Wed, Feb 6, 2019 at 1:33 PM Stephen Boyd wrote: > > Quoting Evan Green (2019-02-05 10:59:01) > > diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c > > b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c > > index aef40f7a41d4..b05f89d734f0 100644 > > --- a/dri

[PATCH v4 0/8] phy: qcom-ufs: Enable regulators to be off in suspend

2019-02-13 Thread Evan Green
ude of reset.h (Stephen) - Fix error print of phy_power_on (Stephen) - Comment for reset controller warnings on id != 0 (Stephen) - Add static to ufs_qcom_reset_ops (Stephen). - Use devm_* to get the reset (Stephen) - Clear ufs_reset on error getting it - Remove needless error print (Stephen) - Us

[PATCH v4 7/8] phy: qcom: Utilize UFS reset controller

2019-02-13 Thread Evan Green
Move the PHY reset from ufs-qcom into the respective PHYs. This will allow us to merge the two phases of UFS PHY initialization. Signed-off-by: Evan Green --- Changes in v4: - Do reset_control_* unconditionally since null is handled (Stephen). Changes in v3: - Refactored to move reset control

[PATCH v4 8/8] phy: ufs-qcom: Refactor all init steps into phy_poweron

2019-02-13 Thread Evan Green
allback specific to 14/20nm. Signed-off-by: Evan Green --- Changes in v4: - Keep doing reset_control* unconditionally through refactor (Stephen). Changes in v3: - Refactor init => poweron for all PHYs and UFS in one step (Stephen) Changes in v2: - Use devm_ to get the reset (Stephen) - Removed

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

2019-02-13 Thread Evan Green
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 Reviewed-by: Stephen Boyd --- Note: The remaining changes in this series need

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

2019-02-26 Thread Evan Green
Signed-off-by: Marc Gonzalez Whoops, I lost track of this. Thanks for cleaning this up, Marc. Reviewed-by: Evan Green

Re: [PATCH V13 2/2] scsi: ufs: Add configfs support for UFS provisioning

2018-09-18 Thread Evan Green
On Fri, Sep 14, 2018 at 2:43 AM Sayali Lokhande wrote: > > This patch adds configfs support to provision UFS device at > runtime. This feature can be primarily useful in factory or > assembly line as some devices may be required to be configured > multiple times during initial system development p

Re: [PATCH V13 1/2] scsi: ufs: set the device reference clock setting

2018-09-18 Thread Evan Green
E_WRITE_ATTR, > + QUERY_ATTR_IDN_REF_CLK_FREQ, 0, 0, &freq); > + > + if (err) { > + dev_err(hba->dev, "%s: bRefClkFreq setting to %u Hz failed\n", > + __func__, ufs_ref_clk_freqs[freq].freq_hz); > + goto out; > + } > + /* > +* It is good to print this out here to debug any later failures > +* related to gear switch. > +*/ > + dev_dbg(hba->dev, "%s: bRefClkFreq setting to %u Hz succeeded\n", > + __func__, ufs_ref_clk_freqs[freq].freq_hz); > + The comment above doesn't add any value in my opinion. Other than that: Reviewed-by: Evan Green

Re: [PATCH V14 2/2] scsi: ufs: Add configfs support for UFS provisioning

2018-09-24 Thread Evan Green
gt; 6 files changed, 280 insertions(+), 1 deletion(-) > create mode 100644 Documentation/ABI/testing/configfs-driver-ufs > create mode 100644 drivers/scsi/ufs/ufs-configfs.c > Reviewed-by: Evan Green

Re: [PATCH v4] scsi: ufs: Make sysfs attributes writable

2018-09-26 Thread Evan Green
On Tue, Sep 25, 2018 at 6:46 PM Doug Anderson wrote: > > Martin, > > On Tue, Sep 25, 2018 at 6:08 PM Martin K. Petersen > wrote: > > > > Doug, > > > > > I came across this patch and Evan's other one and noticed that they > > > haven't been applied though a batch of other SCSI patches for 4.20 > >

[PATCH v2 0/2] scsi: ufs: Enable bInitPowerMode of sleep

2018-09-28 Thread Evan Green
printk. Evan Green (2): scsi: ufs: Allow SCSI commands early during init scsi: ufs: Execute START_STOP_UNIT during init drivers/scsi/ufs/ufshcd.c | 208 +++--- drivers/scsi/ufs/ufshcd.h | 11 +++ 2 files changed, 206 insertions(+), 13 deletions

[PATCH v2 1/2] scsi: ufs: Allow SCSI commands early during init

2018-09-28 Thread Evan Green
target. The functions follow the same form as the send_dev_cmd functions. It then wires that capability into a few UFS functions that will be called during low-level initialization. Signed-off-by: Evan Green --- Changes since v1: * Refactored into two patches. drivers/scsi/ufs/ufshcd.c | 164

[PATCH v2 2/2] scsi: ufs: Execute START_STOP_UNIT during init

2018-09-28 Thread Evan Green
her common initialization features like the device descriptor will be available to be read. This script executes a TEST UNIT READY and a START STOP UNIT SCSI command to bring the device out of sleep mode before performing additional low-level initialization. Signed-off-by: Evan Green --- Change

Re: [PATCH v2 2/2] scsi: ufs: Execute START_STOP_UNIT during init

2018-09-28 Thread Evan Green
On Fri, Sep 28, 2018 at 4:04 PM Christoph Hellwig wrote: > > On Fri, Sep 28, 2018 at 04:02:03PM -0700, Evan Green wrote: > > For UFS devices that are provisioned to have an initial power mode > > (bInitPowerMode) of "sleep", Linux will currently fail to enumerate >

[PATCH RESEND] scsi: sg: Prevent potential double frees in sg driver

2018-10-01 Thread Evan Green
Signed-off-by: Nick Desaulniers Signed-off-by: Evan Green Cc: sta...@vger.kernel.org --- Reposting this patch from last summer, as it looks like it fell in between the cracks. drivers/scsi/sg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index

Re: [PATCH RESEND] scsi: sg: Prevent potential double frees in sg driver

2018-10-02 Thread Evan Green
On Mon, Oct 1, 2018 at 4:34 PM Douglas Gilbert wrote: > > On 2018-10-02 02:15 AM, Evan Green wrote: > > From: Robb Glasser > > > > sg_ioctl could be spammed by requests, leading to a double free in > > __free_pages. This protects the entry points of sg_ioctl

Re: [PATCH V14 2/2] scsi: ufs: Add configfs support for UFS provisioning

2018-10-03 Thread Evan Green
On Sun, Sep 23, 2018 at 11:29 PM Sayali Lokhande wrote: > > This patch adds configfs support to provision UFS device at > runtime. This feature can be primarily useful in factory or > assembly line as some devices may be required to be configured > multiple times during initial system development

Re: [PATCH v1] scsi: ufs: add 2 lane support

2018-10-03 Thread Evan Green
Hi, On Wed, Oct 3, 2018 at 11:19 AM Can Guo wrote: > > From: Venkat Gopalakrishnan > > Qcom ufs controller v3.1.0 supports 2 lanes, add support > to configure 2 lanes during phy initialization. I'm reviving this old chestnut, sorry I missed it initially. This description is a little terse, and

[PATCH] scsi: ufs: Schedule clk gating work on correct queue

2018-10-05 Thread Evan Green
quot;) Signed-off-by: Evan Green --- drivers/scsi/ufs/ufshcd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c55f38ec391c..54074dd483a7 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.

[PATCH v3] scsi: ufs: Make sysfs attributes writable

2018-07-25 Thread Evan Green
This change makes the UFS controller's sysfs attributes writable, which will enable users to modify attributes. This can be useful during factory provisioning for setting up critical attributes like the reference clock frequency. Signed-off-by: Evan Green --- Configfs was determined to b

Re: [PATCH v4] scsi: ufs: Make sysfs attributes writable

2018-09-27 Thread Evan Green
On Thu, Sep 27, 2018 at 7:01 AM Christoph Hellwig wrote: > > On Thu, Sep 27, 2018 at 06:32:47AM +, Avri Altman wrote: > > Also, in this context there is the series in > > https://www.spinics.net/lists/linux-scsi/msg123479.html > > which allows to send UPIUs via a bsg device. > > > > It's not a