From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D091C3A5A9 for ; Mon, 4 May 2020 08:59:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AE0220757 for ; Mon, 4 May 2020 08:59:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NGTxyPr9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AE0220757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Date:To:From:Subject:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=z87aay3U/5onCeJM/Rc5JjiortgnF7Lq5WfLcw0J06M=; b=NGTxyPr9zm0lHOpZoXVborFNL +vy6H2yG74ClaHZ+PgxxXhJwpxLdKm9Hi8uGALZ9NxlAbc/KxRlI96YkevlsBphvSvPrbELUWSzNv OLrdRbvd8Ozuve/mmb3Ei8h0l1w2xYu7BeFBFiUVpRdMMqo7VDG8Rxpi0lc779qNHAEBzgf9dpYb7 MK3j2vLKzEgf6RfHRk9GmINC6BMYev9gc1oV9ef1GQi+6Q/zh5S+3x1k0lfeXUAlkVI1fWxxLGlpJ mRjQKXcSoPBDKTbu/0wy76ok1LQrF8kK1ySLGcup3lxbsam6ilgia5xJqit6Vxhqy15muYBxkB79+ PFMjUr9fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVWwu-0006Dk-Qd; Mon, 04 May 2020 08:59:40 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVWwr-0006Bd-5P; Mon, 04 May 2020 08:59:38 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E65D5ACF1; Mon, 4 May 2020 08:59:33 +0000 (UTC) Message-ID: Subject: Re: [PATCH v7 2/4] firmware: raspberrypi: Introduce vl805 init routine From: Nicolas Saenz Julienne To: Stefan Wahren , helgaas@kernel.org Date: Mon, 04 May 2020 10:59:29 +0200 In-Reply-To: <5fce05ca-5d7e-f4cc-be34-0764fbe4edff@gmx.net> References: <20200429164734.21506-1-nsaenzjulienne@suse.de> <20200429164734.21506-3-nsaenzjulienne@suse.de> <5fce05ca-5d7e-f4cc-be34-0764fbe4edff@gmx.net> User-Agent: Evolution 3.36.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200504_015937_341595_C3F7F679 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: f.fainelli@gmail.com, ScottBranden , linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, RayJui , tim.gover@raspberrypi.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Greg KH , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============7707380593720006210==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7707380593720006210== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-xrGwwQwF9+uJnqYpmvFb" --=-xrGwwQwF9+uJnqYpmvFb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Stefan, thanks for the review! On Sat, 2020-05-02 at 11:05 +0200, Stefan Wahren wrote: > > + /* Make sure we don't trigger a firmware load unnecesarely * > s/unnecesarely/unnecessarily/ Noted > > + pci_read_config_dword(pdev, VL805_PCI_CONFIG_VERSION_OFFSET, &version= ); > pci_read_config_dword() can fail, we might want to store the return value= ? I planned on doing that, but realised that the vast majority of pci_read_config_*() users pass on checking for errors. Bjorn, any rule of thumb on when to check for errors here? > > + if (version) > > + goto exit; > > + > > + dev_addr =3D pdev->bus->number << 20 | PCI_SLOT(pdev->devfn) << 15 | > > + PCI_FUNC(pdev->devfn) << 12; > > + > > + ret =3D rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_XHCI_RESET, > > + &dev_addr, sizeof(dev_addr)); > > + /* Wait for vl805 to startup */ > > + udelay(200); >=20 > I know, it makes it harder to read but do we really want to wait > unnecessarily if rpi_firmware_property failed? Yes, I figured that it wouldn't hurt much at that faulty state, and you'll = be waiting some extra 5s further down the line in quirk_usb_handoff_xhci(). But if you feel it's more correct I'll be happy to change it. > Btw i assume we are in non-atomic context, so maybe it's worth to use > usleep_range() here? Of course, I'll fix that. Regards, Nicolas --=-xrGwwQwF9+uJnqYpmvFb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl6v2XEACgkQlfZmHno8 x/6tJQgAqKxAf6yuXPyZ70bzD6f9Lw8O516dwBki+Md23tM1+Fw/cmdCe77tbMgq d0xAlhNfnHxXiXWLX3+C5jEGn7rJyVAjLHZx8JC+uPrGZyuZMPHfxRwBwLglkkIt U4B07Kan2MZRiQ1ZQ3jlpzEXvNfGl7KpComy8U/fPad8wpGXqZjIy1e+rlQO9FEg 1weKYQIGSSdJSK2hIlnMPVLw9o342QE6KL7DCxV025ttlasor0mavVvfdX+HYRns fDtXerc+8wWRTNwusO4f5Zd/7GS1mAPYOYSUHrSMzT5rkSS5rDTfT33hQLUKFIaB bsGjvNxDJbG1cPJFfYYStNo4Id0Oqg== =Vbo6 -----END PGP SIGNATURE----- --=-xrGwwQwF9+uJnqYpmvFb-- --===============7707380593720006210== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7707380593720006210==--