Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp137458lqb; Thu, 23 May 2024 13:12:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXniMoDi0nOqbQpIDeNN/ifGQqusLIsCvYQVo/0dv5Q3cAtGBriJGqm4z0Gzu13iAqJVsGTVC1xkfzvFq9r5gng9EknJNsz2c4+1rEWpQ== X-Google-Smtp-Source: AGHT+IHMDUizjbjTAKc6SdbmKGN7/ueOTOdxxeGmy4NjqDdOChqnoUU0eKU1eeuWhIJQYVTXTPDp X-Received: by 2002:a17:906:9907:b0:a62:32be:33be with SMTP id a640c23a62f3a-a62641a65f5mr21971966b.10.1716495121398; Thu, 23 May 2024 13:12:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716495121; cv=pass; d=google.com; s=arc-20160816; b=kt2PHQohco4i7hHs3NeLIYO4++6hEA9cBvA/Mx0hvAeEKJ4KjgKZ6q0sUUDnKuLFOy rn6ywzZFpEIJO0PPSbCqowojuFDgOyli4ZrT5Ih4qRytU8uaI41wrMuKC7WotAxfl+t3 OineLdP1GQbe1px3v/bX5221dVKvs6MK1MfFfOf7AFayq/c1m2atY6LHV6g1lIKxYPiM bs1kdzVe3I0Zy5jlcryTf7ozNDLNCs5Un8+d0ZJ3KjYqI5YI5pcMxvJJYGxoBphCfZJe oPzCMHZC8TzCwXKkx8ro/55VILyMXn326sJo07l3Tx5eWuctCWcXDKo77D9Lf6iZlLW2 +cbw== 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:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=pRrt2wpGj4VAOvQxf86gbLUKPEBUjoc/oQDX1mcPMrM=; fh=WslzzCuDXger9df86mWQnfsYiYnNgckp3cD0TwTurM0=; b=Mm5gFSU8Dc6hzw/kBZQ4CDXODN2XM5oppifI+YxF6V/OM/9l+BPzJUOysUmkcgMiwu 3vvVv6D7mzKqvy80+xmp8BMZxG9PQh6m1RTi3yuigRrNDpzma2dzH1JqCHuqqZw5fJuA kVLoZvCYkehg3XCOSQhos2a9KS0e3XCIxVq25/onM5oW4mubGmTUgry6DBJQvx/roSxp ueNBALPx6eV0Ul89/WLP+age4mAdKiDxHiCye5jHFGKeALrCKJ8kptcynuUZYT+VOwnk e1Caofp9xoquyqXnrI4kAWeVAw4Q4P7e2VrYk2kmdL0ab5CBrfqsrz8vYxio+IMUOGih JsDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=nnLPKUm3; 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-187959-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187959-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c801058si3222366b.36.2024.05.23.13.12.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 13:12:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187959-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=nnLPKUm3; 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-187959-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187959-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 F3CD11F23069 for ; Thu, 23 May 2024 20:12:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0D3E84D15; Thu, 23 May 2024 20:11:53 +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="nnLPKUm3" Received: from mout.web.de (mout.web.de [217.72.192.78]) (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 B8D37535D4; Thu, 23 May 2024 20:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.72.192.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716495113; cv=none; b=ZWDk8WSpVfCmImBffSxqy6R3qGSrMnbPr1DBMTJt6nd96lLjHgJ1CVpuvDPW+NvUekso4JYyjkxTNzYc9s3qWy5/8aAKiAn8w99W0RN1EPinXloDIBX5w35KLTk2Z4k9ywWNN4npLaHFpMz4IR4eeHHelx6A1doDnyRE8ZAzcrE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716495113; c=relaxed/simple; bh=L5ewnBm0au4zZRec8wsDmkwZlTUy33ekVhMp0k9H0PI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y2ZqMJe+JdPZYFQorkQ0W9nFVTGTtGn/NtJMxs+VQgHXjtQqjBaHRyv+ciA84a9Hm/Cq0pVWfYr3KlNwMdYH/JU6XpOxzHGjILgm1HDuGf5i/D/Wc5ugh+uAChQhYELFZG3LPYtvTHy72iMhknDQGXayONyQgYjBKWWzWKNGc7s= 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=nnLPKUm3; arc=none smtp.client-ip=217.72.192.78 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=1716495082; x=1717099882; i=markus.elfring@web.de; bh=pRrt2wpGj4VAOvQxf86gbLUKPEBUjoc/oQDX1mcPMrM=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References: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=nnLPKUm3Vpg1qLjBxzKs6SigfIsLW45WZfv7tTykVIbZJZxpRxmD57UIc+8apu2Q GWV92ch6xSylxKrwvbWOQ+IR4UgH6+4PBxlYnNccYINYlklchd+8d0ZYrp7Q/9/mu LVhXqP3N4Qxeo+xZY0LX6VNOa15KDq3PvY6Xj9ayi3oqcM0wVfmSNxaTtzkfEdpNY ROdJk1wAhDAWKg7nup7ueR8ogHP71e7eaxmQXBiQi/Nw/eT6GT8K9cFigtLwjLB3R BvsUiugkaxu3Zm1N2Z+N43k7skalpHsoFsGvwkcVeQtRHOItMjGiwmSTW+ii2gq7h /K3PI6Lu251O5e1/Jg== 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 1MqIB7-1sveY51FAJ-00nOnm; Thu, 23 May 2024 22:11:22 +0200 Message-ID: Date: Thu, 23 May 2024 22:11:20 +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 Subject: Re: [PATCH v3 5/7] PCI: xilinx-nwl: Clean up clock on probe failure/removal 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> <4a43cda4-dfa4-4156-b616-75e740f6fd64@web.de> Content-Language: en-GB From: Markus Elfring In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ZfN0L4J/We1nysj/Tw4/FcDusZldTB3WhkeTmZfE668DhHbNZkY HOoeea/+aF1NKZetF41Uc9H+RW7VLFjgc7x7o6UUkCopGRHsnpbeznyyfJUbr3TXUM8MJ/z A8NenrGIAYjkotL14h15DYSBzFEtS3lpiEbPCZl2CHXS10ckSR7/C2wVxAeE4eMxytSx6tk ZywcrqoJnql1tcrThId1Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ylFft9ZDubI=;jo1fRE94B8Xtowztpq0sPRbsVf8 1cr8nbdQN6GH688tqhMolPOOrpbgXQ59MikyI8c8RC5vdyJKqXsJ7EoLxLg+9DtQOxcmA8MvV wXtxqQ3m7Bzf8U1VXtn76lzcqOVUyUXMiHYHh3pn3KjksRDD8FgR9/apQgyZNifYO7FfHJ0My exLJzCmoFnWgCRpajwcFOOo0BXbXEGKEVZtLEo0d5rORAFirrXB1yHdohIFD+d9oSMCWYD5pO 9YlBRRG6Y4HvgN9lkNA8yH4UUirUks/OEXaf2SPos8GCHRClQdiotaTUsK5j1FC4woB0Nkrnx PeIAVkuaJFqBdg69iRoAnk0aaDOkju03tjUQEw7s0LDPEMnwD1SjXgsK4D5qOdEOIUtFUBRoS sqVkKSHmeP6gWoN52EaYWPlsTFD0tTZkxaNBh7k5ltiIYKrXJiZENcPFzAGhaDs5qlxjINA90 WMNhhJCJxSoCtTasXjN7Ia00uVC1FJXwSzQdfKqYnU/Lh5Xe8L2PyS2oEcN24+By7bkz5z87B EU/TRHkzH9joFtEk3YENeO6UobvGZOpEWsoJgTXCvfsAs4bP0KgAkFnNrckdPDq3KB18HLsCQ Pf5RhlqzaAjjkRp2OHtaNvg9qsDAMA90BTmnyo1t6y2xxEOYP+5qLhtR8w8FdI/FyajmLiNtb Q2oqlY1FeuycdXtU0J9OCtheAVL7aKijHsytMFt2fJZJAQK6wNnUVhKAFSCXmGdHqaV6NYGPr xaXARvKzsAQSTtwxmwllV8yHT4H2lmRHjs7+RTQRIdEG9Ojn9WvYsBY5J29ojiKJ6HpT3hj01 UvWotxE2nBivOnnbCVgM4D8I5v60M2mP7XPhLqiMHZoe8= >> =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 di= rectly before this function call >> (in the if branch) so that a duplicate check would be avoided after som= e error cases. > > Well if you want to avoid a check, we can just do > > err =3D pci_host_probe(bridge); > if (!err) > return 0; > > err_clk: > ... This design variant can also be reasonable. Do any preferences matter here for label name selections? Regards, Markus