Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3492258imm; Mon, 13 Aug 2018 12:42:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyNNIG2Iat5QgAk0BbHWwM5n83EWYcmEj0irgTajZTRSfgfFhHOHnFI+eQEPanT1UU9XMIx X-Received: by 2002:a65:6104:: with SMTP id z4-v6mr18303969pgu.361.1534189321211; Mon, 13 Aug 2018 12:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534189321; cv=none; d=google.com; s=arc-20160816; b=v6dMV/foYh9Nbw2UojvSIsropOW36tDtPXGjEArSnggwt9G5G29H44iUeA0lp3KIZ3 exqzKRfdgjMFi6qLcW9MNKsjvc9FW4dgLk5wrG50nlNJFPz4Meo7AUJBAXKG/7Di+u+j ubdCjlX/aeH2Xqe2edE3uFAB7LY8L2mNsLeSi9LngtLBLauDM1AjcNpJ4PROAJUeP770 Qyow2CJI1HK03eaALE4ICns11r2HRh7aUeCaBrpQ7hCnkimrCbFWbS/mjMNEiQh2KQKJ WbfibfXMEPlO8cQu8MgOTgOaz7xka7EiAZtz9aT5B6j0/YwY2yiGKBNifhceVO8BXg3e CfQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ZHbXUFVd+qH+yB+qIBwR/NaIpn4tihzPZIf9Z5/F+5A=; b=Kd5s/uLZiRNiDdpBQNrJ0WMurtI98L5ypQ7EkBi4KVe7DOnTTCv+fJOrRQznEcjRsG ektHWIvZlfO6SG6wteeTV9HQoXZOMl/7ZDZWLmnhp07EqPoSrUY46byeenYNcFYdb6t3 iZw317YsZQADUY+t1cVW+U00EyePi4qs1M+CBuXRb7iP7btE5Z//sjAKt0fdcZnHBIbf tAPGT6n8R2K4/nW6wadgzY94N79HMqxyfd5UB6BQplwlQvY0Esbruo+q36aZH9hhITm0 0IrTs5tcOusYqM6535AqHtHprPYd8ZzmcZKNzFUC51I3FC+fCRDOaqpHSupNru1hCta7 bu6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10-v6si19088246pfk.162.2018.08.13.12.41.45; Mon, 13 Aug 2018 12:42:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730732AbeHMWYd (ORCPT + 99 others); Mon, 13 Aug 2018 18:24:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54140 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730219AbeHMWYd (ORCPT ); Mon, 13 Aug 2018 18:24:33 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 61391CE7; Mon, 13 Aug 2018 19:40:54 +0000 (UTC) Date: Mon, 13 Aug 2018 21:40:51 +0200 From: "gregkh@linuxfoundation.org" To: "Michael Kelley (EOSG)" Cc: KY Srinivasan , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , Stephen Hemminger , "vkuznets@redhat.com" Subject: Re: [PATCH 2/5] vmbus: add driver_override support Message-ID: <20180813194051.GA11620@kroah.com> References: <20180810230520.2055-1-kys@linuxonhyperv.com> <20180810230611.2114-1-kys@linuxonhyperv.com> <20180810230611.2114-2-kys@linuxonhyperv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 13, 2018 at 07:30:50PM +0000, Michael Kelley (EOSG) wrote: > From: kys@linuxonhyperv.com Sent: Friday, August 10, 2018 4:06 PM > > > From: Stephen Hemminger > > > > Add support for overriding the default driver for a VMBus device > > in the same way that it can be done for PCI devices. This patch > > adds the /sys/bus/vmbus/devices/.../driver_override file > > and the logic for matching. > > > > This is used by driverctl tool to do driver override. > > https://gitlab.com/driverctl/driverctl > > > > Signed-off-by: Stephen Hemminger > > Signed-off-by: K. Y. Srinivasan > > --- > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > > index b1b548a21f91..e6d8fdac6d8b 100644 > > --- a/drivers/hv/vmbus_drv.c > > +++ b/drivers/hv/vmbus_drv.c > > @@ -498,6 +498,54 @@ static ssize_t device_show(struct device *dev, > > } > > static DEVICE_ATTR_RO(device); > > > > +static ssize_t driver_override_store(struct device *dev, > > + struct device_attribute *attr, > > + const char *buf, size_t count) > > +{ > > + struct hv_device *hv_dev = device_to_hv_device(dev); > > + char *driver_override, *old, *cp; > > + > > + /* We need to keep extra room for a newline */ > > + if (count >= (PAGE_SIZE - 1)) > > + return -EINVAL; > > Does 'count' actually have a relationship to PAGE_SIZE, or > is PAGE_SIZE just used as an arbitrary size limit? I'm > wondering what happens on ARM64 with a 64K page size, > for example. If it's just arbitrary, coding such a constant > would be better. sysfs buffers are PAGE_SIZE big.