On Tue, 23 Feb 2010, Ramya Desai wrote: > On Mon, Feb 22, 2010 at 11:14 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > > Dear Alan, > > Thanks for the information. > > > Usb-storage sets max_sectors to 240 in the host template. For some > > reason, the block layer also changes max_hw_sectors to the same value > > (see block/blk-settings.c:blk_queue_max_sectors()). > > I am setting the max_sectors in host template (scsiglue.c file). When > the max_sectors value is <= 1024, then only the max_sectors_kb and > max_hw_sectors_kb are same in the sys interface. However, if the > max_sectors value is > 1024 then the values in the sys interface files > are different as shown in block/blk-setting.c:blk_queue_max_sectors(). > > if (BLK_DEF_MAX_SECTORS > max_sectors) > q->limits.max_hw_sectors = q->limits.max_sectors = max_sectors; > else { > q->limits.max_sectors = BLK_DEF_MAX_SECTORS; > q->limits.max_hw_sectors = max_sectors; > } James or Jens, is there a reason why this routine limits max_sectors to 1024? And is there a reason why it sets both max_sectors and max_hw_sectors, leaving no way to change one without the other? Are drivers supposed to assign values directly to q->limits.max_sectors? Shouldn't there be a cleaner API for all this? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html