Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp112464lqb; Thu, 23 May 2024 12:18:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWH1y+qPs91R5ME+v9G7ZgntfWXFwqyHQLJXVGckovaeUdlFc7nUBr56JE5YCEQ+/voHBD9ZapO6vjhydRBoyFMz8wNtTLpymcszsR5Q== X-Google-Smtp-Source: AGHT+IGmzwNI9UzrxavFrHd6IKhdXxJrgGTA9/23MTJnuaDCvVEAI/LN+3B6LxmVb6OgpuruGxf0 X-Received: by 2002:a50:8acd:0:b0:572:a712:64e0 with SMTP id 4fb4d7f45d1cf-57850c673e6mr266537a12.11.1716491937431; Thu, 23 May 2024 12:18:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716491937; cv=pass; d=google.com; s=arc-20160816; b=sz2NgwT0fjY+fizE5CS+mOTO/ZDKdvCbUglVxrngHGajvuV2amrl5cpWdPKszwYsLw uk7knhRAgXDwrOyL85hCal9523+XEPkeEW5ZX7X10EF5VPxsCF798LIkkv6MDhjGFANw o9IZdvU4cL63aPYCjSZJjsIIQTuZ/kP2HDZL+yryIdnhGnmn6xyQkiak9BSgvCZhqzxq 3w5TKB25NXMZU8wtaduw2youwl6ZdSDCzJPz8YSGvmldumFOVCWayWlgjkYr7dUwuVIM 9J79oadPkQ0hkjxNJVODndGvG4o/DO+gB4UKBtgTzTpzpor/c9AU43k2X7PetJdrxgue VckQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=RpyON3/SfYcEJHYsAQeK/+128bvG84+TmTn7Ylhqq3g=; fh=WslzzCuDXger9df86mWQnfsYiYnNgckp3cD0TwTurM0=; b=XqoHijCYtw8OzbyIROmNctn3lPUvI+PkbtsBTikp4Vk6UBzp9FiR5qWPCAcm8JfnhD K/xfic6UYex+6F1GevR9L07SWJ1S6VzOhNOqlXwkNkHl4j5Z6zVa4VFC0airjupFvEBY QEhJ1cxEWvHNpwZ2yeZ68nKq3yGggKXfs67sRMay0/BnCeVtoEmhlT5JQl5lX5jUhXwx 2r2y1cN4ngfVbV4fnjysIisFV/UPY5ZzYmnBiQhQd416rzAg8zjwDL5P7DOYRacjPHus 2zw1tIwvt+txgsFPIOnA72W9VnBlZUU99CbRNgXmHCqKaoBav/Z/usccU3KqNIqPtqdY Sr1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=Ur5wel49; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-187923-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187923-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57852491ee5si18516a12.370.2024.05.23.12.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 12:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187923-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=Ur5wel49; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-187923-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187923-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2EFD31F2451B for ; Thu, 23 May 2024 19:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AE4783A12; Thu, 23 May 2024 19:18:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="Ur5wel49" Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D962E82D9E; Thu, 23 May 2024 19:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716491928; cv=none; b=qkHkUoLPl0Vzjn0NNxEd0Ctp9TvVIKIuSgOORGxqaHHgRJBeBZV5cCDHp2Xb+QPa7+9TPVZUtfYBQ6BjdThM07YuN3mz7XMr6uQQEcreJNk9GvqP2VVR+naKOZMivD/a3Ve2igS5SaJIclTTAfaL6BM3FqyyBUf5vpp05d7P6uE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716491928; c=relaxed/simple; bh=fWjejW9xdfNmZJGNqDJuH/uLBlAoUAHTMlP8yBrQ9BI=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=L5LZX1fFoNw1GL5DzmFbyC2Ke2C6MJFaS5UM8JOd0y5238Z21IW91pvFqroRSszOsR2rzN11199Eag2HIz1CRkU484yZYt1nE9FLRL7S4BxRpLQ6FXMFGt5j+DNtI2bovSH0Dpm1+6X+61MYC6LwBVwS5XB1A6/4CKDjLAnu3tE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=Ur5wel49; arc=none smtp.client-ip=212.227.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1716491891; x=1717096691; i=markus.elfring@web.de; bh=RpyON3/SfYcEJHYsAQeK/+128bvG84+TmTn7Ylhqq3g=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:References: Subject:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=Ur5wel49Lecfw87HRpHs4NyKVR2Kypstx1Y8bCIa8PEfYtZjz+u1799K0AJDpyLV h+aLTXpORjWMchHbE8CJDzYtmPBCERjdadNyhHYQNCxylGfFFRadD5sqlpKGUxAYS Y3gtgLGHUjyLG+Z9jszvG4fQ5OjjgOkPGBpJCMVMLHEEGulqZ72nhAixgdxVkUCX6 Aojt8KTk36NbFrlqOrM+BbBOLY+5EpwzzPq3MLyyPqMjD74rlXphO/NIGrk6IHtDV aU6XxQhT4k4E/1X9Lcj+bm+eB89jjEKcCoqTX7S0V5OUwFyxMw6OfyW4kbMsjUhBM y1iXbLSlcZOG1QSdpg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.82.95]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MElV3-1sKQHY2Ds3-00GH3C; Thu, 23 May 2024 21:18:11 +0200 Message-ID: <4a43cda4-dfa4-4156-b616-75e740f6fd64@web.de> Date: Thu, 23 May 2024 21:18:02 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sean Anderson , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Lorenzo Pieralisi , Rob Herring Cc: LKML , Bharat Kumar Gogada , Bjorn Helgaas , Lorenzo Pieralisi , Michal Simek , Michal Simek , Thippeswamy Havalige References: <20240520145402.2526481-6-sean.anderson@linux.dev> Subject: Re: [PATCH v3 5/7] PCI: xilinx-nwl: Clean up clock on probe failure/removal Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240520145402.2526481-6-sean.anderson@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:nuwOBf+zdPyIUVq+GEAxoVouepil547lApNGdbhuDbe8v1rRdR4 ED+u2uuHe8I03Z84sAuohUsNEhUsSLRFwixYaDpksaoXddI0z+nxHoH6Bz5qOIFduJME0Fe f+g/4fghfXCHTszN6flTIWbdy09Oqx6JjcEP57gmJ3JGXD64iqDLfTgWARxf2NnKARo/mMh p1hvETCSrzhPqGNTfaPGA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:8904RJMpJ9s=;JCdx0Wo9Q99BWW96f6JOVg6LGWm LfsVgGkVDiGOWkaLD+6IlQ19BwbXymHEY5wAkAxJPs4HLHTe6gc533PPj/pd9A413cpYTvVzO 0pSZNJtInjL9SXUbWNjXZT52JplYKE3e3xvxFMcNtMwrcr+ypTdmy3PRX9iJLNlSBgiMbE980 icgFe9m1X0Q8ibra/KXnD3oqJFN38RFCyJ67kWibhqvRCJqRjbPlOscxylyei5hG+ddJJYngh bVPH6kNtf8w0/CU7pqavi78vcsr8sGI7ayVjP+rSsciYK0qR9s+CHbfT/0L1WGssx4FnQPUAN Mu/cizYp+8FY5qWwcK06y4sGeutiPxwAUG9DR0cQS/bHUYNTAAAMX5N6kQI93ckuR6r4g9QE1 Uyp2fkOnaSAhTpQymtfqv6M3LEQaASspMEG6rC81XBz1V7pypm2nlgE0DvccPVfURCyOwumLq LEveRUL/+Z2XtD4Cjf9yB+UB8/fxLkKCHWy633eaDRgWgbloTpOskTnw2Mgh/FVLvFcCuy2ti 2jhq9jTWTCML2lTRFWPevvdmOxMwr95OUHwUGkP/VMztNdVrwZe4AVMV+JXnHtt0yMZ6LBIMG WO0wlk7Xv8KhLylz+G8pphyCXJGKgot769BQBEV0139ijhV7OEGsccyT4s4y22f6Kd8z6zWx6 K+zBua0IsI1XHP0rV8MWNhdfUUjtutwb0h0klVtRXWAq+p4gURyJupfOfMxN83bnBTzNWAEyp SDlOjSl2x+Bo8SUOw0GIzOf1ww6HpVyafDKKf0PKExOrtyCnSGTHmcJZDjKVY1ndy23YzuwhJ UvzcxnF+gBzYIyEkr/R9531wUVjiOBlfqlUjxWWN0pEHE= > Make sure we turn off the clock on probe failure and device removal. =E2=80=A6 > +++ b/drivers/pci/controller/pcie-xilinx-nwl.c =E2=80=A6 > @@ -817,11 +818,23 @@ static int nwl_pcie_probe(struct platform_device *= pdev) > err =3D nwl_pcie_enable_msi(pcie); > if (err < 0) { > dev_err(dev, "failed to enable MSI support: %d\n", err); > - return err; > + goto err_clk; > } > } > > - return pci_host_probe(bridge); > + err =3D pci_host_probe(bridge); > + > +err_clk: > + if (err) > + clk_disable_unprepare(pcie->clk); I suggest to use the label =E2=80=9Cdisable_unprepare_clock=E2=80=9D direc= tly before this function call (in the if branch) so that a duplicate check would be avoided after some e= rror cases. Regards, Markus