Summary:
- I thought this cs is needed to avoid data corruption
- For example, while executing uart_xmitchar() in the interrupt
handler on CPU0, an application running on CPU1 can call
uart_putxmitchar() via write()->uart_write().
- In this case, taking xmit.sem in uart_write() will wait for CPU0
to finish uart_xmitchar() because CPU0 has already taken a cs
in uart_xmitchar() then nxsem_wait() on CPU0 takes a new cs
inside (and release the cs when returning but it's OK)
- Then uart_write() on CPU1 disables UART TX, so uart_xmitchar()
on CPU0 will not be called while executing uart_write() on CPU1.
- So this critical section in uart_putxmitchar() can be removed.
Impact:
- None
Testing:
- Tested with spresense:wifi_smp, esp32-devkitc:smp
Reported-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- This commit converts data to the physical address for DMA transfer.
Impact:
- cxd56.c only
Testing
- Tested with nxplayer and nxrecorder
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
The patch is related to: commit 5f7c98b6e1
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Mon May 17 22:38:22 2021 +0800
drivers/syslog: Remove emergstream implementation and caller
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
by ramlog_initbuf();
Algorithm: Scan the entire ramlog buffer, the position of the head
is the first byte is not empty and second byte is empty. The position
of the tail is the first byte is empty and second byte is not empty.
Change-Id: Ieb9161bd670481cd335e9a901287cd5e589f0849
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Summary:
- During Wi-Fi stress test, sometimes ASSERT() happens in gs2200m.c
- This commit removes the ASSERT() but calls _remove_all_pkt()
for a workaround.
Impact:
- None
Testing:
- Tested with spresense:wifi_smp
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
When creating the next chain of directory entries, (1) add the position
of next entry to the current sector, and then (2) update the sector of
next entry. If the power is turned off between (1) and (2), the next
entry will not be found, and the chain of directory entries will break.
It causes the SmartFS file system corruption, and we will not be able
to add files.
To avoid this issue, in checking the filesystem by smart_fsck_directory,
if the sector of next entry does not exist, update the sector of
directory entry to invalidate the field of next entry.
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
specified the name of remote proc(rpmsg server)
Change-Id: I0086bb43727a2bbb5e68f88907b5e4608182ef9c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
N/A
specified the name of remote proc(rpmsg server)
Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
since the console is normally opened three time as stdin, stdout and
stderr and remove the dependence on STANDARD_SERIAL because other type
of serial drivers also support the poll through the same codebase.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie68322c4647cc838b295491329969869d6ba310b
This is addressing an issue where Rx interrupts were not restored for
cdcacm after the buffer had been filled (in a burst).
The Rx interrupts were only restored after the watchdog timeout of 200ms
fired.
This happened because CONFIG_SERIAL_RXDMA was set, however, for the
cdcacm driver this does not actually matter as it is relying on
uart_enablerxint to be called via the ops table.
This patch makes sure that uart_enablerxint and uart_disablerxint are
always called, independent of CONFIG_SERIAL_RXDMA, relying on the ops
table to be correct for the case where it should be only a no-op.
Summary:
- When sending an AT command during receiving a bulk packet,
the bulk packet might be put in the AT command response.
- To handle such the case, gs2200m_send_cmd2() is newly
introduced instead of using gs2200m_send_cmd(dev, cmd, NULL)
Impact:
- All use cases that send an AT command in gs2200m.c
Testing:
- Tested with renew and nxplayer with spresense:wifi
Reported-by: Masatoshi Ueno <Masatoshi.Ueno@sony.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Removes the family identifier from the device configuration, since the device
family is already part of the rom code and the underlying logic does know how
to extract this information.
include/nuttx/1wire drivers/sensors
stm32f103-minimim
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
The following changes where added.
- Removes dependency to slave structure. Selecting a device on the bus only
requires the unique romcode.
- Make search operation mutual exclusive on the bus. This is necessary to
prevent another driver instance from making a transition on the bus at
the same time.
- Skip also rom when only 1 slave is expected on the bus. Physical
connected devuce should be indicated by the maxslave paramter during
initializing, not the reigstered slaves.
- Fixes some compiler warnings in existing ds28e17 driver.
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
Summary:
- When receiving a UDP packet partially, the rest of the packet
must be discarded.
Impact:
- None
Testing:
- Tested with a UDP sample program
Reported-by: Masatoshi Ueno <Masatoshi.Ueno@sony.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Ken Pettit has submitted the ICLA and we can migrate the licenses
to Apache.
Sebastien Lorquet has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This adds a sensor driver for the hyt271, hyt221, and hyt939 sensor module from
vendor iST (Innovative Sensor Technology). This sensor type is connected via i2c
bus and allows the measurement of relative humidity and temperature.
Each driver instance supports two different character device for each type
(/dev/sensor/tempX and /dev/sensor/humiX).
This driver also supports changing the i2c address of one connected sensor on
the bus. This requires a callback to the platform-specific board logic which
must ensure a power-on reset.
Optional the driver allows setting up a read interval for fetching sensor data.
This is done by a worker thread and can be useful when watching several sensors
via poll() by the userspace application.
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
MIRTOS4BES-22
since -ENOTTY is an expected code to indicate IOCTL isn't supported
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I62cf58c514be696327ad769ab2f35099154bcb42
Marco Krahl has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt, S.A has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This change makes it so that the timeout is set as part of the SDIO_WAITENABLE call instead of the SDIO_EVENTWAIT call. By doing so, you eliminate all opportunity for a race condition.
stm32h7:sdmmc Check if busy ended early
Ales Verbic has submitted the ICLA and we can migrate the licenses
to Apache.
Uros Platise has submitted the ICLA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Several licenses were missed in the initial work
David Sidrane has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Laurent Latil has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Matous Pokorny has submitted the ICLA and we can migrate the licenses
to Apache.
DataVision s.r.o. has submitted the SGA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Pierre-Noel Bouteville has submitted the ICLA and we can migrate the licenses
to Apache.
David Sidrane has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Uros Platise has submitted the ICLA and we can migrate the licenses
to Apache.
David Sidrane has submitted the ICLA and we can migrate the licenses
to Apache.
Bob Feretich has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
DS Automotion GmbH has submitted the SGA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Robert A. Feretich has submitted the ICLA and we can migrate the licenses
to Apache.
RAF Research LLC has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Michael Jung has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Matias Nitsche has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Mateusz Tomasz Szafoni has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Abdelatif Guettouche has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Sebastien Lorquet has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Alan Carvalho de Assis has submitted the ICLA and we can migrate the licenses
to Apache.
Uniquix Ltda. has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Several files were missed in the past
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Previous fix to RNDIS response queueing caused unaligned access
to response buffer in some configurations. On ARM Cortex-M, this
would cause hardfault if optimizer used strd instruction.
Fix by allocating the buffer as uint32_t. RNDIS messages are always
a multiple of 4 bytes in size, so this ensures alignment.
Gracefully handle output queue full conditions. This shouldn't happen
in practice as the host is supposed to limit the number of commands
simultaneously in execution.
Reset the response queue on RNDIS_RESET_MSG. This way communication
can recover even if host and device get out of sync.
Sometimes Windows would send RNDIS_KEEPALIVE_MSG and RNDIS_QUERY_MSG close
to each other. This would cause the latter command to overwrite the reply for
the prior command. This in turn will cause Windows to drop the connection after
a 20 second timeout.
Easy way to reproduce the issue is to open the Windows "Adapter Status" dialog that
shows the realtime TX/RX byte counts. This causes multiple RNDIS_QUERY_MSGs per
second, and the connection will drop in less than an hour.
This commit fixes this issue, and other potential race conditions (such as USB
descriptor read in middle on RNDIS query) by using a separate queue for the reply
packets.
David Sidrane has submitted the ICL and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
David S. Alessio has submitted the ICL and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Sebastien Lorquet has submitted the ICL and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
drivers/sensors/qencoder.c:
* qe_close(): Call to sninfo() contained extraneous "%d"
format specifier. Removing it, as it appears there was
never a matching argument.
Because buflen is size_t (unsigned) and nsent is ssize_t (signed)
of the same size, (buflen - nsent) results in unsigned and
overflows if nsent > buflen.
This happens when sending CAN FD frame with DLC > 8 and a user
gets the buflen parameter as a result of CAN_MSGLEN(len)
where `len' is the size of data which is less then a size
for some extended DLC (e.g. 26 bytes is sent in a message with
DLC 0xD, which has 32 bytes of data).
The correct buflen value should be rather
CAN_MSGLEN(can_dlc2bytes(can_bytes2dlc(len)))
Signed-off-by: Jaroslav Beran <jara.beran@gmail.com>
Alan Carvalho de Assis has submitted the SGA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
mmcsd:Remove CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
stm32h7:sdmmc remove CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
stm32f7:sdmmc remove CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
stm32f7:sdmmc WRITE COMPLETE prevent false triggers
stm32h7:sdmmc WRITE COMPLETE prevent false triggers
While testing PR #2989 on the H7 I noticed that the cards
were staying in 1-bit mode. The root cause was that the
scr read path was using DMA without an invlidate.
This was caused by CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT,
but the sdmmc driver, did not use the delayed invalidate
nor would it work on 8 bytes.
The driver fully supported dcache mgt on runt buffers, but
the #ifdef CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT blocked it.
Reviewing the PR that added CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT
it may have been valid at the time. But after the dcache operations
we fixed. It is not necessary and offers no benefit.
serial/serial_dma.c: In function ‘uart_recvchars_done’:
serial/serial_dma.c:407:7: warning: implicit declaration of function ‘nxsig_kill’ [-Wimplicit-function-declaration]
407 | nxsig_kill(dev->pid, signo);
| ^~~~~~~~~~
Change-Id: I9e1c0341ecce3033889d11fff9ec2b9e3dfe303b
user should select the default action by self:
warning: (TTY_SIGINT) selects SIG_SIGKILL_ACTION which has unmet direct dependencies (SIG_DEFAULT)
Change-Id: Ied9899d18156742ce4998b40d53a481262dcd84a
Signed-off-by: ligd <liguiding1@xiaomi.com>
Reason:
nx_start use syslog at every early time event the idle thread not
full setup, then syslog_rpmsg -> work_queue -> work_signal ->
nxsig_kill -> rtcb is NULL -> crash
Fix:
sched work_queue after is_rpmsg_ept_ready() is true
Change-Id: I225469ff2526e4b810bf3e23473b55d57e64a1ff
Signed-off-by: ligd <liguiding1@xiaomi.com>
since sometime platform code need do some special action during memcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id108ef4232376feab3e37e9b3aee9a7927a03bd4
and remove the reference of CONFIG_ARCH_HAVE_PROGMEM from code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I89a73f138d54718ee8bc9345958675d7a2a34ba8
This change reflects that the geometry isn't related to the largest
allocatable unit on the platform.
Calls to read and write block devices are also affected and have
been updated.
Summary:
- This commit introduces a driver-specific spinlock to cxd56.c
to improve performance in SMP mode.
Impact:
- cxd56.c in SMP mode only
Testing:
- Tested with nxplayer and nxrecorder with the following configs
- spresense:wifi, spresense:wifi_smp
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- This commit changes spinlock APIs (spin_lock_irqsave/spin_unlock_irqrestore)
- In the previous implementation, the global spinlock (i.e. g_irq_spin) was used.
- This commit allows to use caller specific spinlock but also supports to use
g_irq_spin for backword compatibility (In this case, NULL must be specified)
Impact:
- None
Testing:
- Tested with the following configurations
- spresnse:wifi, spresense:wifi_smp
- esp32-devkitc:smp (QEMU), sabre6-quad:smp (QEMU)
- maxi-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- During Wi-Fi stress test, I noticed that ASSERT() happened
in gs2200m_hal_write(). Actually, this happens in 20-40 hours.
- In this case, resp[1] was always 0x0 which is not defined
in the spec.
- In the previous implementation, retry was only done in case of
WR_RESP_NOK. (0x13)
- This commit changes this condition and it reties in case of
0x0 as well
Impact:
- gs2200m driver
Testing:
- Tested with spresense:wifi_smp and stm32f4discovery:wifi
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
The ifstate is already set in
enc_ifup -> enc_reset -> enc_linkstatus
The ifstate after this call is either ENCSTATE_RUNNING or ENCSTATE_UP
If ifstate is ENCSTATE_RUNNING, it would be wrong to set it to ENCSTATE_UP;
this would lead to enc_txavail never invoking the driver callback, causing
very long latencies in sending.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Summary:
- During reviewing the GS2200M document, I noticed that
_read_data() implementation is incorrect.
- Actually, we do not use "SPI Byte Stuffing for SPI-NO-DMA"
but use "SPI Command Response (SPI-DMA)", so the sequence
should use SPI_RECVBLOCK().
Impact:
- gs2200m.c only
Testing:
- Tested with stm32f4discovery:wifi and spresense:wifi_smp
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- I noticed that some error messages are printed with wlinfo()
- This commit prints such error messages with wlerr()
Impact:
- No impact
Testing:
- Tested with spresense:wifi
- NOTE: CONFIG_DEBUG_WIRELESS_ERROR must be enabled
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- During stress test with spresense:wifi (non-SMP), I noticed
sometimes ASSERT() happened in _read_data_len()
- Actually, up_udelay(50) has been added to avoid the ASSERT
- However, I finally noticed that it should be moved before
calling dready()
- Also, I cofirmed that we can reduced the time from 50 to 30
- NOTE: we need at least 15us in my experience
Impact:
- gs2200m.c only
Testing:
- Tested with following configurations
- spresense:wifi, spresense:wifi_smp, stm32f4discovery:wifi
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Squashed commits:
Fix small typos on efuse driver
Fix nxstyle issues
Fix aligment and missing FAR
Improvements to efuse driver
Fix: don't free 'lower' on efuse_unregister
Describe the efuse_param
Remove upper pointer from lowerhalt
Fix blank line at end of function
Co-authored-by: saramonteiro <saramonteirosouza44@gmail.com>
Co-authored-by: Xiang Xiao <xiaoxiang@xiaomi.com>
these functions are the implementation detail and then
don't need expose to external
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ief832391d5b42d1f1645907eb465631650490234
let's replace the content of file in place instead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I538910d55815c7aec656c05dba4eab2fa1d6d964
so pty don't need call nx_pipe and then file_detach
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ibb8d108abd76bafe53897e5fca35babcf3e1bae9
"event & POLLOUT"(not "event | POLLOUT") should be used to check POLLOUT is set
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I09af7669a1c8ee46118b904d2c5946ecb99e6215