Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp622038pxa; Tue, 4 Aug 2020 13:48:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTgG5KDAyOHTkf1QdAz826flKT02NhkMBqNbq62fcZqcI5H6daDCZbsqdv8JwBmeoAzDzb X-Received: by 2002:a17:906:496:: with SMTP id f22mr14872089eja.180.1596574111138; Tue, 04 Aug 2020 13:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596574111; cv=none; d=google.com; s=arc-20160816; b=Dq9fYy+O953viICpwpllqQ+P9b1l9AIVeP9sG0aVmVkg96dYZJzZdtNQM4TYGgqR3K JUdw5zGwLzAgIADCdT26hEmsUO7C8/Cx/zPthsL32+hj21ue5V7wJlPbPJVLMv/3WuCf RyV2nqJs+wvd/BUI977p0ZCgtI6438Y/KL1VyYksMjM+Hk7upTHJXslLdfM8Bu/BEh3C CmtmC2BmXfKAaa96Ka3FCgsR0KbAVOpnD0kSD5Lg3U4XxoUxSEYfZBXQR7pxu3bsC2lt 8V7DDq9VFSQ/1hYFuvtGaaO/S9f+x8UfurOVjtCHVR1xV/RFKfL3cemT14yk2UQ0E9a/ 18CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=CrtSD9IHa7PuL1ifTkireGHgShMmVur8rEKqNeP4/Jw=; b=l4GlLUM+6lbGmW5zz4X/sDp6a2B2gAYgOBxszxkM1py9+RFqJiKGaiGj2QzKSsCsXq aCl9ZBgHDS19Q70xrGD7ILBCsM4d7sO0IPpEXV4tRW6+6MwYRS0TNDXFyNAUvRY6nyie RruoCCacKBb5Xf2QXDFgdoIrgYzEagVuXs8zVd0FbLmo+vKqW+En2dUCu7LQV5uHwAw2 bKeynjl3Xn3uY2H2wPald3SiOsvfCf23U1dOeSLfPZQaab6dmYNzovuxJsnDXCybMoD3 W4OIDdp5j6XNLPA1SlowfdaoivN3klLy9vz5qzmmzUuxPc23e08ShUclBrhp6m7mrEvk wI+A== ARC-Authentication-Results: i=1; mx.google.com; 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 q10si12583830edj.156.2020.08.04.13.48.07; Tue, 04 Aug 2020 13:48:31 -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; 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 S1728031AbgHDUqy (ORCPT + 99 others); Tue, 4 Aug 2020 16:46:54 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:34757 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbgHDUqy (ORCPT ); Tue, 4 Aug 2020 16:46:54 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1M4rkF-1k4RPY1btf-002313 for ; Tue, 04 Aug 2020 22:46:51 +0200 Received: by mail-qt1-f181.google.com with SMTP id s23so32044309qtq.12 for ; Tue, 04 Aug 2020 13:46:51 -0700 (PDT) X-Gm-Message-State: AOAM533lzrJu/Di3qgol87upK+4KjAVJ/O7ZTGh6N8oCEhozwWDq7/kP DQfpv6pbfSj/LxBnec91x8Rq7lKbn04hK+OpH00= X-Received: by 2002:ac8:688e:: with SMTP id m14mr23733224qtq.7.1596574010244; Tue, 04 Aug 2020 13:46:50 -0700 (PDT) MIME-Version: 1.0 References: <20200804135817.5495-1-daniel.gutson@eclypsium.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 4 Aug 2020 22:46:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mtd: spi-nor: intel-spi: Do not try to make the SPI flash chip writable To: Daniel Gutson Cc: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Boris Brezillon , linux-mtd , "linux-kernel@vger.kernel.org" , Alex Bazhaniuk , Richard Hughes , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:0S9TMgZo/mnlFxy49h/RbsO1Aq1qoNkWDjat11AnV1WQiXl0kBQ jHs8uUbp6BwQXfT8HS+G/LDsdFxB8u9r5bYc8S+zvPscW5Vd/VHd6j9sO6GRC6KcrenDZQH +euTWcfIdLVNEUor1sToNC0f7xu7kGXyBeZ2LEK6ZObDqeeJPguGMIwLtSfo0+f5A5y4VEW H+lID/jNrKeMjBmKeYBZw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0Ty7GXGzy5U=:VgmdVWutpR1O235UZIRn1L Kx4oby2OzgVA6aMDm10Lj0p/rijOSPRbqVeNvBwtc57D9Yg3QBYfmX5NLH6GDUQf7RITNh7L/ c1WPZIfsF2XwJYWc5S8TyE7WgzdOS1AFfoS7lTxm56NCYq3ck8hGZDB2NkbAKJpz72T5mOB7R fW6EofHzA/IeVSYEBaAyhzm7uLzQNroP1Z+YZ7dNN+Kl7Xw2arzWmF1uvITW3RXHqemVZbSsj KfdFRzD+Wa2Ic3j6wfhRiqtrod0I49zdt+G8h107xBbm2EsE05dYILWd9HKjJg4dV607hfA8g gmJOHrl/6ffUYYyNUVMeNQ+oAF8D+nMZ2sDm4j+QkMRxfM6HLF3LosfHA9JWjdwT00gRc0gdb Q5FfxaYjdxlhVjfcD2KPqXvNoKDegaiGlCCtgnRRk12iDzvqnDv45utor0ksSEeFDJ5EIc6rO CNSfYE7e2XRhIlKSiV8Wb66gbCdQV3JL5CZ2TRBb7r2v3RkBt8N5BLOFhTbAm1UTy5wQllErF 3Y3cr6IalcKHt1AVlp+CLLhVPE94LU3rDmv0QCQYl1BIoIXoMYdq8bg0FJbNOYr0GXmTQt05V dJGSAP/lBE7JAoWEj8GvzxSzmQ7N7ayOLEOQXrc8ZIhtCVr2i0Tf6LM9GJGrAx/i6gDH+tFvl Y9BXxoJAD00NHNLIWBoW00MpU92IhyHgymh3auWLwqNasaMRRNmYjWKgwUBSvGhYnwarYOmwM GF3g4nKF7/mi0AnSW7CLW6g934bVdVhG48PW1GWYMf1dh5XZJrdYF9hWEtH4+qoSgF54qCyq2 dmpjZyTDNUo54XyUCD3b2EHrdbyuRamxf0WDFWF1ztBwfgy8iVAwqBPn5P99sAnAOuqH+Z4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 4, 2020 at 9:57 PM Daniel Gutson wrote: > On Tue, Aug 4, 2020 at 4:06 PM Arnd Bergmann wrote: > > On Tue, Aug 4, 2020 at 5:49 PM Daniel Gutson wrote: > > > On Tue, Aug 4, 2020 at 12:21 PM Arnd Bergmann wrote: > > >> On Tue, Aug 4, 2020 at 3:58 PM Daniel Gutson > > >> wrote: > > > > > > What about just saying > > > > > > "This patch removes the attempt by the intel-spi-pci driver to > > > make the chip always writable." > > > > Yes, that is much better, though it still sounds like it would at the > > moment allow writing to the device from software without also > > setting the module parameter. I would say something like > > > > "Disallow overriding the write protection in the PCI driver > > with a module parameter and instead honor the current > > state of the write protection as set by the firmware." > > But wait, Mika, the author of the file, asked earlier not to remove > the module parameter of intel-spi, and just remove the unconditional > attempt to turn the chip writable in intle-spi-pci. Yes, and I think that is fine (aside from the inconsistency with bay trail that you have not commented on), but that only touches the hardware write-protection, which doesn't really have any effect unless user space also configures the driver module to allow writing to the mtd device. > So I'm not touching intel-pci, just removing that code from > intel-spi-pci without adding a new module parameter. > > Are you aligned on this? One of us is still very confused about what the driver does. You seem to have gone back to saying that without the change a user could just write to the device even without passing the module parameter to intel-spi.ko? Maybe you should start by explaining what scenario you actually want to prevent here. Is it a) the hardware write-protect bit getting changed, which introduces the possibility of corrupting the flash even if nothing tries to write to it, b) root users setting the device writable with the intention of writing to it even though firmware has politely asked for this not to be done (by setting the write-protect bit but not preventing it from being disabled again), or c) a writeable mtd device showing up even without the module parameter being set at all? I thought the initial patch was about c) which turned out to be a non-issue, and then the later patch being about b). Arnd