Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1961534ybg; Thu, 30 Jul 2020 07:10:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXveudsiv7C7PsFTgsEgb4nLA2FnwFmsAaijJMXESY8wG+3+rGrQknUrDy7j9ia22wj3hg X-Received: by 2002:a17:906:95d4:: with SMTP id n20mr2911436ejy.485.1596118223296; Thu, 30 Jul 2020 07:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596118223; cv=none; d=google.com; s=arc-20160816; b=D5MvbHutH37sXmcnD/t8yj5fJAzEIxvKSehthzbfLn6PbtxHpvvtVjD6S5NT2P7mid alg+IZVuNOiw8bQrSteamQQcgnegFCZZ4waKGFm92bBdqoFU5ex8/qIbmHTlc9VFlWbd 9aAJLcUTF9fb243g1G4SpTTdJDzsNLi0qErxl0xXKk4chHZjgbhMz+kjMuRtqWHvWtQj H5bl5qvTnZ3ETI3UN2Dqog7UPlaKbq6nI6rGzrXR2R/VSnE9HCVbC/a0yjtJR0/4hnGz 00CEqa5hjlTkACV1RajzJVezSuEFBKqF8Da4T9/7a9bh8MmXILf4HITEkiyFqUYSqB4b Mr2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=/yJIAdflfyWK2USs9vge4eTXPW/Wd8+7hnKb/7qJpWo=; b=JXMQ8H4h26ZeR6Q8SVPhfp4bV01lLdkIjPuhugC1TYvvudq/uRyRObC0Qyor5nxc2I 9SvC9QwCkheuunQr3KQgMEkLzKhMSEpNXe3P4GZgb+IKxlAUmbgPZRXvrYq7pftQfVdV N+MwQThKHR9bMiDBGtYQbLtEI9cb3Z1+F5i44YERQP94GuUvcBsuwSJaGTLu2mvk98/T 0kMmdCn6s3xtxLG9nrO1RAFB66B8qMchFiB9niPi89MC5we9lW8Lo6fTa/SqMjF2Mz0H FV/0XP86PLIx7jQJORhi34OxNFB/FTJi9qYxD7YjqO1rgJtyZR+nMVPFgATf+0dwip+H cpMw== 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 bt2si3061605ejb.597.2020.07.30.07.09.59; Thu, 30 Jul 2020 07:10:23 -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 S1728462AbgG3OJ2 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 Jul 2020 10:09:28 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:35721 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728286AbgG3OJ1 (ORCPT ); Thu, 30 Jul 2020 10:09:27 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MNfgZ-1kOzvB0q2F-00P9Oj for ; Thu, 30 Jul 2020 16:09:26 +0200 Received: by mail-qt1-f176.google.com with SMTP id c12so11374418qtn.9 for ; Thu, 30 Jul 2020 07:09:26 -0700 (PDT) X-Gm-Message-State: AOAM532plOoj1RHSzksI5I7LItHRQkUfSnE0HRFaUKRHuFwep8knlCt/ KcCPbl1PxSMJzvtr2t6RFW9s5a/6mOcKheoEvsk= X-Received: by 2002:ac8:688e:: with SMTP id m14mr3126506qtq.7.1596118164881; Thu, 30 Jul 2020 07:09:24 -0700 (PDT) MIME-Version: 1.0 References: <20200724212853.11601-1-daniel.gutson@eclypsium.com> <20200725055649.GA1047853@kroah.com> <20200726071723.GB441916@kroah.com> <20200730053108.GA3861609@kroah.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 30 Jul 2020 16:09:08 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Module argument to control whether intel-spi-pci attempts to turn the SPI flash chip writeable To: Daniel Gutson Cc: Greg Kroah-Hartman , Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Boris Brezillon , linux-mtd , "linux-kernel@vger.kernel.org" , Alex Bazhaniuk , Richard Hughes Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:PaZdRPgyOTwoxdG5QIOY7aerP3XsVhhp5X0+6VM6UA7ZFmCzaCk YB09U/TzuHD0nCwWmohmroDO7KIUC1jSaiQ0mJm7oNxMsg6CtfvSSb7Nk874cAX5Eyl7S82 HOnIyh3g4QMTTef3y8X+UzZZd8lTJGeBxL/fzPJfzhhY/jD9KeheTu8LF++0BUrwooVB116 Pob7dfMIyW2XAUuIEdtlw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:mMUbIM3C6O4=:6eIgjwfPJutJOq76l6dOuN +lU7EAUFi/V6wHWvnAfqFE/ZA6qyGEValzD7OPsGv5grEBxCLwe41EKblkX7LMkj6Enbcm5WW mkOlsIIsE7CY74HtWS8U9li+i2qF9yeLxdiOPk2wcB9zemVayyRwZAFPKKhF7wYv81LBBEyEb ShCAl3lsCYQU8HR7RQNpoB1hOVkoC5lxYmDdSK6Qx5iLj20QMTUEnn61QXKIdGImIgCCqjXXH aNGO+a+lr3scGZuF3YOB8j/Kc+1umq/Mwwm6RfV3up5j27aycfa4fN9nuOxzKAK7WJEmezo1W Evdh9dHkTDgSiZTXbNhHaPL3Ue/jQzJ0ScNar44AgMUz7O1jYjYKbmPJoMJKzwWb+Bhm7zgIS BOh8Sv6j8LuuYm1OwCpDeXxPMzhxp8EJ5dnOop8S2MCSOyVV0l1MtI+OHVPKHsPmVLHcFTqyb pepJ4+4zaeSDLvo+BKezPeFYbNjXtu/i0elkEWtp7gAdPdULUh1GeqJc6czqqdA9mQcF5b7IA 7otPioTr6ZFBJDAwv0NrQ4xWA/vxoDoXqJUcz01h9ALDbt/ElYNFJbREaXhTymqCStOIba0LP fp4lv5EphqrL/IF3NJZjmgCUDHhNQA/4he6PhEGgPokDN4rliJOdxdyzgTp8rLZnyZn2kkBHB tuyR9mPmxJDZI8pS4NT7+aeVDNQ/RrreTlrm8h2YPEZ6TXYSTgK0sa6wYTQQtPhR+H9fZrASI 5pxsrexs6hIe+j3wWuBpHQS2s/pM3jIZ/91UN/ijH3kFeHeweIx1TciU9POROmVA+qlkE4XtZ gefK9f0wONY0Aw0Ib2tV35cv9dBassyil9/DKgYH6mWJ4sgoBM7lub4QLnXS2nf2u8bw3oQiT c7s3qldOYkIcWHm78v39klgAaFCnM7RqoZ0KWF0fbG/O8Hy9cw6h5G3v26OkBSW6P+FPeUn9c Hu1qEZlPFR3V+uECTTrQ7XnLCjmdyYbT+s1LINCH5YQpqqGWL7xSK Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 2:21 PM Daniel Gutson wrote: > El jue., 30 jul. 2020 2:31 a. m., Greg Kroah-Hartman escribió: >> >> Again, module parameters are working on a per-chunk-of-code basis, while >> you want to work on a per-device basis, > > > I think there is a misunderstanding. What I want is to control (turn on or off) is a very specific code snippet that provides the "functionality" of trying to turn the chip writable. The rest of the device driver is fine. > I assume that the one that doesn't understand is me. > I looked at the source code again and found that the existing module parameter applies to both the platform and pci device front-ends, both of which go through /* Prevent writes if not explicitly enabled */ if (!ispi->writeable || !writeable) ispi->nor.mtd.flags &= ~MTD_WRITEABLE; Setting the PCI device writable in hardware makes it possible to actually write to it *only* if the module parameter is also set to '1'. One might disagree with that design, but I don't think your patch would make it any better, it just means one would have to set two module parameters instead of one. Arnd