All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Stafford Horne' <shorne@gmail.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	linux-um <linux-um@lists.infradead.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: RE: [PATCH v2 2/2] asm-generic: Add new pci.h and use it
Date: Tue, 19 Jul 2022 15:09:35 +0000	[thread overview]
Message-ID: <874af766883a4c0da6759eff433ec6d6@AcuMS.aculab.com> (raw)
In-Reply-To: <YtaiSEAnMhVqR4HS@antec>

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 <shorne@gmail.com> 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)


WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight@ACULAB.COM>
To: 'Stafford Horne' <shorne@gmail.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	linux-um <linux-um@lists.infradead.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: RE: [PATCH v2 2/2] asm-generic: Add new pci.h and use it
Date: Tue, 19 Jul 2022 15:09:35 +0000	[thread overview]
Message-ID: <874af766883a4c0da6759eff433ec6d6@AcuMS.aculab.com> (raw)
In-Reply-To: <YtaiSEAnMhVqR4HS@antec>

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 <shorne@gmail.com> 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)


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight@ACULAB.COM>
To: 'Stafford Horne' <shorne@gmail.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	linux-um <linux-um@lists.infradead.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: RE: [PATCH v2 2/2] asm-generic: Add new pci.h and use it
Date: Tue, 19 Jul 2022 15:09:35 +0000	[thread overview]
Message-ID: <874af766883a4c0da6759eff433ec6d6@AcuMS.aculab.com> (raw)
In-Reply-To: <YtaiSEAnMhVqR4HS@antec>

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 <shorne@gmail.com> 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)


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight@ACULAB.COM>
To: 'Stafford Horne' <shorne@gmail.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	linux-um <linux-um@lists.infradead.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: RE: [PATCH v2 2/2] asm-generic: Add new pci.h and use it
Date: Tue, 19 Jul 2022 15:09:35 +0000	[thread overview]
Message-ID: <874af766883a4c0da6759eff433ec6d6@AcuMS.aculab.com> (raw)
In-Reply-To: <YtaiSEAnMhVqR4HS@antec>

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 <shorne@gmail.com> 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)


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


  parent reply	other threads:[~2022-07-19 15:09 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17  3:34 [PATCH v2 0/2] Updates for asm-generic/pci.h Stafford Horne
2022-07-17  3:34 ` Stafford Horne
2022-07-17  3:34 ` [PATCH v2 1/2] asm-generic: Remove pci.h copying remaining code to x86 Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-17  9:23   ` Geert Uytterhoeven
2022-07-17  9:23     ` Geert Uytterhoeven
2022-07-17  9:23     ` Geert Uytterhoeven
2022-07-17  9:23     ` Geert Uytterhoeven
2022-07-17  9:23     ` Geert Uytterhoeven
2022-07-17  9:42     ` Stafford Horne
2022-07-17  9:42       ` Stafford Horne
2022-07-18  4:33   ` Christoph Hellwig
2022-07-18  4:33     ` Christoph Hellwig
2022-07-18  4:33     ` Christoph Hellwig
2022-07-18  4:33     ` Christoph Hellwig
2022-07-18  4:33     ` Christoph Hellwig
2022-07-18  8:40     ` Arnd Bergmann
2022-07-18  8:40       ` Arnd Bergmann
2022-07-18  8:40       ` Arnd Bergmann
2022-07-18  8:40       ` Arnd Bergmann
2022-07-18  8:40       ` Arnd Bergmann
2022-07-19 10:51       ` Stafford Horne
2022-07-19 10:51         ` Stafford Horne
2022-07-19 10:51         ` Stafford Horne
2022-07-19 10:51         ` Stafford Horne
2022-07-19 10:51         ` Stafford Horne
2022-07-17  3:34 ` [PATCH v2 2/2] asm-generic: Add new pci.h and use it Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-17  3:34   ` Stafford Horne
2022-07-18  4:37   ` Christoph Hellwig
2022-07-18  4:37     ` Christoph Hellwig
2022-07-18  4:37     ` Christoph Hellwig
2022-07-18  4:37     ` Christoph Hellwig
2022-07-18  6:56     ` Arnd Bergmann
2022-07-18  6:56       ` Arnd Bergmann
2022-07-18  6:56       ` Arnd Bergmann
2022-07-18  6:56       ` Arnd Bergmann
     [not found]       ` <CAAfxs740yz1vJmtFHOPTXT6fqi0+37SR_OhoGsONe4mx_21+_g@mail.gmail.com>
2022-07-19  7:45         ` Arnd Bergmann
2022-07-19  7:45           ` Arnd Bergmann
2022-07-19  7:45           ` Arnd Bergmann
2022-07-19  7:45           ` Arnd Bergmann
2022-07-19 10:55           ` Stafford Horne
2022-07-19 10:55             ` Stafford Horne
2022-07-19 10:55             ` Stafford Horne
2022-07-19 10:55             ` Stafford Horne
2022-07-19 11:55             ` Arnd Bergmann
2022-07-19 11:55               ` Arnd Bergmann
2022-07-19 11:55               ` Arnd Bergmann
2022-07-19 11:55               ` Arnd Bergmann
2022-07-19 12:23               ` Stafford Horne
2022-07-19 12:23                 ` Stafford Horne
2022-07-19 12:23                 ` Stafford Horne
2022-07-19 12:23                 ` Stafford Horne
2022-07-19 13:05                 ` Stafford Horne
2022-07-19 13:05                   ` Stafford Horne
2022-07-19 13:05                   ` Stafford Horne
2022-07-19 13:05                   ` Stafford Horne
2022-07-19 13:18                   ` Arnd Bergmann
2022-07-19 13:18                     ` Arnd Bergmann
2022-07-19 13:18                     ` Arnd Bergmann
2022-07-19 13:18                     ` Arnd Bergmann
2022-07-19 13:33                     ` Stafford Horne
2022-07-19 13:33                       ` Stafford Horne
2022-07-19 13:33                       ` Stafford Horne
2022-07-19 13:33                       ` Stafford Horne
2022-07-19 14:32                   ` Christoph Hellwig
2022-07-19 14:32                     ` Christoph Hellwig
2022-07-19 14:32                     ` Christoph Hellwig
2022-07-19 14:32                     ` Christoph Hellwig
2022-07-20 13:21                     ` Stafford Horne
2022-07-20 13:21                       ` Stafford Horne
2022-07-20 13:21                       ` Stafford Horne
2022-07-20 13:21                       ` Stafford Horne
2022-07-19 15:09                 ` David Laight [this message]
2022-07-19 15:09                   ` David Laight
2022-07-19 15:09                   ` David Laight
2022-07-19 15:09                   ` David Laight
2022-07-20 13:24                   ` Stafford Horne
2022-07-20 13:24                     ` Stafford Horne
2022-07-20 13:24                     ` Stafford Horne
2022-07-20 13:24                     ` Stafford Horne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874af766883a4c0da6759eff433ec6d6@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=guoren@kernel.org \
    --cc=hch@infradead.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-um@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=richard@nod.at \
    --cc=shorne@gmail.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.