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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 38AA7CE8347 for ; Mon, 30 Sep 2024 13:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XZEBwxrpoLE/VvANGlwD0fZQRFkLr5Jij21iFhSOg0E=; b=VFPSL/QYRP5zjfchBieHQdtPiY DjyYQnO25yplRrimIUZk1rtV5BPUMpXhC0hbBrbm5MuKQ8Rq6EkZBZwYcRWACd95p2C/ia9AO0XEd HS0+H+CFpJ2BAIKdQ4udfGVLWXH8YgRneyur9qDlj9CBSLXmm2BWYMTdLNHUi6wHhgAwy2/Aot2QX D64Y+U2MAy6629jRk+ug80XYhjSmu4fHlV7skeG3ur71RLuS9HgkXRmZu5eSjAE3dpWku6Q+hE0eH 0K8YC0Ebn0tFufk9fai/8JlvDfSd+wJTSTYWWucn5ddlnYKp7VN69F2pHR/tmBNYeiFl2dg4yi3dJ 13Te0PCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svGoo-0000000HOAR-1KM3; Mon, 30 Sep 2024 13:52:06 +0000 Received: from mail-yw1-f175.google.com ([209.85.128.175]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svGNY-0000000HHOZ-0RyI for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 13:23:57 +0000 Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-6e2598a0070so15152477b3.1 for ; Mon, 30 Sep 2024 06:23:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727702633; x=1728307433; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XZEBwxrpoLE/VvANGlwD0fZQRFkLr5Jij21iFhSOg0E=; b=fgxyRT9xWGHkc/Wyy2o6Y8eTttrdtODt5IFFByd1yTY0CjL8tRCyDnKe2cYWiJJR5d KtDHrQovdfPWlRz8FmthBBtq+2xQokJBgEj3/sHwmNj2zVD3pf7SpajhUnxw2jxEyHKT CnhGXq1y9ndt4RFXrtiCClXbBviM7q1/PPJ/mHd/tEawy5ObixTgjHLcR8gM/04ZayaB nA6GtrX+bgl0T4p/xLRT3tsVShFkLREeolI8UaoVrMLWCz74rQpIOUFXyBe/3WJFf5b8 VDX4+pQwZ5FJLNn69BRxB/u4JekXB8MIK6vbDhqOuwIR0yaZRH5Eijb5DqBM0pNBdMpI u5Qw== X-Forwarded-Encrypted: i=1; AJvYcCXD6993WMdFvCELCmo/BV0F1VFKFTI6fWqHgELDWV0d/tfZD78hP3XtVmhx3Aiw3VRzqKPZ/S44Jo+AcyWuxlxP@lists.infradead.org X-Gm-Message-State: AOJu0YyZWogGsmbj4yWdJ12s44nJMyX9iSH9DMCQTzn6vXlAAnP9GjaX 3g4Qy5mYp6YbUqS+/oKzMd5u2JpyGdA7L6FQms+tIxHGS5ZEb6URp32bON56 X-Google-Smtp-Source: AGHT+IGp3O3w+nevzQIiZhTfKr0yrEaIHXuf+k4B/gca8Ne+BLl2IYpDorILvdOdTEfobzgF/rVWyA== X-Received: by 2002:a05:690c:4d86:b0:6dd:bd6b:c833 with SMTP id 00721157ae682-6e247543fa4mr98276097b3.12.1727702631372; Mon, 30 Sep 2024 06:23:51 -0700 (PDT) Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com. [209.85.128.169]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6e24532550asm13533097b3.67.2024.09.30.06.23.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Sep 2024 06:23:51 -0700 (PDT) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-6dbbe7e51bbso33586077b3.3 for ; Mon, 30 Sep 2024 06:23:50 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWuGqeAZj8vJWLUi0ZtuDof3KrwzYbgN8xBNPN8fsS4LApAP4FKDHAq45E6ctbuatbgGCiMPL2BXiBTGdYjUg4O@lists.infradead.org X-Received: by 2002:a05:690c:26c6:b0:6e2:1b46:27c1 with SMTP id 00721157ae682-6e24761f502mr54518597b3.45.1727702630751; Mon, 30 Sep 2024 06:23:50 -0700 (PDT) MIME-Version: 1.0 References: <20240930121601.172216-1-herve.codina@bootlin.com> <20240930121601.172216-3-herve.codina@bootlin.com> In-Reply-To: <20240930121601.172216-3-herve.codina@bootlin.com> From: Geert Uytterhoeven Date: Mon, 30 Sep 2024 15:23:37 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 2/7] reset: mchp: sparx5: Use the second reg item when cpu-syscon is not present To: Herve Codina Cc: Andy Shevchenko , Simon Horman , Lee Jones , Arnd Bergmann , Derek Kiernan , Dragan Cvetic , Greg Kroah-Hartman , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , Andrew Lunn , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Luca Ceresoli , Thomas Petazzoni Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_062356_170385_2CD2A443 X-CRM114-Status: GOOD ( 27.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Herv=C3=A9, On Mon, Sep 30, 2024 at 2:16=E2=80=AFPM Herve Codina wrote: > In the LAN966x PCI device use case, syscon cannot be used as syscon > devices do not support removal [1]. A syscon device is a core "system" > device and not a device available in some addon boards and so, it is not > supposed to be removed. > > In order to remove the syscon usage, use a local mapping of a reg > address range when cpu-syscon is not present. > > Link: https://lore.kernel.org/all/20240923100741.11277439@bootlin.com/ [1= ] > Signed-off-by: Herve Codina Thanks for your patch! > --- a/drivers/reset/reset-microchip-sparx5.c > +++ b/drivers/reset/reset-microchip-sparx5.c > @@ -114,8 +114,22 @@ static int mchp_sparx5_reset_probe(struct platform_d= evice *pdev) > return -ENOMEM; > > err =3D mchp_sparx5_map_syscon(pdev, "cpu-syscon", &ctx->cpu_ctrl= ); > - if (err) > + switch (err) { > + case 0: > + break; > + case -ENODEV: > + /* > + * The cpu-syscon device is not available. > + * Fall back with IO mapping (i.e. mapping from reg prope= rty). > + */ > + err =3D mchp_sparx5_map_io(pdev, 1, &ctx->cpu_ctrl); > + if (err) > + return err; > + break; > + default: > return err; > + } > + This can be shortened to: if (err =3D=3D -ENODEV) { /* * The cpu-syscon device is not available. * Fall back with IO mapping (i.e. mapping from reg property). */ err =3D mchp_sparx5_map_io(pdev, 1, &ctx->cpu_ctrl); } if (err) return err; > err =3D mchp_sparx5_map_io(pdev, 0, &ctx->gcb_ctrl); > if (err) > return err; Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds