lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc2252f03db5881dbb17006c910dfca54c7d2fee.camel@pengutronix.de>
Date:   Tue, 19 Apr 2022 09:22:04 +0200
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     "Sajida Bhanu (Temp)" <quic_c_sbhanu@...cinc.com>,
        adrian.hunter@...el.com, agross@...nel.org,
        bjorn.andersson@...aro.org, ulf.hansson@...aro.org,
        chris@...ntf.net, venkatg@...eaurora.org, gdjakov@...sol.com,
        quic_asutoshd@...cinc.com
Cc:     linux-mmc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org, quic_rampraka@...cinc.com,
        quic_pragalla@...cinc.com, quic_sartgarg@...cinc.com,
        quic_nitirawa@...cinc.com, quic_sayalil@...cinc.com
Subject: Re: [PATCH V4] mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC

Hi Sajida,

On Di, 2022-04-19 at 11:46 +0530, Sajida Bhanu (Temp) wrote:
[...]
> > > +static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host)
> > > +{
> > > +	struct reset_control *reset;
> > > +	int ret = 0;
> > No need to initialize ret.
> > 
> > > +
> > > +	reset = reset_control_get_optional_exclusive(dev, NULL);
> > > +	if (IS_ERR(reset))
> > > +		return dev_err_probe(dev, PTR_ERR(reset),
> > > +				"unable to acquire core_reset\n");
> > > +
> > > +	if (!reset)
> > > +		return ret;
> Here we are returning ret directly if reset is NULL , so ret 
> initialization is required.

You are right. I would just "return 0;" here, but this is correct as
is.

> > > +
> > > +	ret = reset_control_assert(reset);
> > > +	if (ret)
> > > +		return dev_err_probe(dev, ret, "core_reset assert failed\n");
> > Missing reset_control_put(reset) in the error path.
> Sure will add
> > 
> > > +
> > > +	/*
> > > +	 * The hardware requirement for delay between assert/deassert
> > > +	 * is at least 3-4 sleep clock (32.7KHz) cycles, which comes to
> > > +	 * ~125us (4/32768). To be on the safe side add 200us delay.
> > > +	 */
> > > +	usleep_range(200, 210);
> > > +
> > > +	ret = reset_control_deassert(reset);
> > > +	if (ret)
> > > +		return dev_err_probe(dev, ret, "core_reset deassert failed\n");
> > Same as above. Maybe make both ret = dev_err_probe() and goto ...
> In both cases error message is different so I think goto not good idea here.

You could goto after the error message. Either way is fine.

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ