Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1193273imi; Fri, 22 Jul 2022 20:44:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vrX49AQ3UGVOIV3BJP+lOnmqdTJody+wmPq9ljuYBxIRMo/hLQYI8ABbH+xMTWBihpjVgQ X-Received: by 2002:a17:902:ecc8:b0:16d:44ff:dc1b with SMTP id a8-20020a170902ecc800b0016d44ffdc1bmr2849000plh.75.1658547895576; Fri, 22 Jul 2022 20:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658547895; cv=none; d=google.com; s=arc-20160816; b=Ru10ppeN7nvmIrisv1EvKXcuRa57PueqbZA9ftYY7qGjDNe9zmMgLmoIMWosvA7gIr 1xLTyd6qN6OnEmIT0AJCjjmk3uUhTBYjXDysBPIqh0eAxg/+5gRVg4HtvM8mG22Z7Vqk bHrlZOZQfeoab+6AKE1aoZsIqh8B19KXS8khJRVBqJAj3TxvZ/4aZjN9jgrG1xQ32Dpv +2OpXXGo0zI1/mo57FGdIQzJY1NoivbTNNZAv9dZG9FKpxQ4tT4e6f+M3h9yvtFu3UJj VTQJ+SKvGz8YGfClrW49fBAwvG99sBtNM/aek5LUMRlNHjkNLWbIFzR+aKLrBsrmTNlC GYMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=RmHNidHcM6XnyksPN/PZ9Th3H+UhaPw4mbqV8BGr+lk=; b=nTGPPr8KHZhN/yms+50E+T20gwnkj67fNYUGZnO0ffNdMU1hP7o6cxnhDou83sw9e8 popmqHERS2bS9q8VZm6YZ6fREVrQxmAFStZ9huXxOXrjjKLAqPWJkv+aMj3GLtOTfAlG Q9FknPWKjWwV2BUhjpHivATNfN6n22OIswyarbFPsfqUaf8C7Qb7JF1DiZnAEO24GGav Vy695AZWedHTtkmPzfqDagt2XjdHKBHfSg0ddY6pvGEijvjNJPecTzd1FchgVDpsflQr ka7FAtPV8hk2UsuyoUz4ZvCxe4DvRo7NMKiLwLq02mGL+Miy1xGdHNLwASWgQI0E4XrK BQCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eu/SahGn"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a056a00150b00b0051c3fd6df1esi10168280pfu.154.2022.07.22.20.44.39; Fri, 22 Jul 2022 20:44:55 -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=@kernel.org header.s=k20201202 header.b="eu/SahGn"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbiGWDCe (ORCPT + 99 others); Fri, 22 Jul 2022 23:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiGWDCc (ORCPT ); Fri, 22 Jul 2022 23:02:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBFADDECC; Fri, 22 Jul 2022 20:02:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0CE0EB82B1E; Sat, 23 Jul 2022 03:02:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E43CC341C6; Sat, 23 Jul 2022 03:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658545346; bh=RmHNidHcM6XnyksPN/PZ9Th3H+UhaPw4mbqV8BGr+lk=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=eu/SahGnm2hDYt+NNv6xEtT/DRemsy7UcVl/gxuxomUCXoPIbz5QwEzpuI3xmeDCz 6CvunG/RROezKcPISJH/AZKEfl5SA9kYZ2cAm8q9MYDhCFWJhnpEhB1LjdF5nWszvo yxQ0h13kwPxBbjHoh9Qb4cPngEMrGcd8vfJT9cQ2BxmLzVqEXOjGCcaU3evhGVcTln ozPywvOhwtK+zhKYTPA2I/JIH1oVMEIwqP8BXwi82kEdk2hgJcTXMdVmSXvzcxerr7 /5IotM9Y4VfFM3U5UH2+NHcLu0JYjN+Wqs3J2ch54DBiyzrtJ3KZpebnwAwHq6R/KY l9JO+hwonW7yw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20220711123519.217219-1-tmaimon77@gmail.com> <20220711123519.217219-5-tmaimon77@gmail.com> <20220711195544.70A30C34115@smtp.kernel.org> <20220718191454.5B5D3C341C0@smtp.kernel.org> Subject: Re: [PATCH v8 04/16] clk: npcm8xx: add clock controller From: Stephen Boyd Cc: Arnd Bergmann , Avi Fishman , Benjamin Fair , Biju Das , Bjorn Andersson , Catalin Marinas , Daniel Lezcano , Geert Uytterhoeven , Greg KH , Jonathan =?utf-8?q?Neusch=C3=A4fer?= , Jiri Slaby , Joel Stanley , Krzysztof Kozlowski , Guenter Roeck , Lubomir Rintel , Marcel Ziswiler , Michael Turquette , Nobuhiro Iwamatsu , Olof Johansson , Philipp Zabel , Robert Hancock , Rob Herring , Shawn Guo , Tali Perry , Thomas G leixner , Patrick Venture , Vinod Koul , Will Deacon , Wim Van Sebroeck , Nancy Yuen , devicetree , Linux Kernel Mailing List , linux-clk , SERIAL DRIVERS , LINUXWATCHDOG , Linux ARM To: Tomer Maimon Date: Fri, 22 Jul 2022 20:02:24 -0700 User-Agent: alot/0.10 Message-Id: <20220723030226.8E43CC341C6@smtp.kernel.org> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Quoting Tomer Maimon (2022-07-19 03:04:43) > On Mon, 18 Jul 2022 at 22:14, Stephen Boyd wrote: > > > > > > So the clk and reset driver should be the same driver, or one driver > > should register the other and use the auxiliary bus to express the > > relationship. That way we know that the drivers are tightly coupled and > > aren't going to stomp over each other. > I think it is very problematic to use the same driver for the reset > and the clocks also because The NPCM reset driver is an old driver > that was used also to the older NPCM BMC SoC so it will be problematic > to use the clock and reset driver in the same space. > indeed the reset and clocks are using the same memory region but they > are not using the same registers, is it not enough? > Please be aware that the NPCM reset driver is checking that it is > using the reset registers before calling I/O functions. To put it simply, platform device drivers should use platform device APIs. The platform device APIs hide the fact that the firmware is ACPI or DT or nothing at all. The usage of of_address_to_resource() is problematic. After converting that to platform APIs you'll get janitor style cleanups trying to convert to devm_platform_ioremap_resource(). We'll have to discuss this again when that happens, even if there's a comment in the code indicating we can't reserve the IO space because there's another driver. These problems have happened in the past, fun times! Furthermore, in DT, reg properties aren't supposed to overlap. When that happens it usually indicates the DT is being written to describe driver structure instead of the IP blocks that are delivered by the hardware engineer. In this case it sounds like a combined clk and reset IP block because they piled all the SoC glue stuff into a register range. Are there more features in this IO range?