On Fri, Dec 7, 2018 at 4:10 AM Marc Gonzalez <marc.w.gonzalez@xxxxxxx> wrote: > > On 06/12/2018 17:45, Evan Green wrote: > > > I'll throw my random thought into the hopper here. With one particular > > brand of UFS part on SDM845 we needed to make sure we banged on the > > ufs_reset pin before the device would re-initialize fully. My hunch > > says this is not your issue, but it can't hurt to make sure this is > > happening. > > You might be on to something. > > Downstream handles the pinctrl nodes, while upstream doesn't. > > $ git grep pinc vendor -- drivers/scsi/ufs/ > vendor:drivers/scsi/ufs/ufshcd-pltfrm.c:static int ufshcd_parse_pinctrl_info(struct ufs_hba *hba) > vendor:drivers/scsi/ufs/ufshcd-pltfrm.c: /* Try to obtain pinctrl handle */ > vendor:drivers/scsi/ufs/ufshcd-pltfrm.c: hba->pctrl = devm_pinctrl_get(hba->dev); > vendor:drivers/scsi/ufs/ufshcd-pltfrm.c: err = ufshcd_parse_pinctrl_info(hba); > vendor:drivers/scsi/ufs/ufshcd-pltfrm.c: dev_dbg(&pdev->dev, "%s: unable to parse pinctrl data %d\n", > vendor:drivers/scsi/ufs/ufshcd.c: ret = pinctrl_select_state(hba->pctrl, > vendor:drivers/scsi/ufs/ufshcd.c: pinctrl_lookup_state(hba->pctrl, "dev-reset-assert")); > vendor:drivers/scsi/ufs/ufshcd.c: ret = pinctrl_select_state(hba->pctrl, > vendor:drivers/scsi/ufs/ufshcd.c: pinctrl_lookup_state(hba->pctrl, "dev-reset-deassert")); > vendor:drivers/scsi/ufs/ufshcd.h: struct pinctrl *pctrl; > > $ git grep pinc master -- drivers/scsi/ufs/ > /* NOTHING */ We did this by abusing the "init" pinctrl state, which I think gets handled automagically. In our board file we have something like this (forgive the paste butchering): &ufshc1 { status = "okay"; pinctrl-names = "init", "default"; pinctrl-0 = <&ufs_dev_reset_assert>; pinctrl-1 = <&ufs_dev_reset_deassert>; vcc-supply = <&src_pp2950_l20a>; vcc-max-microamp = <600000>; }; &tlmm { ufs_dev_reset_assert: ufs_dev_reset_assert { config { pins = "ufs_reset"; bias-pull-down; /* default: pull down */ drive-strength = <8>; /* default: 3.1 mA */ output-low; /* active low reset */ }; }; ufs_dev_reset_deassert: ufs_dev_reset_deassert { config { pins = "ufs_reset"; bias-pull-down; /* default: pull down */ drive-strength = <8>; output-high; /* active low reset */ }; }; };