mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api
@ 2007-08-24 19:31 Scott Thompson
  0 siblings, 0 replies; 6+ messages in thread
From: Scott Thompson @ 2007-08-24 19:31 UTC (permalink / raw)
  To: jirislaby, alan; +Cc: linux-kernel, kernel-janitors

On Fri, 24 Aug 2007 15:15:30 -0400 Alan Cox 
<alan@lxorguk.ukuu.org.uk> wrote:
>ase, 0x80);
>> 
>> remove also the hwbase var.
>> 
>> > +	rebase = pci_iomap(pdev, 0, 0x80);
>> >   	t = readl(rebase + CNTRL_REG_OFFSET);
>
>Switch to ioread* if you are using the iomap interface. Its not a 
>trivial
>conversion and its slower and bulkier - the original ioremap was 
>much
>better
>
>NAK this change therefore

Jiri had requested this in relation to previous patch on unchecked 
ioremap return codes, but if the original ioremap is better NAK is 
fine
here and I won't resubmit w/ the hwbase var pulled out or the readl 
-> ioread32 switchover.

---------------------------------------
Scott Thompson / postfail@hushmail.com
---------------------------------------


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api
  2007-08-24 20:03     ` Jiri Slaby
@ 2007-08-24 20:34       ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2007-08-24 20:34 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Jiri Slaby, postfail, linux-kernel, kernel-janitors

On Fri, 24 Aug 2007 22:03:42 +0200
Jiri Slaby <jirislaby@gmail.com> wrote:

> Alan Cox napsal(a):
> > ase, 0x80);
> >> remove also the hwbase var.
> >>
> >>> +	rebase = pci_iomap(pdev, 0, 0x80);
> >>>   	t = readl(rebase + CNTRL_REG_OFFSET);
> > 
> > Switch to ioread* if you are using the iomap interface. Its not a trivial
> 
> Why, if you know it's surely a mem region (and thus you rely on it and do
> ioremap)? There are many places in the kernel, where this approach is used, e.g.
> libata piix.

Every single one of them is wrong. The encoding of iomap values is
platform dependant. Fixed in my tree.
> 
> > conversion and its slower and bulkier - the original ioremap was much
> > better
> 
> at least get rid of the reading the hwbase address from pci conf space, use
> pci_resource_start instead.

Agreed entirely

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api
  2007-08-24 19:15   ` Alan Cox
@ 2007-08-24 20:03     ` Jiri Slaby
  2007-08-24 20:34       ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2007-08-24 20:03 UTC (permalink / raw)
  To: Alan Cox; +Cc: Jiri Slaby, postfail, linux-kernel, kernel-janitors

Alan Cox napsal(a):
> ase, 0x80);
>> remove also the hwbase var.
>>
>>> +	rebase = pci_iomap(pdev, 0, 0x80);
>>>   	t = readl(rebase + CNTRL_REG_OFFSET);
> 
> Switch to ioread* if you are using the iomap interface. Its not a trivial

Why, if you know it's surely a mem region (and thus you rely on it and do
ioremap)? There are many places in the kernel, where this approach is used, e.g.
libata piix.

> conversion and its slower and bulkier - the original ioremap was much
> better

at least get rid of the reading the hwbase address from pci conf space, use
pci_resource_start instead.

-- 
Jiri Slaby (jirislaby@gmail.com)
Faculty of Informatics, Masaryk University

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api
  2007-08-24 18:59 ` Jiri Slaby
@ 2007-08-24 19:15   ` Alan Cox
  2007-08-24 20:03     ` Jiri Slaby
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2007-08-24 19:15 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: postfail, linux-kernel, kernel-janitors

ase, 0x80);
> 
> remove also the hwbase var.
> 
> > +	rebase = pci_iomap(pdev, 0, 0x80);
> >   	t = readl(rebase + CNTRL_REG_OFFSET);

Switch to ioread* if you are using the iomap interface. Its not a trivial
conversion and its slower and bulkier - the original ioremap was much
better

NAK this change therefore

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api
  2007-08-24 18:49 Scott Thompson
@ 2007-08-24 18:59 ` Jiri Slaby
  2007-08-24 19:15   ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2007-08-24 18:59 UTC (permalink / raw)
  To: postfail; +Cc: linux-kernel, kernel-janitors

On 8/24/07, Scott Thompson <postfailathushmail@gmail.com> wrote:
>
> patchset against 2.6.23-rc3.
>
> moves the iomap/iounmap call to pci 'flavor'.  this was a
> recommendation from a previously submitted patch that handles
> the unchecked iomap (or, now, pci_iomap) return code.
>
> Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
> ----------------------------------------------------------
>
> diff --git a/drivers/char/sx.c b/drivers/char/sx.c
> index 85a2328..481334f 100644
> --- a/drivers/char/sx.c
> +++ b/drivers/char/sx.c
> @@ -2626,14 +2626,14 @@ static void __devinit fix_sx_pci(struct pci_dev
> *pdev, struct sx_board *board)
>
>   	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &hwbase);
>   	hwbase &= PCI_BASE_ADDRESS_MEM_MASK;
> -	rebase = ioremap(hwbase, 0x80);

remove also the hwbase var.

> +	rebase = pci_iomap(pdev, 0, 0x80);
>   	t = readl(rebase + CNTRL_REG_OFFSET);
>   	if (t != CNTRL_REG_GOODVALUE) {
>   		printk(KERN_DEBUG "sx: performing cntrl reg fix: %08x -> "
>   			"%08x\n", t, CNTRL_REG_GOODVALUE);
>   		writel(CNTRL_REG_GOODVALUE, rebase + CNTRL_REG_OFFSET);
>   	}
> -	iounmap(rebase);
> +	pci_iounmap(pdev, rebase);
>   }
>   #endif
>


-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api
@ 2007-08-24 18:49 Scott Thompson
  2007-08-24 18:59 ` Jiri Slaby
  0 siblings, 1 reply; 6+ messages in thread
From: Scott Thompson @ 2007-08-24 18:49 UTC (permalink / raw)
  To: linux-kernel, kernel-janitors, jirislaby


patchset against 2.6.23-rc3.

moves the iomap/iounmap call to pci 'flavor'.  this was a
recommendation from a previously submitted patch that handles
the unchecked iomap (or, now, pci_iomap) return code.

Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
----------------------------------------------------------

diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 85a2328..481334f 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -2626,14 +2626,14 @@ static void __devinit fix_sx_pci(struct pci_dev *pdev, struct sx_board *board)

  	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &hwbase);
  	hwbase &= PCI_BASE_ADDRESS_MEM_MASK;
-	rebase = ioremap(hwbase, 0x80);
+	rebase = pci_iomap(pdev, 0, 0x80);
  	t = readl(rebase + CNTRL_REG_OFFSET);
  	if (t != CNTRL_REG_GOODVALUE) {
  		printk(KERN_DEBUG "sx: performing cntrl reg fix: %08x -> "
  			"%08x\n", t, CNTRL_REG_GOODVALUE);
  		writel(CNTRL_REG_GOODVALUE, rebase + CNTRL_REG_OFFSET);
  	}
-	iounmap(rebase);
+	pci_iounmap(pdev, rebase);
  }
  #endif

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-24 20:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-24 19:31 [PATCH] /drivers/char sx.c ioremap -> pci_ioremap api Scott Thompson
  -- strict thread matches above, loose matches on Subject: below --
2007-08-24 18:49 Scott Thompson
2007-08-24 18:59 ` Jiri Slaby
2007-08-24 19:15   ` Alan Cox
2007-08-24 20:03     ` Jiri Slaby
2007-08-24 20:34       ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®