From patchwork Thu Sep 7 06:03:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 111860 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp359059qge; Wed, 6 Sep 2017 23:06:15 -0700 (PDT) X-Received: by 10.84.233.66 with SMTP id k2mr1752350plt.57.1504764375104; Wed, 06 Sep 2017 23:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504764375; cv=none; d=google.com; s=arc-20160816; b=hTy3Fl5CUPesyBC2eCg4aXCowrwp7UdtJdrXjE0AAGFRBSbDJvKLjHObjjVjYmHB8w bkpypp5UlfWpdAE/t1uD00bSwC72hbdBvL1b83qjKm4b/JhfIQIjl11kWzimrnnuKG4g Rw4nlkSjD+X12A/o4UngdyJkVcZk5NunC7Lo9Z8lCPOMH5ECSR4K7KXPPekMcU9wSdln uzT0FfkXRr2iAFWZ3gd0fD/HATnRCfT3ziWOP+1gcvMEUVFpol687Y9X8EWwaXV8Owf7 15sDysL++GHD6T5Thq2vqcDLF2W7lDCeun6e0LkuKvG6e4KiPVtP8/uomM5CrlbnomIh 3Cqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=sdMC2DzGK8m3h+gvGjy6vv3jNFwxh9JXka0nOM+ABsg=; b=efWaPbWIhA2JQjGP/po8MhJWl1Ze0J0NuwkwB82gyKKUeabeNlLdNb0WyDMyBnulEj wIJhQ5jGXgqRnMnsFyaLzKWWV6+f0KL+ZmVZ8vatI1XBDmWNAPMeSiCC6+S7K1n34O2T xUSo5n9kZ1rxTzFX3Row9VE1Rjy/wqPMSK7Mjr5uul0SJhtUW2VR9Pp/nq4wr8FUk8R3 3Xx/MnY7o3UYUA76SpHV8/1SrjxfzBp2XkaTAnqFzVoYrGbY7tdBYakCsw7WaXl2mTuJ wv3ucPihT6KQ4PDfaD0L9+q4hem6Wg49n2tl4tuewCfdi8ZRbl8EfAnmO42I0TwMNiKP 966g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bVo6AOa2; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si1343920pli.623.2017.09.06.23.06.14; Wed, 06 Sep 2017 23:06:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bVo6AOa2; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754268AbdIGGGN (ORCPT + 7 others); Thu, 7 Sep 2017 02:06:13 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:34254 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbdIGGDf (ORCPT ); Thu, 7 Sep 2017 02:03:35 -0400 Received: by mail-pf0-f172.google.com with SMTP id e1so2343850pfk.1 for ; Wed, 06 Sep 2017 23:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sdMC2DzGK8m3h+gvGjy6vv3jNFwxh9JXka0nOM+ABsg=; b=bVo6AOa2S5tZ3wFrZJwP1cGiSHinnmtqpTW1SqmUI0lZvNmd/hc9aZd6HsFC6GLvRA xnwMbeTAg7NEBYwCDnYFBf7hNHtVGMzeIXdBynahEHGOxqe7tDu6f2YZ5EB2DDZeIVUv t0fMqzLk5qrTiP0jfIziJ2PMDT0Apbg3+ykdg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sdMC2DzGK8m3h+gvGjy6vv3jNFwxh9JXka0nOM+ABsg=; b=WYEwmUygy+WODgu1TTySoCpHc/RGeizOMJbNII+qmfEUOkoeHdqOQ9m1VIEq8ETDbe 5sY3zDgQsIgNcCxGgCBNeEgl+nAfcflVHRp0CMxKpfw7z2LK4RViWQeGolqnaI32k5Q9 hVD4Gv+8cbUABFaBhodfgDyOX6ML1Nfc+ksWu2XlFbQ0xvPFkOF9OO3ZHMGGjQIwf6A/ nq7j1beZI2NAlMA9WuX/ieSoqVdahcPFmQuTrfQhCN4E5HrQFS9iqvpJxGPe3gCFQbLe xT/yg1HFzR9LpbX+dPeHeRWu4Ie/wZtFKbRz1RbGDUM0hjuDY4H0U5mm7Priu6fJBMFa YMtg== X-Gm-Message-State: AHPjjUgEbw6W1ck3RTPC+4gBpIRrU0Pr/g3xEM7t0tP3KNr8qE9tbQ7q /EyaSiEP+V3C9+V5nbVneg== X-Google-Smtp-Source: ADKCNb4RB/dr/6iQdLH8y6QRujVJvHbrphIyJyAOj988svpKeolHK25CXWSjDPFfTZjjTcogUs5yhA== X-Received: by 10.99.114.29 with SMTP id n29mr1614132pgc.26.1504764214574; Wed, 06 Sep 2017 23:03:34 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id s1sm2186650pfk.27.2017.09.06.23.03.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 23:03:33 -0700 (PDT) From: Bjorn Andersson To: "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Chris Lew Subject: [PATCH 1/7] net: qrtr: Invoke sk_error_report() after setting sk_err Date: Wed, 6 Sep 2017 23:03:23 -0700 Message-Id: <20170907060329.32402-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170907060329.32402-1-bjorn.andersson@linaro.org> References: <20170907060329.32402-1-bjorn.andersson@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Rather than manually waking up any context sleeping on the sock to signal an error we should call sk_error_report(). This has the added benefit that in-kernel consumers can override this notificatino with its own callback. Signed-off-by: Bjorn Andersson --- net/qrtr/qrtr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.12.0 diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 5586609afa27..2058b27821a4 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -541,7 +541,7 @@ static void qrtr_reset_ports(void) sock_hold(&ipc->sk); ipc->sk.sk_err = ENETRESET; - wake_up_interruptible(sk_sleep(&ipc->sk)); + ipc->sk.sk_error_report(&ipc->sk); sock_put(&ipc->sk); } mutex_unlock(&qrtr_port_lock); From patchwork Thu Sep 7 06:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 111855 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp356760qge; Wed, 6 Sep 2017 23:03:46 -0700 (PDT) X-Received: by 10.84.210.37 with SMTP id z34mr1827805plh.304.1504764226372; Wed, 06 Sep 2017 23:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504764226; cv=none; d=google.com; s=arc-20160816; b=EPonZjSZ1NT3445zKo0QnnuLpMun18qyDwmqUW6d1/ZcAWZmhYRqa35FZ0IgUVczPn mlfkpEIgxN0oJO4FS2MHCHWHYoBa6kiVVu51+P5GmVRxHqBrFdlGAbCKgx2HEl6ykKrQ kTwmBmjnV4mAHZC2BvipLPiTffCSpvIXH3OuyqhQwLZkTMg1a/4NNK4hQgaV62ND0qud 939ZKaJ+skd1mT0VDFCvS2x3V4VXqgn+qo9eedo5ZCvrlXE5OPH7T2lRlgYrTfFxT4vz vKD21Kgdc1RxEEY4YqX8jW5Dxp9A1GGREfHtoLEsMSbSxbGpHpVYjZRJi3ZT4IC9ubUO KgDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zQKNs9j4Oj4lcNgS6PG3PZcaZmvG8d1a9oRMAch0KI8=; b=nELFVZEnRyYSbyuR+uGHaAFr2W6TMpaLbWbQNBmdV/FUtuQgPkVTMiz1lJ5v6DSk3Z LrSEnXLxQvKb8ODTdPPR3kCoun2Sd/y2QroM79bH2RnopF2c6dpJQFTEg/kvVY0AFQq3 tMozZndPhLSQVC4P7ID2nPbI2bqZRxETxU6vV8FrLyzie9CNXWcepp8mblMfyW+sGxjR WWaiqhrMMQDhSg9u3dVFK55r3hZtsXXNVAXW/hD5bkM1tgjTgt1QQLKV/GhKvi48XWV1 9QSv3pfYSiZYKbotsHTCUIV9kTSiHqXmGVR3iHjox7mplP3a9BuVI/7l6LNV9O9WuNfk X4WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=COspMjh7; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u189si1293523pgb.161.2017.09.06.23.03.46; Wed, 06 Sep 2017 23:03:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=COspMjh7; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754013AbdIGGDj (ORCPT + 7 others); Thu, 7 Sep 2017 02:03:39 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:38649 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbdIGGDg (ORCPT ); Thu, 7 Sep 2017 02:03:36 -0400 Received: by mail-pg0-f50.google.com with SMTP id v66so19132023pgb.5 for ; Wed, 06 Sep 2017 23:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zQKNs9j4Oj4lcNgS6PG3PZcaZmvG8d1a9oRMAch0KI8=; b=COspMjh7sbiOAfvEvn70rccmdaCGF1ADjmz8+4g8Gh2CzzTBKkwBXLH8Me1t0KZdqU gMAuuN+gUcRr3k2NEwxMSG34u5HY6W7Bt2bcNLCRyLrcu6U43pWMZjiwLnaN3IoABiQS VWKLjsSAQc3RtzgSc3PSj1NctLlibzWBHJiQU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zQKNs9j4Oj4lcNgS6PG3PZcaZmvG8d1a9oRMAch0KI8=; b=V5d+uJkvqBaHNq443r/djIFfhE74YKtBSI4rLC2iEIC9++cmFnwFYz07+DrJM8mIbl j3dFIlJ5clX5CD7/IMjsMfolrECOE+6FbZU8Hw4heOwlNXPF5m+6wDIwlYhuefnnslIQ /tJtDwChQxnNnbgXIKXvuBz7Sen6NjhXJt6kEqtJoA1kV3rt/WgYVWQ+44I1wU3VIj1A lEXNzBcOw+pSVl0o4rRj9uz5ZRbqrXTyx2AwNv6QBh65XqXlQSogWCnAkipQbYQZh0Lg kumtvrPbvb2YvMm1ty1CGG9oonX2Op4mLcq/lckHDNrZs8+QxiugJrUP5qEHixtWvEad YdCg== X-Gm-Message-State: AHPjjUjJIzQ+PcKEpZ7zxRzf6CqiAkhL3+7gOSsINdpHOoIIuhkm7nxr fLXUuwMqYlEpf9uR X-Google-Smtp-Source: ADKCNb4amLQXgJCgb6LBlmI4C6s3RW3rPzASbhDU6JgjDozylsKMC00scE0X+w7il9mAeq5zXrMCAA== X-Received: by 10.99.0.3 with SMTP id 3mr1578952pga.417.1504764215843; Wed, 06 Sep 2017 23:03:35 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id s1sm2186650pfk.27.2017.09.06.23.03.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 23:03:35 -0700 (PDT) From: Bjorn Andersson To: "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Chris Lew Subject: [PATCH 2/7] net: qrtr: Move constants to header file Date: Wed, 6 Sep 2017 23:03:24 -0700 Message-Id: <20170907060329.32402-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170907060329.32402-1-bjorn.andersson@linaro.org> References: <20170907060329.32402-1-bjorn.andersson@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The constants are used by both the name server and clients, so clarify their value and move them to the uapi header. Signed-off-by: Bjorn Andersson --- include/uapi/linux/qrtr.h | 3 +++ net/qrtr/qrtr.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) -- 2.12.0 diff --git a/include/uapi/linux/qrtr.h b/include/uapi/linux/qrtr.h index 9d76c566f66e..63e8803e4d90 100644 --- a/include/uapi/linux/qrtr.h +++ b/include/uapi/linux/qrtr.h @@ -4,6 +4,9 @@ #include #include +#define QRTR_NODE_BCAST 0xffffffffu +#define QRTR_PORT_CTRL 0xfffffffeu + struct sockaddr_qrtr { __kernel_sa_family_t sq_family; __u32 sq_node; diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 2058b27821a4..0d7d3968414e 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -61,8 +61,6 @@ struct qrtr_hdr { } __packed; #define QRTR_HDR_SIZE sizeof(struct qrtr_hdr) -#define QRTR_NODE_BCAST ((unsigned int)-1) -#define QRTR_PORT_CTRL ((unsigned int)-2) struct qrtr_sock { /* WARNING: sk must be the first member */