<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/tty/serial/max310x.c, branch v4.9.331</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-06-03T06:23:31+00:00</updated>
<entry>
<title>serial: max310x: unregister uart driver in case of failure and abort</title>
<updated>2021-06-03T06:23:31+00:00</updated>
<author>
<name>Atul Gopinathan</name>
<email>atulgopinathan@gmail.com</email>
</author>
<published>2021-05-03T11:56:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27d75d2e636f26ab027f728d538430f608c66b7c'/>
<id>urn:sha1:27d75d2e636f26ab027f728d538430f608c66b7c</id>
<content type='text'>
[ Upstream commit 3890e3dea315f1a257d1b940a2a4e2fa16a7b095 ]

The macro "spi_register_driver" invokes the function
"__spi_register_driver()" which has a return type of int and can fail,
returning a negative value in such a case. This is currently ignored and
the init() function yields success even if the spi driver failed to
register.

Fix this by collecting the return value of "__spi_register_driver()" and
also unregister the uart driver in case of failure.

Cc: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Signed-off-by: Atul Gopinathan &lt;atulgopinathan@gmail.com&gt;
Link: https://lore.kernel.org/r/20210503115736.2104747-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Fix tx_empty() callback</title>
<updated>2019-12-05T14:34:41+00:00</updated>
<author>
<name>Alexander Shiyan</name>
<email>shc_work@mail.ru</email>
</author>
<published>2018-12-19T11:19:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6c0485c509e21dee309595646eb4d0dcd38ac07'/>
<id>urn:sha1:f6c0485c509e21dee309595646eb4d0dcd38ac07</id>
<content type='text'>
[ Upstream commit a8da3c7873ea57acb8f9cea58c0af477522965aa ]

Function max310x_tx_empty() accesses the IRQSTS register, which is
cleared by IC when reading, so if there is an interrupt status, we
will lose it. This patch implement the transmitter check only by
the current FIFO level.

Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tty: max310x: Fix invalid baudrate divisors calculator</title>
<updated>2019-08-04T07:33:36+00:00</updated>
<author>
<name>Serge Semin</name>
<email>fancer.lancer@gmail.com</email>
</author>
<published>2019-05-14T10:14:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efab087c6372e905c493a4cd4a32e3b609f896f4'/>
<id>urn:sha1:efab087c6372e905c493a4cd4a32e3b609f896f4</id>
<content type='text'>
[ Upstream commit 35240ba26a932b279a513f66fa4cabfd7af55221 ]

Current calculator doesn't do it' job quite correct. First of all the
max310x baud-rates generator supports the divisor being less than 16.
In this case the x2/x4 modes can be used to double or quadruple
the reference frequency. But the current baud-rate setter function
just filters all these modes out by the first condition and setups
these modes only if there is a clocks-baud division remainder. The former
doesn't seem right at all, since enabling the x2/x4 modes causes the line
noise tolerance reduction and should be only used as a last resort to
enable a requested too high baud-rate.

Finally the fraction is supposed to be calculated from D = Fref/(c*baud)
formulae, but not from D % 16, which causes the precision loss. So to speak
the current baud-rate calculator code works well only if the baud perfectly
fits to the uart reference input frequency.

Lets fix the calculator by implementing the algo fully compliant with
the fractional baud-rate generator described in the datasheet:
D = Fref / (c*baud), where c={16,8,4} is the x1/x2/x4 rate mode
respectively, Fref - reference input frequency. The divisor fraction is
calculated from the same formulae, but making sure it is found with a
resolution of 0.0625 (four bits).

Signed-off-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tty: max310x: Fix external crystal register setup</title>
<updated>2019-06-11T10:22:42+00:00</updated>
<author>
<name>Joe Burmeister</name>
<email>joe.burmeister@devtank.co.uk</email>
</author>
<published>2019-05-13T10:23:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=97fb8dbf36780eb27dfbbfe107c8e0860ca3282d'/>
<id>urn:sha1:97fb8dbf36780eb27dfbbfe107c8e0860ca3282d</id>
<content type='text'>
commit 5d24f455c182d5116dd5db8e1dc501115ecc9c2c upstream.

The datasheet states:

  Bit 4: ClockEnSet the ClockEn bit high to enable an external clocking
(crystal or clock generator at XIN). Set the ClockEn bit to 0 to disable
clocking
  Bit 1: CrystalEnSet the CrystalEn bit high to enable the crystal
oscillator. When using an external clock source at XIN, CrystalEn must
be set low.

The bit 4, MAX310X_CLKSRC_EXTCLK_BIT, should be set and was not.

This was required to make the MAX3107 with an external crystal on our
board able to send or receive data.

Signed-off-by: Joe Burmeister &lt;joe.burmeister@devtank.co.uk&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>serial: max310x: Fix to avoid potential NULL pointer dereference</title>
<updated>2019-04-03T04:24:18+00:00</updated>
<author>
<name>Aditya Pakki</name>
<email>pakki001@umn.edu</email>
</author>
<published>2019-03-18T23:44:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=110ee901b3e1cca327687254577f5dd6a5efc00d'/>
<id>urn:sha1:110ee901b3e1cca327687254577f5dd6a5efc00d</id>
<content type='text'>
commit 3a10e3dd52e80b9a97a3346020024d17b2c272d6 upstream.

of_match_device can return a NULL pointer when matching device is not
found. This patch avoids a scenario causing NULL pointer derefernce.

Signed-off-by: Aditya Pakki &lt;pakki001@umn.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>serial: max310x: Set IRQF_TRIGGER_FALLING flag when dev.of_node is not NULL</title>
<updated>2016-09-15T10:35:49+00:00</updated>
<author>
<name>Liu Xiang</name>
<email>liuxiang_1999@126.com</email>
</author>
<published>2016-09-07T14:05:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c164b008b62720fda072b55c378d32da3260f271'/>
<id>urn:sha1:c164b008b62720fda072b55c378d32da3260f271</id>
<content type='text'>
When dev.of_node is not NULL, we also need to set IRQF_TRIGGER_FALLING
flag, otherwise it may cause uncertain interrupts.

Signed-off-by: Liu Xiang &lt;liu.xiang6@zte.com.cn&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Assign port line automatically</title>
<updated>2016-06-25T20:55:35+00:00</updated>
<author>
<name>Alexander Shiyan</name>
<email>shc_work@mail.ru</email>
</author>
<published>2016-06-07T15:59:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=78adccac1ff9f485ccf427f337982799ce68738e'/>
<id>urn:sha1:78adccac1ff9f485ccf427f337982799ce68738e</id>
<content type='text'>
This patch makes assignment of port line automatically,
so now user allow to use several MAX310X chips.

Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Unregister UARTs on error</title>
<updated>2016-06-25T20:55:35+00:00</updated>
<author>
<name>Alexander Shiyan</name>
<email>shc_work@mail.ru</email>
</author>
<published>2016-06-07T15:59:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c8246fefe2c995e128345614fb98b5ed5014318b'/>
<id>urn:sha1:c8246fefe2c995e128345614fb98b5ed5014318b</id>
<content type='text'>
Add uart_remove_one_port() for error path.

Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Remove duplicate bits definition</title>
<updated>2016-06-25T20:55:35+00:00</updated>
<author>
<name>Alexander Shiyan</name>
<email>shc_work@mail.ru</email>
</author>
<published>2016-06-07T15:59:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e940e817a701dcaf0d218571c251af0cb6d1bbfb'/>
<id>urn:sha1:e940e817a701dcaf0d218571c251af0cb6d1bbfb</id>
<content type='text'>
Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: max310x: Register UART driver at module_init</title>
<updated>2016-06-25T20:55:35+00:00</updated>
<author>
<name>Alexander Shiyan</name>
<email>shc_work@mail.ru</email>
</author>
<published>2016-06-07T15:59:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6286767ad3afc886ec6473409aa02191cb54f97b'/>
<id>urn:sha1:6286767ad3afc886ec6473409aa02191cb54f97b</id>
<content type='text'>
This patch moves UART registration at module_init initcall,
so this should helps to add multiple chip support in the future.

Signed-off-by: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
