Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp455494ybl; Fri, 24 Jan 2020 03:34:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxkNR95SZ342ptK3oU07h6KC0OcyxWyIeoatbUttU755jxE+bP1WxOa1Z1hEpVYxNpIqJ76 X-Received: by 2002:a9d:3e43:: with SMTP id h3mr2239655otg.84.1579865654665; Fri, 24 Jan 2020 03:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579865654; cv=none; d=google.com; s=arc-20160816; b=z7CQIcqaPNiKnVEnDWf1Nt+zblpe1BJyU2IoirxKQ3hy+GqBJ70tw32OBimhfOaO2E 9o/EiljXMLR3cS1oXgGpQ118rS/k189mzIRFKGJgRyrb7atte0tf/kZ3tk4OuZkbeLL6 5lZ+v/stx25R9K5vFDWJ5f4Mm8nPSyNA4jVzTIwi+v2XguEDBBjMf7fhosVzJb28GC5p 0dFQzpLtMrLXm2/+Ua50NS+yHFI1h/iU+/aDQnh8/XXgmfAcyPOvD1wjJqRfFmYtG3JI EahkSkVI1Y+sIaFaf/q2XkDZzHveDKmBo34fdZWngLBIlWf5hYKADt0eJDqBftTqZPb6 uI5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=j5qvcnEJyioVJeGJfTF0ZhzGcQGPB6aTo388IkzNdzM=; b=qJRxYKi71SG8+2D/EUmpRtACC3hJ8/V4jGhz2jLLwXq/trglMArncsiBFiI/4+RfjB qPeS/9MOog2Z4jcBpQUHG+oOrt93m7RM8CCvGRXuWYxcR9FbjX+NjOdstERWDXl6htMS seegSIxMR9/rN7mhdD9KaHDWIqVDS51NkrCpfUeGLHB696xiloN9XyE5YMX54+i9HM08 +4PD7OqvuNqZJRuYLmrBy3UDYncxGhOh+Y/l/fcAcJxvgObO6KMPI+ZonJtSVYdpeVCB BbL7NCu4bhXomq7IDJOaZrs44x7Haz6HT0JiQaq3JW2iM4qIdcw/082CzsTzQtSYvL8/ o1aA== 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 w20si333828oic.103.2020.01.24.03.34.03; Fri, 24 Jan 2020 03:34:14 -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 S2404495AbgAXLcs (ORCPT + 99 others); Fri, 24 Jan 2020 06:32:48 -0500 Received: from foss.arm.com ([217.140.110.172]:50280 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404479AbgAXLcn (ORCPT ); Fri, 24 Jan 2020 06:32:43 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4DCCF31B; Fri, 24 Jan 2020 03:32:43 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC53B3F68E; Fri, 24 Jan 2020 03:32:41 -0800 (PST) Date: Fri, 24 Jan 2020 11:32:39 +0000 From: Sudeep Holla To: Greg KH , Jolly Shah Cc: "ard.biesheuvel@linaro.org" , "mingo@kernel.org" , "matt@codeblueprint.co.uk" , "hkallweit1@gmail.com" , "keescook@chromium.org" , "dmitry.torokhov@gmail.com" , Michal Simek , Rajan Vaja , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/4] firmware: xilinx: Add sysfs interface Message-ID: <20200124113239.GB40307@bogus> References: <1578527663-10243-1-git-send-email-jolly.shah@xilinx.com> <1578527663-10243-2-git-send-email-jolly.shah@xilinx.com> <20200114145257.GA1910108@kroah.com> <20200124060339.GB2906795@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200124060339.GB2906795@kroah.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Thanks for raising various issues that I have repeatedly asked and constantly ignored. On Fri, Jan 24, 2020 at 07:03:39AM +0100, Greg KH wrote: > On Thu, Jan 23, 2020 at 11:47:57PM +0000, Jolly Shah wrote: > > Hi Greg, > > [...] > > Firmware driver was changed later to be platform driver but these > > interfaces were defined earlier and are in use. > > Defined and in use where? Not in the upstream kernel tree, right? Or > am I missing them somewhere else? > Exactly and they keep saying there partners are using these for 3-4 years and they want to retain that. I have told them to change several times. > > > > + ret = kstrtol(tok, 16, &value); > > > > + if (ret) { > > > > + ret = -EFAULT; > > > > + goto err; > > > > + } > > > > + > > > > + ret = eemi_ops->ioctl(0, read_ioctl, reg, 0, ret_payload); > > > > > > This feels "tricky", if you tie this to the device you have your driver > > > bound to, will this make it easier instead of having to go through the > > > ioctl callback? > > > > > > > GGS(general global storage) registers are in PMU space and linux doesn't have access to it > > Hence ioctl is used. > > Why not just a "real" call to the driver to make this type of reading? > You don't have ioctls within the kernel for other drivers to call, > that's not needed at all. > Oh yes, this is so broken in design. This firmware is designed to abstract the power and configuration management on their platform, but they decided to add direct register access to some registers anyway. Weird use case, don't even ask. But I strongly objected such interface in sysfs even if they moved under platform device. If they need this at any cost, I have suggested debugfs. [...] > > > > Agree it will be simpler but to as firmware driver was changed to be > > platform driver, to keep paths same, we used sysfs. > > Keep them same from what? Use the platform device as that is what it is > there for, do not go create new apis when they are not needed at all. > +1, and please don't add any sysfs that can read/write those GGS registers directly from userspace. Move them to debugfs if you are desperate to have something. -- Regards, Sudeep