Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5950813iog; Thu, 23 Jun 2022 08:23:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sY8xh+NLJ9yeBDeNp3Y/AZFF1BvJfk4KHID5XT8U1lONO+j178LwclBXkzM5tUwyT1aznJ X-Received: by 2002:a17:906:77c9:b0:722:ea38:9979 with SMTP id m9-20020a17090677c900b00722ea389979mr8717774ejn.95.1655997826924; Thu, 23 Jun 2022 08:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655997826; cv=none; d=google.com; s=arc-20160816; b=Ttit5Q6jettQ8O6u7jqTNZigey4mbAH3bKM5QlhYR1nUDiDiKj7XVgC3qG6/VQT7z/ F/iJdvg6kdFfQZyMzs6Z1LXfgKR7o4nCVsxidt9ZJixJfzX6WCZrJ3vjGpEZNECi6P40 xTRexOjZJMHl/g1FAaZ85HnE7DO0c8umaUatRBdOZHRfpVOoaKHwukcwNCMeSMbT9FXN r1SYF66W6l5cTCO4R1EQRcWOnB0BomxE5wDCo5ZLo0sYXgHhDgD+LUC6uKY72qmbObWC 8PENksooniQhxPevHpArcZHwLNut/+XTlNHt56jA/2NNHuF17D9DYBL4MIL7hrKL2dVQ 8avA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=XpU6GfBx5oBS4i/9g3mqQNXKYQL2s7CzVSycAlB6Uks=; b=Sv0UxnvObwlrHI1dhI+KB1EEAcwpJVyVHsUP4/3+E8IMQxuAKRNQ6pktH+g3NtUbq0 c2sw38+ygbQ9igqz8Zqk1PlYo32nLATdxWh8rMVuig1nAoNg2yRyU0S+UoSbiNgq6jTf QDasLFyNZY1Bay3Awp+v7SDDBMcnZpLGyL2zm9RRBy9wzhVgV5GR4pNMwHK5OW2KcJqy FqYsiuNmwgtSwGqFCHwZA56nhfdEalCL6LwemIn6RXwvWZun1tlR8cik85+2vZ5lkNhQ c6qAzBf/XKqAY+B909ylkB0K0XKdZh7gQR1TpYiJ6RdDNbvFCoAYj9RJCedvoWEWBVvp mkfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw8-20020a170907a0c800b00718ccb0a135si2853970ejc.507.2022.06.23.08.23.22; Thu, 23 Jun 2022 08:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbiFWOsk (ORCPT + 99 others); Thu, 23 Jun 2022 10:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231571AbiFWOse (ORCPT ); Thu, 23 Jun 2022 10:48:34 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 334EA4616E for ; Thu, 23 Jun 2022 07:48:31 -0700 (PDT) Received: (qmail 943500 invoked by uid 1000); 23 Jun 2022 10:48:30 -0400 Date: Thu, 23 Jun 2022 10:48:30 -0400 From: Alan Stern To: Neal Liu Cc: Felipe Balbi , Greg Kroah-Hartman , Roger Quadros , Miaohe Lin , Wesley Cheng , "Eric W . Biederman" , Matthew Wilcox , Nikita Yushchenko , Cai Huoqing , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, BMC-SW@aspeedtech.com Subject: Re: [PATCH RESEND] usb: gadget: f_mass_storage: Make CD-ROM emulation works with Windows OS Message-ID: References: <20220623030405.1922980-1-neal_liu@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220623030405.1922980-1-neal_liu@aspeedtech.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2022 at 11:04:05AM +0800, Neal Liu wrote: > Add read TOC with format 2 to support CD-ROM emulation with > Windows OS. > This patch is tested on Windows OS Server 2019. This description says "format 2", but the patch actually adds code for the case where format is 1. This sort of mistake is not acceptable. > Signed-off-by: Neal Liu > --- > drivers/usb/gadget/function/f_mass_storage.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c > index 3a77bca0ebe1..3c2a5f1e8b66 100644 > --- a/drivers/usb/gadget/function/f_mass_storage.c > +++ b/drivers/usb/gadget/function/f_mass_storage.c > @@ -1209,6 +1209,7 @@ static int do_read_toc(struct fsg_common *common, struct fsg_buffhd *bh) > > switch (format) { > case 0: > + case 1: > /* Formatted TOC */ > len = 4 + 2*8; /* 4 byte header + 2 descriptors */ > memset(buf, 0, len); When format is 1, the driver is supposed to ignore the start_track value. Your patch does not do this. The default case in this switch statement has a comment saying that Mutil-session is not supported. As a result of this change, it now _is_ supported. The patch needs to update that comment. Alan Stern