Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp440342ybl; Fri, 31 Jan 2020 01:38:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzxKuqnUKnmd1yIsma2fIRJiKOmfbrbMid7Kzo26wpcCwv63156nrbdZXO5n+cZyZ1bCtB3 X-Received: by 2002:aca:c491:: with SMTP id u139mr121023oif.17.1580463539808; Fri, 31 Jan 2020 01:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580463539; cv=none; d=google.com; s=arc-20160816; b=F6i+uFAxYB9uOFFBIKrgg0i6Ia5RPt3yvJwLaSMYgvjrW6PUWWOkOHJGUHUqjSgZ8M lvTJ0v+MMh34xVY/cc97fXyLoB3ZRIT8FtAdQ4IV0vQwbaOAmzDdfZWHKlfFJJyQ5eX4 fvu2EbuUaRZIms15DPWlAXUUMeJpGmEckxaCsFEmYWh0Hkmt+7JWmTm+UwfIT2llO+HE LMO8icATv/Fv2fops2MLKjxxPDs3u6eAMHpWbB2Rks0WXH4cezkb+zTMYqPUsY4iEqkk NmmGpnzBPVaPbDLXmnEOIvivpoTnyKcOqxMwCphfiKxmTlJW9DUDYd5pb7m2W4zGTUAO RdBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H5N37TDpXMKUy3GIaWLplUCXxlnDnkNqxVqnfN6BsQQ=; b=of2Mr9Tse2jL14tyZMGonwkWSOZdXiRw0H00J5oB6RvhrYK8JNvNqJ4Ym6rMyQqOYE 78mQkMshWlzTN5Ckb0I4oM/qNUa4CRDtSuFPt/u4kVZhKELQkt45IbuMPvZnbPE0MgSJ fYL/lQNVOh5MJ0AHwcqLcD3JssxYmMMumkTsWtivzYDBGnjaN50JpxePp779ybif2rcN 35HwXO939j8EXrJpQrH3ASPT3WqKvCEYarAYI/Eg15ALlT1GNNDGAX5GBXEefRNjxHhL IcjwWVecOF55/7FEemb9nkJm0bdaj+OVV9O6kUcH9CbS+ctGE0gTMZ5uOeZYIUTw2O14 50ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jI5GJpZL; 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 u84si4343538oib.34.2020.01.31.01.38.46; Fri, 31 Jan 2020 01:38:59 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jI5GJpZL; 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 S1728243AbgAaJgv (ORCPT + 99 others); Fri, 31 Jan 2020 04:36:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:50260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbgAaJgv (ORCPT ); Fri, 31 Jan 2020 04:36:51 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E37E20707; Fri, 31 Jan 2020 09:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580463408; bh=kKkl7IIdkI45Xq+BxUMl2TT+5Wgp8VCsHvXb8zf/eV4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jI5GJpZLenzLyhKfww2wcwTl8g9WY5wtHDwCm1LOK7DK1rQ11N3u4zgVi7ZJHDm4z jgm+p2j6DXzOdQjVmfhv/y5objkwk7vC8ugEwQnINUavbvAtukxYnYL2ENTlUU3xZr rfGUApsMb+eRMv3LWV3zKfUMoFyqpuoyJGzvSGEM= Date: Fri, 31 Jan 2020 10:36:46 +0100 From: 'Greg KH' To: Rajan Vaja Cc: Jolly Shah , "ard.biesheuvel@linaro.org" , "mingo@kernel.org" , "matt@codeblueprint.co.uk" , "sudeep.holla@arm.com" , "hkallweit1@gmail.com" , "keescook@chromium.org" , "dmitry.torokhov@gmail.com" , Michal Simek , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/4] firmware: xilinx: Add sysfs interface Message-ID: <20200131093646.GA2271937@kroah.com> 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> <2D4B924A-D10C-4A90-A8E6-507BF6C30654@xilinx.com> <20200128062814.GA2097606@kroah.com> <4EF659A1-2844-46B9-9ED6-5A6A20401D9D@xilinx.com> <20200131061038.GA2180358@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 31, 2020 at 09:05:15AM +0000, Rajan Vaja wrote: > Hi Greg, > > > -----Original Message----- > > From: Greg KH > > Sent: 31 January 2020 11:41 AM > > To: Jolly Shah > > Cc: ard.biesheuvel@linaro.org; mingo@kernel.org; matt@codeblueprint.co.uk; > > sudeep.holla@arm.com; 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 > > > > EXTERNAL EMAIL > > > > On Thu, Jan 30, 2020 at 11:59:03PM +0000, Jolly Shah wrote: > > > Hi Greg, > > > > > > On 1/27/20, 10:28 PM, "linux-kernel-owner@vger.kernel.org on behalf of Greg > > KH" > gregkh@linuxfoundation.org> wrote: > > > > > > On Mon, Jan 27, 2020 at 11:01:27PM +0000, Jolly Shah wrote: > > > > > > > + 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. > > > > > > > > these registers are for users and for special needs where users wants > > > > to retain values over resets. but as they belong to PMU address space, > > > > these interface APIs are provided. They don’t allow access to any > > > > other registers. > > > > > > That's not the issue here. The issue is you are using an "internal" > > > ioctl, instead just make a "real" call. > > > > > > Sorry I am not clear. Do you mean that we should use linux standard > > > ioctl interface instead of internal ioctl by mentioning "real" ? > > > > No, you should just make a "real" function call to the exact thing you > > want to do. Not have an internal multi-plexor ioctl() call that others > > then call. This isn't a microkernel :) > [Rajan] Sorry for multiple back and forth but as I understand, you are suggesting to create a new API for > Read/write of GGS register instead of using PM_IOCTL API (eemi_ops->ioctl) for multiple purpose. Is my understanding correct? That is correct.