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 X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5136FC433DB for ; Fri, 12 Feb 2021 19:51:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A7B164E2B for ; Fri, 12 Feb 2021 19:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbhBLTvm (ORCPT ); Fri, 12 Feb 2021 14:51:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:48582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhBLTvh (ORCPT ); Fri, 12 Feb 2021 14:51:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5306C64E2B; Fri, 12 Feb 2021 19:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613159456; bh=+jZNSXASRKJbVihU0PCI0TJ9OGQXrg2LKG1WrjZJIgs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JhtBFXoGZUHWLOqWkA5XyPMUhsah0NvARU8luvp2B85iaT8O2dHlbbQtIEi/q/QVR mzwhMSsKUd8fJ9h7B88cz7n03dKtwUI01NsHni8p8eLkF4Ei18CUXNl+C4GF8YO6TM Ls3bnSUnKb8ZxJTt/VyZxNO/40fhrWr9KlUaRSaeLgDjJw9fZBbhiXIQge2CQfTJ4Z ay84UME2iq9K1PMYwI/4EFBrcSP8HQogW3HZXZ2OYSpiQZ1P/SwPMN/mSjM4HYIIIB omGYSpHaGlPZ5pqWOuimBT8lgbQU1CYCcngQ+ENn6tVqYgvIjQZpggN77U5dq0rqDV heiRtjyotwkaA== Received: by mail-oi1-f176.google.com with SMTP id d20so858070oiw.10; Fri, 12 Feb 2021 11:50:56 -0800 (PST) X-Gm-Message-State: AOAM530YBdEvpvfE+IFP0+B9p6U4JblzpKd8i7IRktvkpwFBj85xnNM2 1Z+7UGBwFSPFwIpEK7ShEVwAKj9LGfQGUjTd898= X-Google-Smtp-Source: ABdhPJxZ6eS625gu7tCP3jyhoqzsmf/FtIBFwRQIDAEQc4KaCDOmL6Ivz2W9OCHRIBdzssaLb91SOBuyyD32FdF0usg= X-Received: by 2002:aca:d908:: with SMTP id q8mr749970oig.67.1613159455601; Fri, 12 Feb 2021 11:50:55 -0800 (PST) MIME-Version: 1.0 References: <1613012611-8489-1-git-send-email-min.li.xe@renesas.com> In-Reply-To: From: Arnd Bergmann Date: Fri, 12 Feb 2021 20:50:39 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next] misc: Add Renesas Synchronization Management Unit (SMU) support To: Min Li Cc: Derek Kiernan , Dragan Cvetic , Arnd Bergmann , gregkh , "linux-kernel@vger.kernel.org" , Networking , Richard Cochran Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 12, 2021 at 5:19 PM Min Li wrote: > > > > > Ah, so if this is for a PTP related driver, it should probably be integrated into > > the PTP subsystem rather than being a separate class. > > > > I was trying to add these functions to PHC subsystem but was not accepted because the functions > are specific to Renesas device and there is no place for those functions in PHC driver. It would be useful to explain that in the patch description and link to the original discussion there. What exactly was the objection? > > > > This tells me that you got the abstraction the wrong way: the common > > > > files should not need to know anything about the specific > > implementations. > > > > > > > > Instead, these should be in separate modules that call exported > > > > functions from the common code. > > > > > > > > > > > > > > I got what you mean. But so far it only supports small set of > > > functions, which is why I don't feet it is worth the effort to over abstract > > things. > > > > Then maybe pick one of the two hardware variants and drop the abstraction > > you have. You can then add more features before you add a proper > > abstraction layer and then the second driver. > > > > If I come up with a new file and move all the abstraction code there, > does that work? I think so, but it's more important to figure out a good user space interface first. The ioctl interfaces should be written on a higher-level abstraction, to ensure they can work with any hardware implementation and are not specific to Renesas devices. Can you describe on an abstract level how a user would use the character device, and what they achieve by that? Arnd