lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2026

  • 1 participants
  • 347 discussions
[S] Change in osmo-ttcn3-hacks[master]: C5G: Release UE Context before sending Service request
by pespin 29 May '26

29 May '26
Attention is currently required from: fixeria, jolly. pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42775?usp=email ) Change subject: C5G: Release UE Context before sending Service request ...................................................................... Patch Set 2: (1 comment) Patchset: PS2: > I got a race condition, if I call f_ngap_obtain_amf_id() after f_service_request_cm_idle() without s […] I think you need to call it after the NGAP.receive. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42775?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If6fae56487aebd810c51cbab170d95d5dec7e138 Gerrit-Change-Number: 42775 Gerrit-PatchSet: 2 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 29 May 2026 20:58:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: osmo-smdpp.py: use commonpath in transversal check
by Hoernchen 29 May '26

29 May '26
Attention is currently required from: dexter, laforge, neels, osmith. Hoernchen has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/42625?usp=email ) Change subject: osmo-smdpp.py: use commonpath in transversal check ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42625?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I7a42b40aa2bbcd5f0ec99f172503354c6eaa9828 Gerrit-Change-Number: 42625 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 29 May 2026 14:58:03 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: C5G: Release UE Context before sending Service request
by jolly 29 May '26

29 May '26
Attention is currently required from: fixeria, pespin. jolly has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42775?usp=email ) Change subject: C5G: Release UE Context before sending Service request ...................................................................... Patch Set 2: (1 comment) Patchset: PS2: > Can you explain why you're adding even more `f_sleep()` calls? I got a race condition, if I call f_ngap_obtain_amf_id() after f_service_request_cm_idle() without some delay. The AMF ID value will not be set. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42775?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If6fae56487aebd810c51cbab170d95d5dec7e138 Gerrit-Change-Number: 42775 Gerrit-PatchSet: 2 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 29 May 2026 08:59:58 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: tcap loadshare: Rework initial selection of a node
by pespin 28 May '26

28 May '26
Attention is currently required from: lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42755?usp=email ) Change subject: tcap loadshare: Rework initial selection of a node ...................................................................... Patch Set 3: (1 comment) File src/tcap_as_loadshare.c: https://gerrit.osmocom.org/c/libosmo-sigtran/+/42755/comment/d7edab11_8c24a… : PS3, Line 525: asp = select_asp_tcap_enabled_rr(as); > No, it isn't used anymore when using begin. Then I fail to see where it's used nor its actual use :) -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42755?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I151e6acb59e1f3c481487e76d2b01236fcee755f Gerrit-Change-Number: 42755 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Thu, 28 May 2026 20:26:04 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: C5G: Release UE Context before sending Service request
by fixeria 28 May '26

28 May '26
Attention is currently required from: jolly, pespin. fixeria has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42775?usp=email ) Change subject: C5G: Release UE Context before sending Service request ...................................................................... Patch Set 2: (1 comment) Patchset: PS2: Can you explain why you're adding even more `f_sleep()` calls? -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42775?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If6fae56487aebd810c51cbab170d95d5dec7e138 Gerrit-Change-Number: 42775 Gerrit-PatchSet: 2 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 May 2026 19:05:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: NGAP: Add UESecurityCapabilities IE to PathSwitchRequestAcknowledge
by fixeria 28 May '26

28 May '26
Attention is currently required from: jolly. fixeria has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42774?usp=email ) Change subject: NGAP: Add UESecurityCapabilities IE to PathSwitchRequestAcknowledge ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42774?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic46f201db3dcf84a7d62fb1cd17c839ef540e8bb Gerrit-Change-Number: 42774 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Thu, 28 May 2026 19:03:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access
by Jenkins Builder 28 May '26

28 May '26
Jenkins Builder has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email ) Change subject: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access ...................................................................... Patch Set 1: (2 comments) File ccid_host/libosmo_emb.h: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784/comment/27f1b7ef_1a… : PS1, Line 9: typedef struct { do not add new typedefs File sysmoOCTSIM/libosmo_emb.h: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784/comment/3b8f2aa2_af… : PS1, Line 19: typedef struct { do not add new typedefs -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb Gerrit-Change-Number: 42784 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 28 May 2026 16:41:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: usb: properly handle data toggle bit
by Hoernchen 28 May '26

28 May '26
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42782?usp=email ) Change subject: usb: properly handle data toggle bit ...................................................................... usb: properly handle data toggle bit Same config SetConfig is currently not properly handled and stale toggle bits lead to weird transfers until USB resyncs because the asf4 code itself does not properly handle the toggle bit. - USB 2.0 §9.4.5 states that ClearFeature(ENDPOINT_HALT) unconditionally resets the data toggle to DATA0 - USB 2.0 §9.1.1.5 demands toggle reset even when the same config/interface is selected The old code was only doing a proper reset upon receiving a bus reset, but the actual state reset path outlined in the spec is the set config command. The easy fix here is to split the existing reset code which already does everything we need into two parts for the actual usb reset and SetConfig. The current halt clear code only resets DTGL if the endpoint is actually halted and a fix is a bit more complicated. _usb_d_dev_ep_stall_clr() is also called from the SETUP-packet cleanup path in hal_usb_device.c _usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR); _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_CLR); This runs on every SETUP packet as defensive cleanup of any leftover stall from a previous failed transfer. That might be why the asf4 usb code is wrong, because a toggle reset here breaks SETUP. So the unconditional DTGL reset for halt clearing must therefore happen in _usb_d_ep_halt_clr itself, which is only reached via the ClearFeature host request (usbdc_clear_ftr_req -> usb_d_ep_halt(HALT_CLR)), using a small HPL helper function. Closes:OS#7016 Change-Id: I5dbca9bd2212407108b44815ecf566fc9c22336d --- M sysmoOCTSIM/hal/include/hpl_usb_device.h M sysmoOCTSIM/hal/src/hal_usb_device.c M sysmoOCTSIM/hpl/usb/hpl_usb.c M sysmoOCTSIM/usb/device/usbdc.c 4 files changed, 77 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/82/42782/1 diff --git a/sysmoOCTSIM/hal/include/hpl_usb_device.h b/sysmoOCTSIM/hal/include/hpl_usb_device.h index 43dd17f..b174abb 100644 --- a/sysmoOCTSIM/hal/include/hpl_usb_device.h +++ b/sysmoOCTSIM/hal/include/hpl_usb_device.h @@ -324,6 +324,17 @@ int32_t _usb_d_dev_ep_stall(const uint8_t ep, const enum usb_ep_stall_ctrl ctrl); /** + * \brief Set USB device endpoint data toggle (DTGL) to DATA0 or DATA1 + * \param[in] ep Endpoint address (with direction bit). + * \param[in] tgl 0 = DATA0, non-zero = DATA1. + * \return 0 on success, negative on error. + * + * USB 2.0 §9.4.5: ClearFeature(ENDPOINT_HALT) MUST unconditionally + * reinitialize the data toggle to DATA0. + */ +int32_t _usb_d_dev_ep_set_toggle(const uint8_t ep, uint8_t tgl); + +/** * \brief Read setup request data from specific endpoint * \param[in] ep Endpoint address. * \param[out] req_buf Pointer to buffer to locate the setup packet. diff --git a/sysmoOCTSIM/hal/src/hal_usb_device.c b/sysmoOCTSIM/hal/src/hal_usb_device.c index aa80ede..a9a22f0 100644 --- a/sysmoOCTSIM/hal/src/hal_usb_device.c +++ b/sysmoOCTSIM/hal/src/hal_usb_device.c @@ -536,6 +536,12 @@ if (ep_index < 0) { return -USB_ERR_PARAM; } + /* USB 2.0 §9.4.5: ClearFeature(ENDPOINT_HALT) MUST reset data toggle. + * This is the only caller that comes from host ClearFeature; + * SETUP-cleanup path in usb_d_cb_trans_setup() which also + * calls _usb_d_dev_ep_stall(STALL_CLR) must NOT touch DTGL */ + _usb_d_dev_ep_set_toggle(ep, 0); + if (_usb_d_dev_ep_stall(ep, USB_EP_STALL_GET)) { rc = _usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR); if (rc < 0) { diff --git a/sysmoOCTSIM/hpl/usb/hpl_usb.c b/sysmoOCTSIM/hpl/usb/hpl_usb.c index ed9ef62..d743bf6 100644 --- a/sysmoOCTSIM/hpl/usb/hpl_usb.c +++ b/sysmoOCTSIM/hpl/usb/hpl_usb.c @@ -1734,6 +1734,16 @@ /* By default, IN endpoint will NAK all token. */ _usbd_ep_set_in_rdy(epn, 1, false); _usbd_ep_clear_bank_status(epn, 1); + /* USB 2.0 §9.4.5: Halt feature reset after SetConfiguration() or SetInterface() + * Bus reset already clears STALLRQ in HW but same-config SetConfiguration + * does not trigger a bus reset, so clear in software. */ + _usbd_ep_set_stall(epn, 1, false); + /* USB 2.0 §9.1.1.5 / §5.8.5: data toggle must start at DATA0 + * when the endpoint is configured by SetConfiguration / + * SetInterface. SAM D5x/E5x DS60001507 §38.6.2.4 and §38.6.2.2 list + * what the hardware clears on bus reset and on endpoint + * disable, EPSTATUS.DTGLIN/OUT are NOT in either list, so we must do it. */ + _usbd_ep_set_toggle(epn, 1, 0); } else { /* prevents init->enable->disable->enable again from working without reinit...*/ @@ -1749,6 +1759,10 @@ /* By default, OUT endpoint will NAK all token. */ _usbd_ep_set_out_rdy(epn, 0, false); _usbd_ep_clear_bank_status(epn, 0); + /* USB 2.0 §9.4.5: Halt feature reset by every SetConfig / SetInterface */ + _usbd_ep_set_stall(epn, 0, false); + /* USB 2.0 §9.1.1.5 / §5.8.5: data toggle must start at DATA0 when the endpoint is configured. */ + _usbd_ep_set_toggle(epn, 0, 0); } return USB_OK; @@ -1807,6 +1821,7 @@ { uint8_t epn = USB_EP_GET_N(ept->ep); bool is_stalled = _usbd_ep_is_stalled(epn, dir); + if (!is_stalled) { return ERR_NONE; } @@ -1814,6 +1829,13 @@ _usbd_ep_int_dis(epn, USB_DEVICE_EPINTFLAG_STALL0 << dir); if (_usbd_ep_is_stall_sent(epn, dir)) { _usbd_ep_ack_stall(epn, dir); + /* USB 2.0 §9.4.5: ClearFeature(ENDPOINT_HALT) "always results + * in the data toggle being reinitialized to DATA0". Only on + * actual stall clear -- this function is also called from the + * routine SETUP-packet cleanup in hal_usb_device.c, where + * clearing the toggle would break in-flight control transfer + * sequencing. Session-state DTGL reset is handled separately + * in _usb_d_dev_ep_enable. */ _usbd_ep_set_toggle(epn, dir, 0); } if (_usb_d_dev_ep_is_ctrl(ept)) { @@ -1847,6 +1869,18 @@ return rc; } +int32_t _usb_d_dev_ep_set_toggle(const uint8_t ep, uint8_t tgl) +{ + uint8_t epn = USB_EP_GET_N(ep); + bool dir = USB_EP_GET_DIR(ep); + + if (epn > CONF_USB_D_MAX_EP_N) { + return -USB_ERR_PARAM; + } + _usbd_ep_set_toggle(epn, dir, tgl); + return ERR_NONE; +} + /** * \brief Finish the transaction and invoke callback * \param[in, out] ept Pointer to endpoint information. diff --git a/sysmoOCTSIM/usb/device/usbdc.c b/sysmoOCTSIM/usb/device/usbdc.c index 38aa0e0..a02cf92 100644 --- a/sysmoOCTSIM/usb/device/usbdc.c +++ b/sysmoOCTSIM/usb/device/usbdc.c @@ -448,13 +448,32 @@ } /** + * \brief soft session-state reset. + * + * Called by usbdc_unconfig and usbdc_set_config. Stops + * card-side SERCOM USARTs and freezes SysTick driven timeouts. + * The was_unconfigured_flag tells the main loop to run the other half of the cleanup/reset. + * + * This is only the "session state" half of a bus reset. + * Bus reset additionally tears down EP existence (EPCFG.EPTYPE) via + * usbdc_unconfig's USBDF_DISABLE loop, a SetConfig does not need that (and usually happens after the reset). + */ +static void usbdc_softreset(void) +{ + reset_all_stuff_irq(); + was_unconfigured_flag = true; +} + +/** * \brief Unconfig, close all interfaces */ static void usbdc_unconfig(void) { - reset_all_stuff_irq(); - was_unconfigured_flag = true; + usbdc_softreset(); + /* In addition to the soft reset, tear down per-function state: USBDF_DISABLE calls the class driver + * (e.g. ccid_df_disable -> usb_d_ep_deinit per EP), which clears EPCFG.EPTYPE etc. + * Right thing to do for for USB bus reset and for SetConfig(0), but NOT for a same-config SetConfig. */ struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head; while (NULL != func) { func->ctrl(func, USBDF_DISABLE, NULL); @@ -481,6 +500,11 @@ return true; } + /* USB 2.0 §9.1.1.5 / §9.4.5 a non-zero SetConfiguration unconditionally resets endpoint state. */ + if (usbdc.cfg_value != 0) { + usbdc_softreset(); + } + #if CONF_USBD_HS_SP if (usb_d_get_speed() == USB_SPEED_HS && usbdc.desces.hs) { cfg_desc = usb_find_cfg_desc(usbdc.desces.hs->sod, usbdc.desces.hs->eod, cfg_value); -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42782?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I5dbca9bd2212407108b44815ecf566fc9c22336d Gerrit-Change-Number: 42782 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access
by Hoernchen 28 May '26

28 May '26
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email ) Change subject: libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access ...................................................................... libosmo_emb: type-safe tearfree_u64_t wrapper for LDRD/STRD access Although types are frowned upon because memorizing all differerent flavors of void* is the usual way to get acquainted with any mature C code base some heretics decided to introduce generics in C11, which can be used to make aligned access (which guarantees tear-free/restartable 64 bit access on cortex m4) less exciting. Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb --- M ccid_common/cuart.h M ccid_host/libosmo_emb.h M sysmoOCTSIM/libosmo_emb.c M sysmoOCTSIM/libosmo_emb.h 4 files changed, 45 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/84/42784/1 diff --git a/ccid_common/cuart.h b/ccid_common/cuart.h index a53dc18..d31d2d9 100644 --- a/ccid_common/cuart.h +++ b/ccid_common/cuart.h @@ -102,7 +102,7 @@ uint32_t wtime_etu; /* deadline in jiffies (ms) for card response timeout, 0 = inactive. * Set from IRQ context, checked from main loop */ - volatile uint64_t wtime_deadline __attribute__((aligned(8))); + tearfree_u64_t wtime_deadline; /* expected number of bytes, for timeout */ uint32_t current_wtime_byte; diff --git a/ccid_host/libosmo_emb.h b/ccid_host/libosmo_emb.h index ffc0324..e811dd3 100644 --- a/ccid_host/libosmo_emb.h +++ b/ccid_host/libosmo_emb.h @@ -1,15 +1,23 @@ #pragma once -/* Host-side jiffies emulation */ +/* Host-side jiffies emulation + * On the host every access is a plain memory access; the typed wrapper exists + * only purely for type compatibility with code shared with the embedded target. */ #include <stdint.h> +#include <stdalign.h> -static inline uint64_t ldrd_u64(const volatile uint64_t *p) -{ - return *p; -} -static inline void strd_u64(volatile uint64_t *p, uint64_t v) -{ - *p = v; -} +typedef struct { + alignas(8) volatile uint64_t _v; +} tearfree_u64_t; + +static inline uint64_t _ldrd_u64(const tearfree_u64_t *p) { return p->_v; } +static inline void _strd_u64(tearfree_u64_t *p, uint64_t v) { p->_v = v; } + +#define ldrd_u64(p) _Generic((p), \ + tearfree_u64_t *: _ldrd_u64, \ + const tearfree_u64_t *: _ldrd_u64)(p) + +#define strd_u64(p, v) _Generic((p), \ + tearfree_u64_t *: _strd_u64)((p), (v)) uint64_t get_jiffies(void); diff --git a/sysmoOCTSIM/libosmo_emb.c b/sysmoOCTSIM/libosmo_emb.c index e96f88e..731268b 100644 --- a/sysmoOCTSIM/libosmo_emb.c +++ b/sysmoOCTSIM/libosmo_emb.c @@ -17,7 +17,7 @@ #include "driver_init.h" #include "libosmo_emb.h" -volatile uint64_t jiffies __attribute__((aligned(8))); +tearfree_u64_t jiffies; uint64_t get_jiffies(void) { @@ -31,7 +31,7 @@ void SysTick_Handler(void) { - jiffies++; + jiffies._v++; } int _gettimeofday(struct timeval *tv, void *tz) diff --git a/sysmoOCTSIM/libosmo_emb.h b/sysmoOCTSIM/libosmo_emb.h index 4b576c6..705982c 100644 --- a/sysmoOCTSIM/libosmo_emb.h +++ b/sysmoOCTSIM/libosmo_emb.h @@ -7,42 +7,59 @@ * * Worst-case outcome is being off by one tick (1 ms) which is irrelevant * for the timeout use-case. + * + * To enforce the alignment requirement the underlying + * uint64_t is wrapped in a struct with 8-byte + * alignment via alignas(8) + _Generic to ensure types. */ #include <stdint.h> +#include <stdalign.h> + +typedef struct { + alignas(8) volatile uint64_t _v; +} tearfree_u64_t; #if defined(__arm__) -static inline uint64_t ldrd_u64(const volatile uint64_t *p) +static inline uint64_t _ldrd_u64(const tearfree_u64_t *p) { uint32_t lo, hi; __asm__ volatile( "ldrd %0, %1, [%2]\n" : "=&r"(lo), "=&r"(hi) - : "r"(p) + : "r"(&p->_v) : "memory"); return ((uint64_t)hi << 32) | lo; } -static inline void strd_u64(volatile uint64_t *p, uint64_t v) +static inline void _strd_u64(tearfree_u64_t *p, uint64_t v) { uint32_t lo = (uint32_t)v; uint32_t hi = (uint32_t)(v >> 32); __asm__ volatile( "strd %1, %2, [%0]\n" - : : "r"(p), "r"(lo), "r"(hi) + : : "r"(&p->_v), "r"(lo), "r"(hi) : "memory"); } #else /* host */ -static inline uint64_t ldrd_u64(const volatile uint64_t *p) +static inline uint64_t _ldrd_u64(const tearfree_u64_t *p) { - return *p; + return p->_v; } -static inline void strd_u64(volatile uint64_t *p, uint64_t v) +static inline void _strd_u64(tearfree_u64_t *p, uint64_t v) { - *p = v; + p->_v = v; } #endif +/* _Generic ensures matched types or bust */ +#define ldrd_u64(p) _Generic((p), \ + tearfree_u64_t *: _ldrd_u64, \ + const tearfree_u64_t *: _ldrd_u64)(p) + +#define strd_u64(p, v) _Generic((p), \ + tearfree_u64_t *: _strd_u64)((p), (v)) + uint64_t get_jiffies(void); void store_jiffies(uint64_t j); -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42784?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I458bfaf53e27c51882c7a8c1326e51d12943b0bb Gerrit-Change-Number: 42784 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ccid-firmware[master]: ccid: ICC_MUTE instead of CMD_NOT_SUPPORTED on XfrBlock to unpowered ...
by Hoernchen 28 May '26

28 May '26
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42783?usp=email ) Change subject: ccid: ICC_MUTE instead of CMD_NOT_SUPPORTED on XfrBlock to unpowered slot ...................................................................... ccid: ICC_MUTE instead of CMD_NOT_SUPPORTED on XfrBlock to unpowered slot The command is supported, just currently impossible. Closes:OS#7015 Change-Id: I7f64475b023bd2b6fd1c4263850e56dd84d20b3e --- M ccid_common/ccid_slot_fsm.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/83/42783/1 diff --git a/ccid_common/ccid_slot_fsm.c b/ccid_common/ccid_slot_fsm.c index fae2c3b..d680994 100644 --- a/ccid_common/ccid_slot_fsm.c +++ b/ccid_common/ccid_slot_fsm.c @@ -370,7 +370,7 @@ /* might be unpowered after failed ppss that led to reset */ if (cs->icc_powered != true) - return -0; + return -CCID_ERR_ICC_MUTE; msgb_pull(msg, 10); -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42783?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: I7f64475b023bd2b6fd1c4263850e56dd84d20b3e Gerrit-Change-Number: 42783 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • ...
  • 35
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.