Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp249602imu; Wed, 2 Jan 2019 19:02:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN6KpHwUem8M0KxVjKrU3wd83Zzis14tN0wiZOHZHN1aF42P9tWfljNYrSUpo6QNF+bN+9Ti X-Received: by 2002:a65:6094:: with SMTP id t20mr15561409pgu.285.1546484520954; Wed, 02 Jan 2019 19:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546484520; cv=none; d=google.com; s=arc-20160816; b=JSrTtovUUgHmgSD4gk0Y184YJIWo6hWgma9Z0BByncOLP4otoETAhsDYT5cGW6hLt0 Jj/l8PK7KNJiBr/Bdh66DBXPj+pOjTR/pk4IV2XgfJJoDPfws1dVWy1WmJhWYQt8CJrD hx/AgWomfo2jX/6l9avyhn45w/EhkRDL0D86A5yc0GhG+hUOpmh0nmpA36ItLqcqhG79 w1q/62/MTCSOTcJmfA7DHD0m4KU0LcyqQ5OWFmIek+KydmGieKmvmlVadMgZWs0qED+f k+rg245E1d488m7dYktBcuo6ElyOJ+JuFN9fpsCUhsPEjch2Px0Nily+evFeYtJpSsQ5 Eygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=aYQrRJ707ttkNkP6M2HmvuDPsriYQN+gjIAuKNIOr38=; b=s8vmz3LoH+6pmzNbjtwDnIfD8UCppO31K/hq/nHl710kzVZgYqMgfiJjXBJw1OuDn6 eUc5ulSIi+WL8mdrfQObqNbuG/xtKBLzao3JgmDEnbMa6JoV05VMFvk7j8m5xHVAOMzk DrxvHyXYYXFOCcwDZOLxHQLljf4iv6Dc5BzIRH5J7aYkcYZ8krcdmk7hovwfhCRUxLdj Zaxe+AGsU1FZyRKJqYlOrjg4/+8c+8WdFFkM9LeMwl779pPQVM1w2Fi4xPktbP82MpFT +LWBDR6M2WGj5XLZEqTQaWCJswWknAVDI7L3ktdBdz0NX7C+aNGpySHnvX4wd8vFfEjE BXxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z136si27112193pgz.28.2019.01.02.19.01.45; Wed, 02 Jan 2019 19:02:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729746AbfABWZN (ORCPT + 99 others); Wed, 2 Jan 2019 17:25:13 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:33224 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729719AbfABWZM (ORCPT ); Wed, 2 Jan 2019 17:25:12 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id D1D4F29FC6; Wed, 2 Jan 2019 17:25:08 -0500 (EST) Date: Thu, 3 Jan 2019 09:25:08 +1100 (AEDT) From: Finn Thain To: Arnd Bergmann cc: Greg Kroah-Hartman , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Linux Kernel Mailing List , linux-m68k , linuxppc-dev Subject: Re: [PATCH v8 18/25] powerpc: Implement nvram sync ioctl In-Reply-To: Message-ID: References: <3ba1dd965c1097e00463eafe7c7d5fd93bbed836.1545784679.git.fthain@telegraphics.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Jan 2019, I wrote: > > There are no [nvram] ioctls common to all architectures. So your example > becomes, > > static long nvram_misc_ioctl(struct file *file, unsigned int cmd, > unsigned long arg) > { > if (ops->ioctl) > return ops->ioctl(file, cmd, arg); > return -ENOTTY; > } > > And then my objection is the same: m68k and x86 now have to duplicate > their common ops->ioctl() implementation. > Perhaps code duplication is inevitable. Either you punt the ioctl implementation from the char misc driver (and duplicate that ioctl implementation under arch/) or else you duplicate the char misc driver. Maybe this dilemma explains the situation we have now* which is duplicated drivers (drivers/char/nvram.c and drivers/char/generic_nvram.c). But this explanation doesn't seem to offer any solution. Re-using either of the existing drivers seems to be impossible. Different interpretations of the NVRAM Kconfig symbol accross the tree are not helping. And having separate Kconfig symbols (NVRAM and GENERIC_NVRAM) for the two drivers doesn't help either. But maybe the NVRAM symbol can be dropped from arch/powerpc and all of the powerpc drivers... * Actually, we presently have duplicated misc device drivers AND duplicated ioctl implementations too, for good measure. See arch/powerpc/kernel/nvram_64.c and drivers/char/generic_nvram.c. --