From nobody Wed Nov 13 21:26:53 2024 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xpbvh0ZFJz5cc50 for ; Wed, 13 Nov 2024 21:26:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xpbvg6Zd5z4RX5 for ; Wed, 13 Nov 2024 21:26:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731533215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v5SlX0Tx2/eksp/YQkU2JCqCgb08hjnN2ZU9jBI3lMc=; b=s2J0C+hl5OS3xmO3N5N7W+wK42thyMQb4sV0CXsUIEVzbw1UIM6NtuTROUBHZuAlbz4drh PoDL8AxyCJBuDEQakhHQDgwkLvEOQ9q0tvQgYjk+Kv7/hQePg6zs+TQMjkFULSk8TTd9Oc iuBwSPggg9fHEVRYnhcl1c6QiYQJ6A7UkDJqGRIryxk3O/TccDMJ0Zu5XiWuO94Qir4O7S kqAY3FZSkl6NTmdawT/vz118wJm2gu4U1fr1rT8AC8pvcyJU7em5O6Y+3uT4WlQtzvXLPn JMLJeLdOj+AJSYZWGju5ylxjet1f96f4E2f1xyh5vS5frRCrDJtw3kxSvgQAeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731533215; a=rsa-sha256; cv=none; b=FHc/l1wIpXJ7gSdY08Py0xeBAOdWlsGhKviWBZCjJwjWUUCfNjmLZCZwbFih8YZ750lEDM AKWlHpZ8hmHMM/tKEDS1ec/5xtBVm05agLXI7bIleI4K02V5phGbCFkXJ+Yy3kJbghMUkB DmlpkdxcENaiztnQe72YHX/nPKhO7q7qbGKouNQnn3MsuekY6ZRSZBP0EbVrM49Hnufiny 9qoxQjUJTBfnKDhL2Aaoa0denNCbrv9/P7sALnMo1eF79oz5PrM25eFqqkWG8lH3aFt86T ZElH8s/oeLtFLp5qTyvXRAVa5w34KZ6ZkATZSMDZtcRoU9wInbWxphUydyEOWg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xpbvg6BXGz19vC for ; Wed, 13 Nov 2024 21:26:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4ADLQtab055418 for ; Wed, 13 Nov 2024 21:26:55 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4ADLQtHX055417 for net@FreeBSD.org; Wed, 13 Nov 2024 21:26:55 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 252165] usb network and mii bus media status race condition Date: Wed, 13 Nov 2024 21:26:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: ali.abdallah@suse.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252165 --- Comment #38 from Ali Abdallah --- (In reply to Ali Abdallah from comment #37) The patch in comment 37 could be a bit optimized, yes!=20 The usb process/request code is completely broken when it comes to different threads sharing ue_lock (ioctl versus uether tick), the usb request code releases the acquired lock, making ioctl thread waiting for the same lock t= o be scheduled for execution, lovely! To be more precise. ioctly waiting for ue_lock, which is acquired by ue_tick, but then the tick code will call at some point usbd_do_request_flags, which will release the = lock at the beginning (and then acquire it later), but in the meantime we have o= ur "cute" ioctl thread waken-up only to report wrong media_status value! --=20 You are receiving this mail because: You are the assignee for the bug.=