Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2722204ybh; Fri, 24 Jul 2020 22:58:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ9xY4GapO8jr/ZIIgU730ttGI0gcjJw2z0nQE3MiytoritmxiXBH4yZttvY4zkBmcmDby X-Received: by 2002:a05:6402:b84:: with SMTP id cf4mr11680382edb.21.1595656681637; Fri, 24 Jul 2020 22:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595656681; cv=none; d=google.com; s=arc-20160816; b=Bmj1q5lJVzUo1PnK55Sf7FOgX9n+0ll018v7GcLGVcG+HGgbTbbxU7oBO5SVOXpYn9 2PYK9jIKZsiahy4R1ewexeGi1DNVbdcnrYcctoubDQXC5ux85YqHDFaExwJ9UYq5mYNX 485Eog448vB6cmKv7I/E/xaoOgV+W989UHXA6MmAbkR0P3onZz73lxICipKSqMltAv7K p30rOAMQlUcjQJ9XQDh9q4fJCE70nZeB5loP5eoE8p2pJSbkxIRIC3u0khQSzEsrvfxw LS7z1dBeUgaygYAydPf1vVfsElfBNogP+XjOmZ+xUp+1x2qpkJHVvix618CZubsFeWqK LjyQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tuJ557jltu+cW42bSGIll+Q+7xU3g2IJZ3ceDgHIt/U=; b=MHTN936zAqPdnUjaSCRd4HLjuwzS3J4cxlWcRBRCEzqrdV/Zf0yAaNoKeAl/bjvdQP oX1RmDJQHRGJ4HtMqu/AWi1xt1UyXNzweXJmkTNsod1un755yVndI45Ue9EIwPt5Oyaq OP1k9v6UjC0NhG4Gqq4qfuUSrjxD3Qa1dWOLadFtGI04tOykvl0KU15JCNpEoE4aNO2l f4HZetdIJMyBvEyeGwuwfHfZ+y1oeIJ9/o3iLNWnKV1LHc3mwpptI+J5tUYmOFrJlRBR QT8hdz4ScsFmHrgNyzqlv3jgBoFE5HF4ieTZgG91jm36HZi/FHD7+IP8QeyXIo/WaxGH jsPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ts8zMM8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si573772eji.277.2020.07.24.22.57.38; Fri, 24 Jul 2020 22:58:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ts8zMM8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgGYF4t (ORCPT + 99 others); Sat, 25 Jul 2020 01:56:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:60004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgGYF4t (ORCPT ); Sat, 25 Jul 2020 01:56:49 -0400 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 32E45206D8; Sat, 25 Jul 2020 05:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595656608; bh=lQhz2ZepJuKrQE6NHOi5RHfNha5MRdXWgWs0MBUaets=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ts8zMM8p72miir5GvC28+VIQ0mLvr9mVzE62fON6hzD2PGrz0uIGan2mZ9pJhiee6 1m+kOyHkfHShDhA9JXPdXufKS52nM7bzVjmoTUSSzJ4RS0MIqQsq/pw0+bLr0nzXpD O3Fzz2P/CsmxYuZROgyNTtQwQAEQAEGB7j9r/Um0= Date: Sat, 25 Jul 2020 07:56:49 +0200 From: Greg Kroah-Hartman To: Daniel Gutson Cc: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Boris Brezillon , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bazhaniuk , Richard Hughes , Arnd Bergmann Subject: Re: [PATCH] Module argument to control whether intel-spi-pci attempts to turn the SPI flash chip writeable Message-ID: <20200725055649.GA1047853@kroah.com> References: <20200724212853.11601-1-daniel.gutson@eclypsium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200724212853.11601-1-daniel.gutson@eclypsium.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 24, 2020 at 06:28:53PM -0300, Daniel Gutson wrote: > Currently, intel-spi has a module argument that controls whether the driver > attempts to turn the SPI flash chip writeable. The default value > is FALSE (don't try to make it writeable). > However, this flag applies only for a number of devices, coming from the > platform driver, whereas the devices detected through the PCI driver > (intel-spi-pci) are not subject to this check since the configuration > takes place in intel-spi-pci which doesn't have an argument. > > That's why I propose this patch to add such argument to intel-spi-pci, > so the user can control whether the driver tries to make the chip > writeable or not, being the default FALSE as is the argument of > intel-spi. > > Signed-off-by: Daniel Gutson > --- > drivers/mtd/spi-nor/controllers/intel-spi-pci.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/spi-nor/controllers/intel-spi-pci.c b/drivers/mtd/spi-nor/controllers/intel-spi-pci.c > index 81329f680bec..77e57450f166 100644 > --- a/drivers/mtd/spi-nor/controllers/intel-spi-pci.c > +++ b/drivers/mtd/spi-nor/controllers/intel-spi-pci.c > @@ -24,6 +24,10 @@ static const struct intel_spi_boardinfo cnl_info = { > .type = INTEL_SPI_CNL, > }; > > +static bool writeable; > +module_param(writeable, bool, 0); > +MODULE_PARM_DESC(writeable, "Enable write access to SPI flash chip (default=0)"); Ick, this isn't the 1990's, please do not add new module parameters, they are a major pain to work with and only work on a global basis, not on a per-device basis. No user will remember how to use this, as it isn't documented anywhere either. Can you make this a sysfs attribute or something, or better yet, make it "just work" depending on the device type? thanks, greg k-h