Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp723696ybh; Sun, 12 Jul 2020 22:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPzP/eBZhVIZN0VMrWAgJfpvJhR3nJ95+RhhON61zyYsvBE2AUeynk8YCnN5dPjwrPUK6g X-Received: by 2002:a17:906:1111:: with SMTP id h17mr45167917eja.203.1594617461939; Sun, 12 Jul 2020 22:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594617461; cv=none; d=google.com; s=arc-20160816; b=N+YfI8AfeJYK4oL/si7H1bvFfv05s6BfuBP3dumV5JN+EG2bENeGo9SdjKa/BW7OVd bTxcSu9XFmtLCG/f983E0gfgxrceIIx8Ba6nfkXqW+ygzdITOf0toWerWbUA3PnLdw/0 8uAmyhO3A3lOfc/gaST6CheUfktiyT4vmqoK6SlmYaQHgNN5wcU+b9EnrUmG8HNy3UgE bQzXVPlYdlC8rXJhkK8ezhYPUcxLa8gv0ZFwSmGYaqG965BGTj9VnhFvPiCdxIlRKHS1 /J62mjG1Wv7qV0iTcuWcBwlLcv6ME8dhEtZCFGqma+CWxCcKH+iPNIgCeDAfWY5bc6LQ jQyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kBf3p/0/pBuB/ysj7sNKR156umEFyfcTjqA0jPLK6VY=; b=eAhDEzo0pq+JEIpIVGmjXNkzb5s1qjkMXl/phNFsknUtLwaRd1kEQ4FN8wft8qtVJq H2Iuci+G0h3Ls04ZAmroCPIDEM7Al+BHLssQDk5XnEywxoY7ixNd2WGnapWZqPnfEyNS XJ5YZGjUH23NnJsqrI/3SSwca+8v1wZkMlWwkibcsjIYYVUXw3ddT/9dVW13cjWRFQiK XcKX/M87gv1HnJBCvznz/HksuwWAugLB0ID3vVPs/MipkJ5Rvguvu1mLoZYna2PFnCNl ng8ClVSCT+zUC6fvhAFmfNyIgxyutIAZ/vlewGfUjsxrc/DQS6kpIq1Dt6BUiEzTt/fs dZcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0EsVqJ0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg2si9586044edb.326.2020.07.12.22.17.19; Sun, 12 Jul 2020 22:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0EsVqJ0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728488AbgGMFRK (ORCPT + 99 others); Mon, 13 Jul 2020 01:17:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:51734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbgGMFRK (ORCPT ); Mon, 13 Jul 2020 01:17:10 -0400 Received: from localhost (unknown [122.182.251.219]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2120720724; Mon, 13 Jul 2020 05:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594617430; bh=aDIzWAOIaa0QdRb3SomcHX9OzL94Axn7+kd+SCdMNdw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0EsVqJ0Hy2e8BkgzejMc/xP2d9JNGv5W2rAiPkNMDrRgeotK8f8mO38If88/WUmW2 8UaILDeySzlj8/SaZvijSSKWKbgkdklC95JvSirBl+976h/tVGWKjtFtAXpR+Wiy7W jt6Ty+7S+2vU6z3rEMFAPP8NSbYsyyVGpWt32MIo= Date: Mon, 13 Jul 2020 10:47:05 +0530 From: Vinod Koul To: Yoshihiro Shimoda Cc: kishon@ti.com, wsa+renesas@sang-engineering.com, geert+renesas@glider.be, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: renesas: rcar-gen3-usb2: fix SError happen if DEBUG_SHIRQ is enabled Message-ID: <20200713051705.GX34333@vkoul-mobl> References: <1594290978-8205-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594290978-8205-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yoshihiro, On 09-07-20, 19:36, Yoshihiro Shimoda wrote: > If CONFIG_DEBUG_SHIRQ was enabled, r8a77951-salvator-xs could boot > correctly. If we appended "earlycon keep_bootcon" to the kernel > command like, we could get kernel log like below. > > SError Interrupt on CPU0, code 0xbf000002 -- SError > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc3-salvator-x-00505-g6c843129e6faaf01 #785 > Hardware name: Renesas Salvator-X 2nd version board based on r8a77951 (DT) > pstate: 60400085 (nZCv daIf +PAN -UAO BTYPE=--) > pc : rcar_gen3_phy_usb2_irq+0x14/0x54 > lr : free_irq+0xf4/0x27c > > This means free_irq() calls the interrupt handler while PM runtime > is not getting if DEBUG_SHIRQ is enabled and rcar_gen3_phy_usb2_probe() > failed. To fix the issue, add a condition into the interrupt > handler to avoid register access if any phys are not initialized. > > Note that rcar_gen3_is_any_rphy_initialized() was introduced on v5.2. > So, if we backports this patch to v5.1 or less, we need to make > other way. Should we really check phy is initialized? I think the issue here is that you register irq first, so your handler can be invoked. Right fix for this would be to move the irq registration to later in the probe when we are ready to handle interrupts > > Reported-by: Wolfram Sang > Reported-by: Geert Uytterhoeven > Fixes: 9f391c574efc ("phy: rcar-gen3-usb2: add runtime ID/VBUS pin detection") > Signed-off-by: Yoshihiro Shimoda > --- > drivers/phy/renesas/phy-rcar-gen3-usb2.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c > index bfb22f8..91c732d 100644 > --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c > +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c > @@ -507,9 +507,13 @@ static irqreturn_t rcar_gen3_phy_usb2_irq(int irq, void *_ch) > { > struct rcar_gen3_chan *ch = _ch; > void __iomem *usb2_base = ch->base; > - u32 status = readl(usb2_base + USB2_OBINTSTA); > + u32 status; > irqreturn_t ret = IRQ_NONE; > > + if (!rcar_gen3_is_any_rphy_initialized(ch)) > + return ret; > + > + status = readl(usb2_base + USB2_OBINTSTA); > if (status & USB2_OBINT_BITS) { > dev_vdbg(ch->dev, "%s: %08x\n", __func__, status); > writel(USB2_OBINT_BITS, usb2_base + USB2_OBINTSTA); > -- > 2.7.4 -- ~Vinod