Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp173628pxb; Thu, 21 Jan 2021 04:29:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOIeIbUvhEigOXPrmr8vwRCBoHQs/bZCi6HCNiNc/3mmJd8HGYs1gK7d92xpmyRAownfl4 X-Received: by 2002:a17:906:f895:: with SMTP id lg21mr9269732ejb.321.1611232160926; Thu, 21 Jan 2021 04:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611232160; cv=none; d=google.com; s=arc-20160816; b=Le9mL93LPsGJ7ukeHN991zUIWheAeuPuMw/YpI8gGSRFOWVBxc36WDX9upour3vnVV F9noaFD/AcdTHKE7fM5Wf6wH7x/BWlFIB8mcpSEgz4Qj2hNWCT6HUDqs8Q3JlX3g5kJR Ru/T969wndVKCPBSaLl8QOtoHiXjoFDFluMXFRu9eO1ZHD/r5VRbZLDKvUn77iHEtZeG Md5XXoIjHCQX+GeLYkypnhAIeX6rFj+3exq0kmoJRWQjbIyI5Zvy7PVcQ7j8c7/xT+lZ txglSnKMhQofcP21BDhFUYgj9yUUNXfyPk9vamZdVdaJvPHxBd1tMqof+l981cxGe6z8 lyZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=K8iaIv9uCkS+obRb55L6u6FHSYm9xqTMRvduQi5Odh0=; b=jGrFk/w9pBw14/qnjX+udVSEqD4dlWxedKVVyexpanOjVHdKkcFe2hJsBv6itxkRII T+EWUBr3PvH7o22mmjpwPalw3xN0T0mMtILpkb9+MkkttNbf9VqyEo0fxI85wziaC7kQ L3009vJydwbhfWPpOGbrAxQCBOe6iRPdZXRkQvTDkuYbXlZuOJk6Y5Rjiomwomq1U42K +w8xNGkmvKXBxNyiOJwJyOtaSf1ilWHcEzijJ5HJys+b6Ryho20M0BnBdfXlwhUyiOBu zFUPTrDZVVGZK33vfpWoRbaMH3xbv6Q2XYDJPPV1NE/bj/kP6V4DXGkb3i2KG7qr13xG NRIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si2134845ede.504.2021.01.21.04.28.54; Thu, 21 Jan 2021 04:29:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730954AbhAUM0D (ORCPT + 99 others); Thu, 21 Jan 2021 07:26:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729886AbhAUMZF (ORCPT ); Thu, 21 Jan 2021 07:25:05 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECAA3C061757 for ; Thu, 21 Jan 2021 04:24:24 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1l2Z0f-009X7F-N8; Thu, 21 Jan 2021 13:24:21 +0100 Message-ID: <9406a5833f2bd6a15bf314717b7ac21952f11f24.camel@sipsolutions.net> Subject: Re: [PATCH 0/4] Updates for rfkill From: Johannes Berg To: Markus Theil Cc: linux-wireless@vger.kernel.org Date: Thu, 21 Jan 2021 13:24:20 +0100 In-Reply-To: <20210116125146.31932-1-markus.theil@tu-ilmenau.de> References: <20210116125146.31932-1-markus.theil@tu-ilmenau.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Markus, Thanks for the patches! I separately committed a fix for the buffering=0 issue, just so it's separate and not part of the other changes. > rfkill.py: migrate to python3 Applied, but I made some cleanups. > rfkill: update rfkill.h > rfkill: support hard block reason in python code > rfkill: support hard block reason in C code This is broken, unfortunately. Updating rfkill.h as is causes issues because we read more data than we are willing to accept, which you've fixed up in the support for hard block reasons patch. Seems that should partially be in the original patch - e.g. checking "size >= V1" instead of "size == V1". Additionally, the hard block reasons in C patch is wrong because if the read was short, the field is not initialized. Need to clear the event to zeroes before reading it, or at least at the beginnning (I guess we can assume the kernel will not change size between two reads). The python patch I applied with some fixups. johannes