Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1212162rwb; Wed, 16 Nov 2022 13:59:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Qr+nAUBJtNtFzN+fY0AzSJkJ+dUlh+ujzPbDHdjOFlIex5QFyS9K2O7xsQ2/xS3OrczUG X-Received: by 2002:a17:906:94d9:b0:7ac:a2b7:6c97 with SMTP id d25-20020a17090694d900b007aca2b76c97mr18439919ejy.497.1668635973706; Wed, 16 Nov 2022 13:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668635973; cv=none; d=google.com; s=arc-20160816; b=nP/RErZKVC2DeoAYEmUO5TSDLahVlL2RVvmVonWgd4dvz/+W4sAj1B6KNJIDemcxSm kcidBnIsioAuJYBUFsNCPTlH+kgd9wW097rsuVVA1DqcnvTWG71sx0Eaizrq1GaJDstH CAGCnPbtQJleH62Rcz4Ol3PLmMSvjz5lX5E2nuzrJoPnBbpNdTJ9+F6ZAJj5ptZkUHA5 /4X4Ujc4CHkvzb6J05TvggwABXbildgvpWoyBkmNHnFz302h48KMEP7EjOzYg96HS0vp Hh1oHfNPsdjWwkAs8uPGfGvPSHMB1J761DHQJDJuRrSXcgZbdsL3QyzzW/O1iL9bQEN2 tLxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=D1Bt7N+ypc5yen1pp3Lm77ANhzUiR9KhMDE5FAoINbg=; b=RebSmlNupCI73LsOAiZB5vLJsW4DwlJ0itssID8zsD1vSsN7JkwBUoZ/GlVfbGXyJV socQrKZambci42bii875H6eYnV0y7oZZyCbP9C12LXzpne9+jo/s4O7hJgZwGhyJLE2D Afmf5Q/qfDV9CcTTi6WFj+AFF5yQBj6/tlLfhdCWAhrYQQ2VT7/8SPzUa0OCJHBI7nl2 eOZgPqdd9+AGSBaUjMfdlsIatx85sgMh2MTGn2FGq4jX3VtHpp3mkW4Jo9sAkaHCKLjG XL7HfeSXoM3UT6mC23T2VgfBsBATM5OOApV/SreJh8TMV4Ng5Ajs+oykqynSwlHyL749 Q3eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a1709062a8e00b0076ed46e4440si12238936eje.636.2022.11.16.13.59.12; Wed, 16 Nov 2022 13:59:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234402AbiKPVgT (ORCPT + 90 others); Wed, 16 Nov 2022 16:36:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233809AbiKPVgL (ORCPT ); Wed, 16 Nov 2022 16:36:11 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0E9AFCD3 for ; Wed, 16 Nov 2022 13:36:10 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id B607D92009C; Wed, 16 Nov 2022 22:36:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B272192009B; Wed, 16 Nov 2022 21:36:09 +0000 (GMT) Date: Wed, 16 Nov 2022 21:36:09 +0000 (GMT) From: "Maciej W. Rozycki" To: Sudip Mukherjee cc: linux-kernel@vger.kernel.org Subject: [PATCH 5/6] parport_pc: Add an ECR mask field for PCI devices In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a bitmask field specifying writable ECR bits for PCI devices and apply it via `__parport_pc_probe_port'. Signed-off-by: Maciej W. Rozycki --- drivers/parport/parport_pc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) linux-parport-pc-pci-ecr-write.diff Index: linux-macro/drivers/parport/parport_pc.c =================================================================== --- linux-macro.orig/drivers/parport/parport_pc.c +++ linux-macro/drivers/parport/parport_pc.c @@ -2662,6 +2662,10 @@ static struct parport_pc_pci { /* Bit field of parport modes to exclude. */ unsigned int mode_mask; + /* If non-zero, sets the bitmask of writable ECR bits. In that + * case additionally bit 0 will be forcibly set on writes. */ + unsigned char ecr_writable; + /* If set, this is called immediately after pci_enable_device. * If it returns non-zero, no probing will take place and the * ports will not be used. */ @@ -2868,7 +2872,8 @@ static int parport_pc_pci_probe(struct p __parport_pc_probe_port(io_lo, io_hi, irq, PARPORT_DMA_NONE, &dev->dev, IRQF_SHARED, - cards[i].mode_mask, 0); + cards[i].mode_mask, + cards[i].ecr_writable); if (data->ports[count]) count++; }