Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4570723imw; Tue, 19 Jul 2022 09:03:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u3JVlLzzA1FLUrK//p2RzKg2g8ZVaLi6s3lt09lf5soM/XSAogDdmqQw9065WaX4dVH6Ry X-Received: by 2002:a17:906:9b0a:b0:72e:e524:180a with SMTP id eo10-20020a1709069b0a00b0072ee524180amr23675711ejc.131.1658246584190; Tue, 19 Jul 2022 09:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658246584; cv=none; d=google.com; s=arc-20160816; b=yU3aBXx49UDJsVXkS78rPE0eXXPLILiaYnuQ/uk3UMZf5hhcTDfSsms2jHBDTxLWf4 e98EhuaVyphMiN+xtNllpWVM2cQkhzKdqy5qVj4LOcnvY776eHWD3YgDDqZLcK6naxdX iLKOVIQAGvYegwhFkvSOHOyrRoUdAQmlu74WIj72AnUOoQu1mrGnpeJqfjnh1dXdxD+G B2oPjdSwIzxmw2r53pzBxJ0ZVsvm8zQdb5SNZUgxmT+f1AdG23mf5ZJw050WGPso1sq0 2U80vdLUp1EU5K6y+8g5GwP3lZCW50dg7a1etJo0GbC4dmDqLJV+FkSpmX+vjnawIx8E c9/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=/r4UAVH4dKLHCNRrex6hqWzeynZnpP8d8Equk++CWzk=; b=GBUwTPwvjRci8f/buvfHfBcZnpjdhixlUkdQLclnq69bqssVYc16zXSX/bmbZHlwTK SejbmJ0xhKg9swIUy185AwGjy4aMb7i6Ju8S0hrF7RwK9qOtkQEqCjwvD2MiiMCEjz5r xiS7/cMwZ3YXAEL4WNCXQsgFurWYIYe3YDVoAgR9pHP5rEEZoMw9Mqe+lrryDvpiVrc4 GGS55+a6wOAyQBYqMqFuBOiFdZJYt0k9EnLgt8rXrdAxk9y/xTCXsGhgTypFOwYUX/TB eKT3G8iuF+xqruBSi+pClpTzpoK2C1HOgvwFKslWGHH80Yz3cHwlLD6c2q+Pc4L3BmT1 LYJg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j21-20020aa7c0d5000000b004355e62629fsi18158497edp.157.2022.07.19.09.02.32; Tue, 19 Jul 2022 09:03:04 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233681AbiGSPJu convert rfc822-to-8bit (ORCPT + 99 others); Tue, 19 Jul 2022 11:09:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237387AbiGSPJl (ORCPT ); Tue, 19 Jul 2022 11:09:41 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 600265070E for ; Tue, 19 Jul 2022 08:09:39 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-183-zqQ9LstYPPWsc5DQ7f8mTg-1; Tue, 19 Jul 2022 16:09:36 +0100 X-MC-Unique: zqQ9LstYPPWsc5DQ7f8mTg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Tue, 19 Jul 2022 16:09:35 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.036; Tue, 19 Jul 2022 16:09:35 +0100 From: David Laight To: 'Stafford Horne' , Arnd Bergmann CC: Christoph Hellwig , LKML , Catalin Marinas , Will Deacon , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Richard Weinberger , Anton Ivanov , Johannes Berg , Bjorn Helgaas , Linux ARM , "linux-csky@vger.kernel.org" , linux-riscv , linux-um , linux-pci , linux-arch Subject: RE: [PATCH v2 2/2] asm-generic: Add new pci.h and use it Thread-Topic: [PATCH v2 2/2] asm-generic: Add new pci.h and use it Thread-Index: AQHYm2+TjSo9GtSn30WwmySb6t2iTK2Fy5bA Date: Tue, 19 Jul 2022 15:09:35 +0000 Message-ID: <874af766883a4c0da6759eff433ec6d6@AcuMS.aculab.com> References: <20220717033453.2896843-1-shorne@gmail.com> <20220717033453.2896843-3-shorne@gmail.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 From: Stafford Horne > Sent: 19 July 2022 13:24 > > On Tue, Jul 19, 2022 at 01:55:03PM +0200, Arnd Bergmann wrote: > > On Tue, Jul 19, 2022 at 12:55 PM Stafford Horne wrote: > > > > > diff --git a/drivers/comedi/drivers/comedi_isadma.c b/drivers/comedi/drivers/comedi_isadma.c > > > index 700982464c53..508421809128 100644 > > > --- a/drivers/comedi/drivers/comedi_isadma.c > > > +++ b/drivers/comedi/drivers/comedi_isadma.c > > > @@ -104,8 +104,10 @@ unsigned int comedi_isadma_poll(struct comedi_isadma *dma) > > > > > > flags = claim_dma_lock(); > > > clear_dma_ff(desc->chan); > > > +#ifdef CONFIG_X86_32 > > > if (!isa_dma_bridge_buggy) > > > disable_dma(desc->chan); > > > +#endif > > > > There is a logic mistake here: if we are on something other than x86-32, > > this always needs to call the disable_dma()/enable_dma(). > > Oops, thats right. Sorry, I should have noticed that. > > > Not sure how to best express this in a readable way, something like this > > would work: > > Option 1: > > > #ifdef CONFIG_X86_32 > > if (!isa_dma_bridge_buggy) > > #endif > > disable_dma(desc->chan); > > > > > > or possibly at the start of this file, a > > Option 2: > > > #ifndef CONFIG_X86_32 > > #define isa_dma_bridge_buggy 0 > > #endif > > Option 3: > > > Or we could try to keep the generic definition in a global header > > like linux/isa-dma.h. > > Perhaps option 3 makes the whole patch the most clean. Isn't there a define that can be used inside an if? So you could do: if (!IS_CONFIG_X86_32 || !isa_dma_bridge_buggy) disable_dma(); (but I can't remember the name!) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)