Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6409994iog; Thu, 23 Jun 2022 19:15:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqLvKyxdd9qjy7G4AVMf2+yz+XPxM5eY17ojv72Drn6j8nRAmSyHM4aCQY0b7GF4Uty0gu X-Received: by 2002:a17:90b:4b0d:b0:1ed:19e1:5fbb with SMTP id lx13-20020a17090b4b0d00b001ed19e15fbbmr1133675pjb.43.1656036941390; Thu, 23 Jun 2022 19:15:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656036941; cv=pass; d=google.com; s=arc-20160816; b=QcrShYogIQe57U00myNpr9AxWGFL/JcLuokKn67aAIXuyadI9rKYKcw13GMp8U5NMH bxYFXW0dwtnzAe8Sz3aGWcCMiM7OLiu+6PEpGmgPqJVT9y240KFBaU0BE4bUz4F5lVEa UV/COs6yuhUb1INNhGRle2lWDmfONB65FxiRANjnFRMdrblfpBO5hfda3hRwfi0zhR7/ y24SzkD+8vzWLXeeAj19gG/MrEqI98BTvm+W8Zj17c3lcEuc72sPohiPdxwzy9X94Ddc v++FRRZyvpFgTUruf9SGCNPD4aAHSy/BFOWMrXvnENBk0LPYd3bWty4/kAMBB4XbEW6O xnRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=IN14z4VoSw3b22MCQ82jnhgUrkQW9rG5NISQs4+t6ao=; b=BPzxmLLzAggh3mk8QrKdctjwv7qa3+Z8j1fmFxlYQGwdRN4fowM0VUUV1C3xDxeUGN rpruNoE33BGmO8SjEnndO2uSmbu4GVw9FKt5p8Qn3ZeoE3fgxv1x0G3TzVZmSmmkF9AF iPxQurLmUjDIX2emsCQB+JEihxWN+2MorBOO0hKXKyrkpNGkXBRXMDDAnLq0vQ0B5fzt ZG590HfRSoVZCVef7CacGDSdj1rcH2Z8qrMWEb4SLzy1eeSY1/Dh3TOWWhgOphcbQUQp O4eQa47Ss4O0rL2CKNVytnnhB5ryeFmCF8AR1JIuWQP7avluZ2gaO04USnXY3Ivy2lgh khzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=J853vQsR; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.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 145-20020a630697000000b003fdb97d8757si1085844pgg.378.2022.06.23.19.15.29; Thu, 23 Jun 2022 19:15:41 -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; dkim=pass header.i=@aspeedtech.com header.s=selector1 header.b=J853vQsR; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.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 S230320AbiFXCLV (ORCPT + 99 others); Thu, 23 Jun 2022 22:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbiFXCLU (ORCPT ); Thu, 23 Jun 2022 22:11:20 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2135.outbound.protection.outlook.com [40.107.215.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9B04506DB; Thu, 23 Jun 2022 19:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ByjWm9vWDHZw2hPKd3yR0mXguB2vDuuTE5tVwQWOQuvjxpKMDlmtzTe4kwGLiRsqTqdsopwb30z8Ai/dXrcgnUH3FLwQxUiNQ5OJQweiJ5aYgdrQNuvwXfvV8kYjwJ8olC7AYq8ykcjITTjdVGCs4dm4bIwOH4UzeSGqTTK5TzYpdXsygnaZlcSmVaTuBNqUXWTvQGyN2pWejLZkGoSV4dEE6ZklArQfElRNPQAOQxcH6o8xMeB4u6DzggUEh0vbdBoJ7dnB4D4cOnh3tKe3JP5FxivL6u+syntJWaxkLCq2j/mLLiClsAcyFU7Wr6tog13yJUvsXkP6hBhMmzTZOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IN14z4VoSw3b22MCQ82jnhgUrkQW9rG5NISQs4+t6ao=; b=AjMd7u7UFdbaU0AoLJJ+G86cYzsax6OvkUGQJxr/hRBhAS2KiPoNOoO+BKq5od9f8eotw8AvOtYath0ViZEv6BT7qyIZwQ9t2OOl4Cj+qiE18zUrNS+ne0YcY/zhDIYGXsxS6KkAt4WpGcTyN4DXuKOLtU1f9dTdnn3T7r8vKf3dDijepN3lyKUaQaoI0xjf+OCIDutuSDAvvwD6fID6IAHSdWdQndl/azcuRyQiVpmA0eby5PB0oNb3wo0pDkHcrr/dxEfR0FiwQqNeZqzc8Bd1eenmVljnuMM9Foc4lXcu96PsF0J2gv2DJ/nFNRW/yHfjRLAXqoWUH39bBKzwUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IN14z4VoSw3b22MCQ82jnhgUrkQW9rG5NISQs4+t6ao=; b=J853vQsRYMn8DF/AZwkcNfdKN5PRXHBN5ZyZHT1ASTjuS8pGqKMjH4qHOe/OuSZtKHxGT59Kg9w7bne3pOjnQSEYd1I62rfQBmrhRByjOehND0vyXmIvgVTwjjJFqcY12WYrm/W1HDWRkbGUUqROD1H5FFiCvxFb6CEf12tRKb5A/n0VcNQ8ype11d5s2h1mWWWfjwtBmpM70uH83sZikPmQjuSaM9B40JCoTp53T5JWZA09jaRRp3v1yid/G/MpTFVUZ5UTweM927XMFLw48LjO3wl4JldBDOAjiyz7E+AoFsFcKUZGTY/MLOBt7R24F9KsejZjR+GCFSfOz0rcjw== Received: from HK0PR06MB3202.apcprd06.prod.outlook.com (2603:1096:203:87::17) by HK0PR06MB3089.apcprd06.prod.outlook.com (2603:1096:203:8c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Fri, 24 Jun 2022 02:11:09 +0000 Received: from HK0PR06MB3202.apcprd06.prod.outlook.com ([fe80::46d:a7a:f047:e9bf]) by HK0PR06MB3202.apcprd06.prod.outlook.com ([fe80::46d:a7a:f047:e9bf%5]) with mapi id 15.20.5353.022; Fri, 24 Jun 2022 02:11:09 +0000 From: Neal Liu To: Alan Stern 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 Subject: RE: [PATCH RESEND] usb: gadget: f_mass_storage: Make CD-ROM emulation works with Windows OS Thread-Topic: [PATCH RESEND] usb: gadget: f_mass_storage: Make CD-ROM emulation works with Windows OS Thread-Index: AQHYhq3rzhxyDFo2ik6AmHo1KwAqPK1dEz8AgAC9vcA= Date: Fri, 24 Jun 2022 02:11:09 +0000 Message-ID: References: <20220623030405.1922980-1-neal_liu@aspeedtech.com> In-Reply-To: Accept-Language: en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 585a9bae-f9b8-4963-e5a4-08da5586ce05 x-ms-traffictypediagnostic: HK0PR06MB3089:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /xIhgBPZKqY7HeQylnURpITqmMXZembH2d8ix5pypZBu/PwEM9SC+vLMsD3cjVH0qpB/3UufRdjCYugZAG/jrsT8pltDzaeIrB7v3rgJKZRi6uJflKK1tcUIWrKRmzU+T66UDINvHgT54pnzUBACFDSLtgxFVK0wKO9WJhsLbVR3eITz8Ndu4wT54i1DSpLzNd/3ODxTvPWcZkrMO/DLJM0LTwTZ5RHkpEgdQooFm+OZwHQ87jj1AdCcCU0p0YKkYazYdC0BaV0QANWhuhCTb5bi3EclDXAB8vL0sTaa7M8llqv9kt0CCOzOpEdPYzCT7DBcIu1JIKRTTdGzElpEcEsrJ7bsoLjJp0/9fBjqs+/rv/0+hRwd0NItTQdEYNK9zn1ENWqO7uB9+HeBbvSebV3Va95JO4SDlCoubq21u7F7uAlYdBHlUEB2G1fBgkltqgy8g82C52/zaOWqw4mLKKrH/MQYT7QYydn4GIlwsoCthRruW6uvktEW1geroulP2M/ZCD05T399R1kxTm0ojZd+TWShTOkOIyLwHinOMd0YLcrfNfpsFoW/YR2M82rFKM9+Gh/YjyJ2vxzlLKT+HEuwk74t5yeE96PVGexQUMEwuMont3YZEEx+D/7JreNrlXHnq3uWy46T3vX7YgyZdCpUnzexLMlz2syw7El+F5HmmbXb5dqoU8msfVTVHyY7pWqhtaBbXcNy2aDivoeOZQf0iQ3go2lthrRV8eomeEgJfT2AiFhthNFnr3D5PxOl3wLJG75qfmA0EiuAZoc1c2U07alfV7EuTdUhPlmxH5A= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK0PR06MB3202.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(136003)(396003)(39850400004)(346002)(376002)(366004)(64756008)(4326008)(66446008)(7416002)(52536014)(33656002)(71200400001)(6916009)(8676002)(66946007)(76116006)(66476007)(66556008)(55016003)(316002)(83380400001)(2906002)(26005)(107886003)(5660300002)(478600001)(9686003)(186003)(41300700001)(86362001)(54906003)(8936002)(38100700002)(38070700005)(6506007)(122000001)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?E3lTgepvzf17iDinqXSTefKLLQi1PrhgGE1Id+WbZrLtXEXlYm9+10p2mPXa?= =?us-ascii?Q?ECW5+MiJfW1cKIoode15F5WahqnnbRI1tcblLgHXjnGAR0RRwqy8BxLcqh94?= =?us-ascii?Q?xoUKX2vVWGKsrPT60nS5NP0t/cPkg3TgbC/KsChPTu1/BH+pnkPS8AH2CB8u?= =?us-ascii?Q?xX40B/Ybrg++aPdVl+vi1D/AQEWYoQbn2LDNRl5KOXYHdgzP3VL0UQnFhxCh?= =?us-ascii?Q?m6s7piy4GBnn8LM9AVcbcA/ccRjbbmnKKKZ7hCRHev0nSPXmbWMtTMuWkBgm?= =?us-ascii?Q?Q/WlCZHThdvovets9PwaEG4ooyJSGLtcy4pI+Ys5FvuDKrJk9Ru577Em/r2d?= =?us-ascii?Q?XbgdLkJlOD7DjnYpBuxWztfpGwN2xkSbQG9+4Sg3je4GeVXJSlhLrv9DNUr5?= =?us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9vGBKtE5TarkKi?= =?us-ascii?Q?6yJ3VP9xjJRYfTo/n21i4oYjpHvLpf7O5Puy33tSPCT48wJeh4BTXjih/hZB?= =?us-ascii?Q?iNLHZlaf2wtViTDnkzCDT2oqs4iurT4ZgrrHfpsxpECsLgZxB6zOpUKVQk2d?= =?us-ascii?Q?QnaJKt0bxB0UvJJR//m4Igo9kTFgwgJ4ONxAJQxoRmiA0/8f7Pdnfe2Q4w8d?= =?us-ascii?Q?D+Cj765HjskJmKmnYhVsYdLQ/Cj7g2zdenJrgLx5GRd4AZFhTCNL9sPE5dLV?= =?us-ascii?Q?1PXaS/OUsxF2+7/Q/xPcKY7CZ4OmPsBFHSn2ZkFA?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: HK0PR06MB3202.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 585a9bae-f9b8-4963-e5a4-08da5586ce05 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2022 02:11:09.6349 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9wbS5Ua9KpK95+8pfWx8MOAHr9No5COQ2gQi0c9PeIRCg+I1BMj73oKnB744iT2+2tEft/MZL1m7HgP/ODjNBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0PR06MB3089 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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. >=20 > This description says "format 2", but the patch actually adds code for th= e case > where format is 1. This sort of mistake is not acceptable. Sorry for typo. I'll update it for next patch. >=20 > > 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 =3D 4 + 2*8; /* 4 byte header + 2 descriptors */ > > memset(buf, 0, len); >=20 > When format is 1, the driver is supposed to ignore the start_track value.= Your > patch does not do this. >=20 > 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. Okay, thanks for pointing out. I'll update it as well.