Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1612855

Re: [PATCH] serial: Do not treat the IIR register as a bitfield

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] serial: Do not treat the IIR register as a bitfield
Date 2017-03-30 12:10 +0200
Message-ID <tqFbK-4Hn-79@gated-at.bofh.it> (permalink)
References <tqqPn-2sY-3@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


On Wed, 2017-03-29 at 20:44 +0200, Olliver Schinagl wrote:
> It seems that at some point, someone made the assumption that the UART
> Interrupt ID Register was a bitfield and started to check if certain
> bits where set.
> 
> Actually however the register contains interrupt ID's where only the
> MSB
> seems to be used singular and the rest share at least one bit. Thus
> doing bitfield operations is wrong.
> 
> This patch cleans up the serial_reg include file by ordering it and
> replacing the UART_IIR_ID 'mask' with a proper mask for the register.
> The OMAP uart appears to have used the two commonly 'reserved' bits 4
> and 5 and thus get an UART_IIR_EXT_MASK for these two bits.
> 
> This patch then goes over all UART_IIR_* users and changes the code
> from
> bitfield checking, to ID checking instead.


Looking to implementation I would rather go with some helper like

int serial_in_IIR(port, [additional mask])
{
 return port->serial_in(port, UART_IIR) & (_IIR_MASK [| additional
mask]);
}

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] serial: Do not treat the IIR register as a bitfield Olliver Schinagl <oliver@schinagl.nl> - 2017-03-29 20:50 +0200
  Re: [PATCH] serial: Do not treat the IIR register as a bitfield Vignesh R <vigneshr@ti.com> - 2017-03-30 08:20 +0200
    Re: [PATCH] serial: Do not treat the IIR register as a bitfield Olliver Schinagl <oliver@schinagl.nl> - 2017-03-30 08:50 +0200
      Re: [PATCH] serial: Do not treat the IIR register as a bitfield Vignesh R <vigneshr@ti.com> - 2017-03-30 10:10 +0200
        Re: [PATCH] serial: Do not treat the IIR register as a bitfield Olliver Schinagl <oliver@schinagl.nl> - 2017-03-30 17:50 +0200
      Re: [PATCH] serial: Do not treat the IIR register as a bitfield Theodore Ts'o <tytso@mit.edu> - 2017-03-30 16:20 +0200
        Re: [PATCH] serial: Do not treat the IIR register as a bitfield Olliver Schinagl <o.schinagl@ultimaker.com> - 2017-03-31 13:30 +0200
  Re: [PATCH] serial: Do not treat the IIR register as a bitfield Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-30 12:10 +0200
    Re: [PATCH] serial: Do not treat the IIR register as a bitfield Olliver Schinagl <o.schinagl@ultimaker.com> - 2017-03-31 16:00 +0200
      Re: [PATCH] serial: Do not treat the IIR register as a bitfield Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-31 16:50 +0200
  Re: [PATCH] serial: Do not treat the IIR register as a bitfield kbuild test robot <lkp@intel.com> - 2017-03-30 14:20 +0200

csiph-web