Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4164968rwo; Tue, 25 Jul 2023 01:24:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFaXbJsMM9P/tRcYylMZ2pgd2FXOBOrHjCw8W+hrFCFWr7MxEEZYD9ZqzlA/fNDZg8OXB6T X-Received: by 2002:a17:903:32d1:b0:1b0:3d03:4179 with SMTP id i17-20020a17090332d100b001b03d034179mr2378720plr.6.1690273446073; Tue, 25 Jul 2023 01:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690273446; cv=none; d=google.com; s=arc-20160816; b=F3xkFz0aooimGTkFSkyhanQwIZ1gz6ugPiCxEOREinvkQ6OQIOOgp8xl0QYsPa14Xr pnFlSieTjblBQDhNpQ8cT/VMjYUgYUHwbFGqCG8+OLYHyLN3jrxu32y4kCmiTKMb0zjr 6OXhdOYRd0sTRCSXYw0ptKTjg+T25TGZ2wxTeOEy1E40JbRnMzT5N9r10fbJGBL5fVq2 WMesvswDb16bNnqZfqqCTZ3chrtGhIG+lhYb1clavY1x/3lSGiHdzPuBmdJP6apzFOtp HTYPBitgthUlyhLlQZ7+93CK7u6R1oKqk+s6GEvUMFR+Ql0kJA8kMypXXt3kX2erT++2 +t2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=uQwkHdbNNqXad2F9E68Qz3kTtrm40Hwf9bDHsmDIzGU=; fh=p4v2YJIbg43s1Sp9JMmlTArptYHOb//b2MCPpCH1Rbc=; b=YWo6ODPrccyFJJwDBBtNeLwPlAWSckv24LUMkwsU31ci5yhc5q3WfQnGxwYSd9Wu8K 9nzkUCqccdXGwmX+i61OFSlOz1m/2eH0WxgRzmMo2QLOd7XKaE+qrgy3nUoGk6ccY3lS 29MgkK0teJvpAca1QCsNC/yjWxMMzu9oiG8e26nXFPv320mEsk0miW2Y46FBp43HSpIb XturJT0XoogVYIX2/tcxcYGANtOvy3U0i8btXvv6EPTymLh+I1hsDLcX6cphVR/rsvIc 0ZOtYrJN7mFR7iMJJ8zSmYbP5veOCMsmpQLm7p2d1XaBxzzU8DTTHmRzkJjW0N1SzOj1 6KXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b=gH3MiElj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e16-20020a17090301d000b001bbb6f4cd6dsi1941892plh.334.2023.07.25.01.23.53; Tue, 25 Jul 2023 01:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b=gH3MiElj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232640AbjGYHev (ORCPT + 99 others); Tue, 25 Jul 2023 03:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjGYHeF (ORCPT ); Tue, 25 Jul 2023 03:34:05 -0400 Received: from forward502a.mail.yandex.net (forward502a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d502]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34C81BC2 for ; Tue, 25 Jul 2023 00:32:27 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net [IPv6:2a02:6b8:c18:3c99:0:640:7c39:0]) by forward502a.mail.yandex.net (Yandex) with ESMTP id 08C965E670; Tue, 25 Jul 2023 10:32:25 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id NWE9BhbDa4Y0-nKfkZC0h; Tue, 25 Jul 2023 10:32:24 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1690270344; bh=uQwkHdbNNqXad2F9E68Qz3kTtrm40Hwf9bDHsmDIzGU=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=gH3MiEljctPMwRDvn0PoJEtN8IWa/VMfHZMBR94hbskFRVrA2slGcJicsShI95DCL LU/1jKiI1CMXbMVJYJ/QXLmiIThORV/096PWjqVh8xUZ5udtmvRTv9cwjthz1SOdud RZ51WlWFKITE70HkM2GpwfrgLxVGMnv2wXRF1pDk= Authentication-Results: mail-nwsmtp-smtp-production-main-52.vla.yp-c.yandex.net; dkim=pass header.i=@maquefel.me Message-ID: Subject: Re: [PATCH v3 07/42] soc: Add SoC driver for Cirrus ep93xx From: Nikita Shubin To: Arnd Bergmann , Krzysztof Kozlowski , Stephen Boyd , Andy Shevchenko , Alexander Sverdlin , Linus Walleij , Michael Peters , Kris Bahnsen Cc: linux-kernel@vger.kernel.org Date: Tue, 25 Jul 2023 10:32:23 +0300 In-Reply-To: <9b51bd0a-271a-4830-9422-89ad853a67b6@app.fastmail.com> References: <20230605-ep93xx-v3-0-3d63a5f1103e@maquefel.me> <20230605-ep93xx-v3-7-3d63a5f1103e@maquefel.me> <0ec81b89-4d4c-4e13-5ea0-697f5c0af835@linaro.org> <4073daf401a820c0f64e6fa813b5253bd0427bcd.camel@maquefel.me> <886e29ec-a290-993a-d99a-d5fd90662e99@linaro.org> <9b51bd0a-271a-4830-9422-89ad853a67b6@app.fastmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Arnd, Krzysztof ! On Mon, 2023-07-24 at 20:04 +0200, Arnd Bergmann wrote: > On Mon, Jul 24, 2023, at 18:31, Krzysztof Kozlowski wrote: > > On 24/07/2023 17:02, Nikita Shubin wrote: > > > >=20 > > > > There is no even need for this, because this code does not use > > > > it! > > >=20 > > > It's a little emotional, so i can hardly understand the exact > > > reason of > > > dissatisfaction. > > >=20 > > > Are you against usage of EXPORT_SYMBOL_NS_GPL ? - then indeed my > > > fault > > > it's not needed as both PINCTRL and CLK (the only users of this > > > code) > > > can't be built as modules. > >=20 > > I am against any exported symbols and most of functions visible > > outside > > of this driver. >=20 > I think it's a reasonable compromise here, this all ancient code > and we don't need to rewrite all of it as part of the DT conversion, > even if we would do it differently for a new platform. >=20 > I really just want to merge the series before Nikita runs out > of motivation to finish the work, after having done almost all > of it. Thank you for your kind words, i think i have steam for at least for a couple more versions. I agree with Krzysztof, through i don't see any good options to dial with "swlocked" registers (these means we have to write a magic value to some register just before writing to "swlocked" register) without exposing some functions - the only variants i can think of: - introduce a "fake" hwlock, so the drivers will provide magic themselves while holding the lock - convert SYSCON, CLK, PINCTRL into "Auxiliary" (suggested by Stephen) but this introduces more problems: - as AFAIK CLK can use SYSCON node - but i am not sure about PINCTRL - it still will have a common header for CLK and PINCTRL (no functions - just structs however) >=20 > > > > > + > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pr_info("EP93xx SoC re= vision %s\n", attrs->revision); > > > > > + > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > > > > > +} > > > > > +core_initcall(ep93xx_soc_init); > > > >=20 > > > > That's not the way to add soc driver. You need a proper driver > > > > for it > > >=20 > > > What is a proper driver for these ?=C2=A0 > >=20 > > Usually platform_driver, e.g. exynos-chipid. >=20 > Using a platform driver sounds like the right thing to do here, > it's cleaner and should not be hard to do if the driver just matches > the cirrus,ep9301-syscon node. I would have just merged > the v3 version, but this is something that makes sense changing > in v4. Indeed. >=20 > > > Even the latest additions in drivers/soc/* go with *_initcall. > >=20 > > Which one? Ones which call platform_driver_register()? That's quite > > different story, isn't it? I don't see other recent cases, except > > regulator couplers. They might be, some people send and accept poor > > code, so what do you expect from us? Crappy code got in once, so > > more of > > it can go? >=20 > That's not what is happening here, this is all part of an incremental > improvement of the existing code. If the DT bindings make sense, I'm > happy to take some shortcuts with the implementation that keep it > closer to the existing implementation and either clean them up over > time or just throw out the platform in five or ten years when the > last > machines are dead. >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Arnd