Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3957572pxb; Tue, 10 Nov 2020 04:40:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLiWlI2JsHXOdGZNjwDvufjus0K7AZS8JkNBWLe8nlbaqO3oJ7vzIdv5OiIkKzWKP1+OHJ X-Received: by 2002:a17:906:ad85:: with SMTP id la5mr20796828ejb.423.1605012023740; Tue, 10 Nov 2020 04:40:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605012023; cv=none; d=google.com; s=arc-20160816; b=w04k/LkmzRAQCxjczJ8ml9lTgiYvgKbMZ+Zwfwl4ehk/MNeSNKscf1X98JethJSUAG DLBLbEqQz9bSOjB8yBCdiCYl24PyA7k8zPGrfV8/xQYgFHhZK9y2YAemFLdrX/1InR43 8d4P8OOb0a6KxXRGXfMtm5YTVizWAqeHpJbpI6/2us2Oy6pt3hxGM5zgO8eiu48Ohapa jrfC2uopXrb4vBAScEZ8O5h9f9JyVoKz2CdsRvV2mtRd0GF2SrwyYx5r3TUdVYWU3tHH t2qKHEy+OYgU+Fy7Gs1qrY+WRff79kbpvzE9+322weKzo4abQ50klyTQvvcx5C7/Vkgv VfKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2Q5HlCtOV52Hds+JaJTmz3mdncZ2YT1jJ3ASVmrYmLg=; b=pV79Z5B5TxVr3Ckh5CuwwGizJIN4NyOP+9r3T79rkhZYSbnvjFwpzbjhsVoruay3Pj 6HWgqzh/15TmUX1zuAfF1Y0zgzxkf3KlLLf95SOUsnocVSjQ6QEkxi4dy1EuTO+s4cYQ wpXhxsS2AJaqffV+TumzJr8QcV3pA/zapxZg5jpgkFn9cvtIKqpY/if9h9b2QtwfnSqL cFjk+m3x1cnOuTv+gx94m7QbC9PjUP9pEqWoDUAvANhC9aRlVxGMbCPmMVo/VMIGV6cg qUoOYYwe7DymWAnGvPVBbvYni+ZAA7cs00PAxQEn/3jxG/ss4SzZ7JYUzBp5DudmV+aZ t50w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XFaVsHnA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si9249760ejr.448.2020.11.10.04.40.00; Tue, 10 Nov 2020 04:40:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XFaVsHnA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730392AbgKJMgo (ORCPT + 99 others); Tue, 10 Nov 2020 07:36:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbgKJMgo (ORCPT ); Tue, 10 Nov 2020 07:36:44 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9D5C0613CF; Tue, 10 Nov 2020 04:36:44 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id v22so2175603edt.9; Tue, 10 Nov 2020 04:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2Q5HlCtOV52Hds+JaJTmz3mdncZ2YT1jJ3ASVmrYmLg=; b=XFaVsHnA4RUVQnjxcpM0XAqmDoj6orZlydUFT2qPtOOvDwmdCm6vinR2V4jepprFo7 pI4WtPRvYH4SUGmD/mvqhzm8TgyGn4op3995MnThWbLUB+p8ZaHVw6EXINwu4a7GCfzU AxF6jWpweb2zP0CtsWlI+nyt9wSb6IJmjihUKYt4Vrq0Z2Nfe+3/X6+QaGERsaUf13dm ZKqAJTKibH1FEYfULc7Qsg2wY5xTqYQ0Y9aClVD92la/xImf1XlMLDk5PArv11J0g8+Z x1yixUrdrNaHCqFHZHK9dwRfpwdzSziKV+5/xjw0IHWQfk6NyH5eEXPNmvqqG1Yh0Rg2 dQpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2Q5HlCtOV52Hds+JaJTmz3mdncZ2YT1jJ3ASVmrYmLg=; b=ahQpDDKa9EU0ZBQ2JfHbxBeQeglSV+BKUv6M9QTq+qyw7+qEmf5ztRJUv30Q44l/3B ZILt1r5n9B/0yPD3FKPv6VNQpKbxwLDZF2TuSwUmlVWOD8C8Ud7yQ7RRTvWrvMeirVeG iQaRH2IQqu5CwKNmpDxjtOkY2oKWcdyKz3Do0Sscf3uLWvFI2Qhj3mq87HRHJay4q9h+ fS08UVMtWyNGsw+Bs3hTEcjiyXPseUT3EWpbYtR16efQEnYaZiFmzOUi3cq74e3yVjFu SpbIFu1n19JtS029O2Y9WqD01M9nwGG97oTJ5slq/bdn+4Zo2TE9YvHPCFcSE/PSroPq d9rQ== X-Gm-Message-State: AOAM53260NJXOQlvOerLSzRRsTgXd5rm4BltJ0dCf8Do7PenbA7J/xwr rZFz1uCQAmzCEr+/vZN0WmiJndOkhg1nFPGp9VU= X-Received: by 2002:a05:6402:17b4:: with SMTP id j20mr21238603edy.24.1605011802891; Tue, 10 Nov 2020 04:36:42 -0800 (PST) MIME-Version: 1.0 References: <20201026035710.593-1-zhenzhong.duan@gmail.com> <20201027075217.GA30879@infradead.org> In-Reply-To: <20201027075217.GA30879@infradead.org> From: Zhenzhong Duan Date: Tue, 10 Nov 2020 20:36:26 +0800 Message-ID: Subject: Re: [PATCH v2] PCI: check also dynamic IDs for duplicate in new_id_store() To: Christoph Hellwig , Bjorn Helgaas Cc: linux-kernel , linux-pci@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, This patch got reviewed-by, could you kindly check if it can be upstreamed? Thanks very much. Zhenzhong On Tue, Oct 27, 2020 at 3:52 PM Christoph Hellwig wrote: > > On Mon, Oct 26, 2020 at 11:57:10AM +0800, Zhenzhong Duan wrote: > > When a device ID data is writen to /sys/bus/pci/drivers/.../new_id, > > only static ID table is checked for duplicate and multiple dynamic ID > > entries of same kind are allowed to exist in a dynamic linked list. > > > > Fix it by calling pci_match_device() which checks both dynamic and static > > IDs. > > > > After fix, it shows below result which is expected. > > > > echo "1af4:1000" > /sys/bus/pci/drivers/vfio-pci/new_id > > echo "1af4:1000" > /sys/bus/pci/drivers/vfio-pci/new_id > > -bash: echo: write error: File exists > > > > Drop the static specifier and add a prototype to avoid build error. > > > > Signed-off-by: Zhenzhong Duan > > Looks good, > > Reviewed-by: Christoph Hellwig