Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5527426pxb; Wed, 26 Jan 2022 14:11:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwq5FbKnPzY2zdWDR40q7sDMJsIPZVT4qC1qed02COS57Kq/7S5G7w44lgNgBp4LwuskJ9g X-Received: by 2002:aa7:d9d1:: with SMTP id v17mr963520eds.105.1643235088571; Wed, 26 Jan 2022 14:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643235088; cv=none; d=google.com; s=arc-20160816; b=on5WxoVNsvKVvuAYVV4cDp9OjPir1m7tveTGyKZo1B1jm1ZS3Nr5R2OmVgbKSGN4Z8 kYPaNqRDys8WKHC4XYtzDa6esO1yf+rHXzXwjfOI4YQboSszsY61E6HjKRfhrEUZIWuf owWhBrrZxPK5LxM1Bk6Kq8BiwtCIoIR83f345t4pDSVn4e6UzxY2gZXCF2yLCjKR8Vai H0EHrkla1y1YHLowKfpupHoxSaiShLeiX/KoNTZAI53eBfAle8P9YYzB5/rnlIxeVZxY L5DE5J4GI81xIUMiH6Kdm4PiWat5ej6RZyahia0YAa+LEGkznBXe6/4E3ZwXohMmSigD qqug== 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=oRVqwR689B29g4rnLMsd7MwoDtE5Xk+up+1sq0COe0A=; b=gXO2fN3UZVYlwAHvAfHnH+QPHpsbkPaituCyUj9w7IeNJFQ/XltsqvtZYP/uuPxcdW L0GjvXS4mtcsaWQwc0QbHNzqWjXY6+KxIiVKPtvWSnP/XAul5Y1118hg3AYXW/amZdqG s13RpoBi2ljyPh0uqIDtS7M78QbgsE0ubrW806ilOFBWViP4eN8BINX8rDld1nO02Rk+ b89wpH/oA8hipVM2m5yERjo1XjkYGIX5URkec4bAXiZFXp3GclCp7ovKg367UK6bcmiV bhiUE2BZfu7k11GLZ4ewGb8Ot4BmW6maWfGPBdn8JC1HObdNfQAMfazdv/hPQtx1lwD8 DaFA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sg39si284335ejc.975.2022.01.26.14.11.02; Wed, 26 Jan 2022 14:11:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235115AbiAZQAs (ORCPT + 99 others); Wed, 26 Jan 2022 11:00:48 -0500 Received: from netrider.rowland.org ([192.131.102.5]:34087 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S235066AbiAZQAq (ORCPT ); Wed, 26 Jan 2022 11:00:46 -0500 Received: (qmail 141403 invoked by uid 1000); 26 Jan 2022 11:00:44 -0500 Date: Wed, 26 Jan 2022 11:00:44 -0500 From: Alan Stern To: Neal Liu Cc: Felipe Balbi , Greg Kroah-Hartman , Chen Lin , Wesley Cheng , Nikita Yushchenko , Cai Huoqing , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, BMC-SW@aspeedtech.com Subject: Re: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check Message-ID: References: <20220126100856.3680716-1-neal_liu@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220126100856.3680716-1-neal_liu@aspeedtech.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 06:08:56PM +0800, Neal Liu wrote: > READ_TOC cmnd[2] specifies Format Field which is defined > in SCSI-3 spec. Add command mask to avoid marking this > sense data as invalid. > > Signed-off-by: Neal Liu > --- > drivers/usb/gadget/function/f_mass_storage.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c > index 46dd11dcb3a8..14d51695b8ae 100644 > --- a/drivers/usb/gadget/function/f_mass_storage.c > +++ b/drivers/usb/gadget/function/f_mass_storage.c > @@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common *common) > common->data_size_from_cmnd = > get_unaligned_be16(&common->cmnd[7]); > reply = check_command(common, 10, DATA_DIR_TO_HOST, > - (7<<6) | (1<<1), 1, > + (7<<6) | (1<<1) | (1<<2), 1, > "READ TOC"); > if (reply == 0) > reply = do_read_toc(common, bh); You've been anticipated: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-testing&id=89ada0fe669a7abf8777b793b874202a0767a24f Alan Stern