Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1609509

Re: [PATCH v6 06/11] drivers: perf: hisi: Add support for Hisilicon Djtag driver

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Anurup M <anurupvasu@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 06/11] drivers: perf: hisi: Add support for Hisilicon Djtag driver
Date Mon, 27 Mar 2017 08:40:02 +0200
Message-ID <tpwtQ-3Lz-15@gated-at.bofh.it> (permalink)
References <tjmdQ-87B-17@gated-at.bofh.it> <tnumu-5mU-17@gated-at.bofh.it> <touX8-gm-15@gated-at.bofh.it> <tovJv-Sg-17@gated-at.bofh.it>
X-Original-To Mark Rutland <mark.rutland@arm.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=SoW1Dw8/gf1Zuds31E+AA34ZUap9rhf7ZUTfsHTmPv0=; b=cDxOFFSg43OUGHoPH4b+S5lXa9WzcWnNLsstOFqxLvu2SOMYIy9Dje/ZODybDNT8Ux 6hQ1xjSdDZbLXzmAgUbDTNdQTu10c2sHzmML9Td8r1ALb7CubZLz8liCt8kxXCoy9QiR deWmJVW8BFdPdCseQUj/sSI5UCxh/uLbv997LUdqz6t0LRg0f25surISlSh4ekOmFW65 +lJF9kB0lLKgBkwASg/5Uz/aSU5AZLhd98+XTpYP7cTJFsxJYVS7qtdsHep7B8FD9mAB gDVlIzHNbMd09670qb7nEs/+jdkY211yVoQePxDoMvL+ctlrHEY/I4OuhDLEoEy5k+Sh CSSw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=SoW1Dw8/gf1Zuds31E+AA34ZUap9rhf7ZUTfsHTmPv0=; b=PPKaP1gl0hNipYYByLyTUPTEP46vb4C0CmCXSSQmEmqO2wM2E90U+LkY38pI4AZNwC 8kIE7agxL4PaQnNfb7EQy9LZCr4CEdsw/W70F5U/JG9wlmYSOjmYpo7dOTTJ+o9QHY5C SwM/oRURSJd4LmMaTTumpXUEWAAYCj79EZ0vaxrCFn1lmFq73k32UIA6Vg4aX7dkEvXq t0XSN7Jj+iwJFUalkItgnSnRJwOWaiMiitTvHT/PVe2aN89rzEM85Ijl2UjqweO104FW uRid6C62i1LQuOtVOrjlbrnEdOID4IVYtrRqKnBtCqlMNb50vLLgviPTnqOH7SDmGc7C Ft+w==
X-Gm-Message-State AFeK/H3MZl3jxtZH+potzX0z24eMQLVI4+I3kXsuAvZhNE1eCheX0UVKUHGZMteOSk/i3w==
X-Received by 10.98.200.136 with SMTP id i8mr23743975pfk.120.1490596596281; Sun, 26 Mar 2017 23:36:36 -0700 (PDT)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 74
Organization linux.* mail to news gateway
X-Original-Cc will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, anurup.m@huawei.com, zhangshaokun@hisilicon.com, tanxiaojun@huawei.com, xuwei5@hisilicon.com, sanil.kumar@hisilicon.com, john.garry@huawei.com, gabriele.paoloni@huawei.com, shiju.jose@huawei.com, huangdaode@hisilicon.com, linuxarm@huawei.com, dikshit.n@huawei.com, shyju.pv@huawei.com
X-Original-Date Mon, 27 Mar 2017 12:06:30 +0530
X-Original-Message-ID <58D8B2EE.1030206@gmail.com>
X-Original-References <1489127302-112735-1-git-send-email-anurup.m@huawei.com> <20170321155119.GF22188@leverpostej> <58D4F901.5070503@gmail.com> <20170324113610.GB22771@leverpostej>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1609509

Show key headers only | View raw



On Friday 24 March 2017 05:06 PM, Mark Rutland wrote:
>>>> +#define SC_DJTAG_TIMEOUT_US    (100 * USEC_PER_MSEC) /* 100ms */
>>> > >How was this value chosen?
>>> > >
>>> > >How likely is a timeout?
>> >
>> >As explained in PATCH 7,
>> >
>> >The djtag -EBUSY in hardware is a very rare scenario, and by design
>> >of hardware, does not occur unless there is a Chip hung situation.
>> >The maximum timeout possible in djtag is 30us, and hardware logic
>> >shall reset it, if djtag is unavailable for more than 30us.
>> >The timeout used in driver is 100ms to ensure that it does not fail
>> >in any case.
> I couldn't find such an explanation in patch 7.

Sorry, I intent to mean that it was explained in the reply to PATCH 7 
comments.

> So that this doesn't get lost, please place a comment to this effect
> above the definition of SC_DJTAG_TIMEOUT_US.
>
> We can drop the existing "100ms" comment at the same time.
>
> What exactly does a "chip hung situation" imply? Does that just mean
> that only the djtag HW is hung, or that other parts of the chip are hung
> too, such taht other things are likely to go wrong?

Yes it is not that only djtag HW is hung, but it means there is some 
serious irrecoverable
condition in chip, where other things are also likely to go wrong.
Shall add comments above definition of SC_DJTAG_TIMEOUT_US.

> [...]
>
>>> 	/* wait for the operation to complete */
>>> > >	ret = readl_poll_timout(regs_base + SC_DJTAG_MSTR_START_EN,
>>> > >				val, !(val & DJTAG_MSTR_EN),
>>> > >				1, SC_DJTAG_TIMEOUT_US);
>>> > >	
>>> > >	if (ret)
>>> > >		pr_warn("djtag operation timed out.\n");
>>> > >
>>> > >	return ret;
>>> > >}
>>> > >
>>> > >Depending on how serious a timeout is, this might want to be some kind
>>> > >of WARN variant.
>  From the above, I take that a hang indicates a very serious problem, so
> this whould be a WARN, with a comment:
>
> 	/*
> 	 * A timeout should never occur on a working system. See the
> 	 * definition of SC_DJTAG_TIMEOUT_US.
> 	 */
> 	WARN(ret, "djtag operation timed out.\n");
>
> ... or, if this really should never happen, and other things are likely
> to go wrong were we to see this, we can BUG_ON(ret) instead, remove the
> error code, and simplify all the callers.
>
> Likewise for djtag_do_operation_v2().

Ok. As this should never happen by design of hardware, it is a serious 
problem. So shall
add BUG_ON and simplify all callers.

Thanks,
Anurup

> Thanks,
> Mark.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH v6 06/11] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Mark Rutland <mark.rutland@arm.com> - 2017-03-21 17:00 +0100
  Re: [PATCH v6 06/11] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Anurup M <anurupvasu@gmail.com> - 2017-03-24 11:50 +0100
    Re: [PATCH v6 06/11] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Mark Rutland <mark.rutland@arm.com> - 2017-03-24 12:40 +0100
      Re: [PATCH v6 06/11] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Anurup M <anurupvasu@gmail.com> - 2017-03-27 08:40 +0200

csiph-web