Re: [PATCH v1 1/3] serial: 8250_exar: Move the Exar bits from 8250_port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-07-23 at 10:03 -0500, Aaron Sierra wrote:

> > >         /* Clear all PCI interrupts by reading INT0. No effect on
> > > IIR
> > > */
> > >         ioread8(priv->virt + UART_EXAR_INT0);
> > 
> > As I mentioned in previous message, this and below it better to be
> > readb().
> 
> Hi Andy,
> 
> Why better?

Two points:
 - consistency with the existing code
 - no need to check for / use IO when you 100% sure there will be MMIO
access only

(Note, I put consistency first)

>  I've been under the impression that ioreadX() are the
> preferred accessors

Why do we need it? Why it's preferred here?

>  for the general case due to type checking and
> general utility. They are typically implemented around readX() anyway.
> The virtual address is mapped from an MMIO BAR, so all accesses will
> be
> MMIO in either case.
> 
> Here's my (possibly dated) primary motivator:
> 
>   https://yarchive.net/comp/linux/io_space_accesses.html
> 
> Has something changed that I'm not aware of?

>From the same link:

--- 8< --- 8< ---

- if your device only supports MMIO, you might as well just use the old
   interfaces.

--- 8< --- 8< ---

See what I wrote above.

> > > +       /* Clear INT0 for Expansion Interface slave ports, too */
> > > +       if (priv->board->num_ports > 8)
> > > +               ioread8(priv->virt + (8 * 0x400) +
> > > UART_EXAR_INT0);
> > 
> > 0x2000 is explicitly mentioned in the data sheet, so, I doubt we
> > need to
> > describe it as 8 * 0x400.
> 
> I was conflicted on that, thinking showing the logic behind that value
> might have some benefit, but I agree that 0x2000 would be more readily
> identifiable within the manual. I'll follow your recommendation in the
> version that I submit.

Thanks!

-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux