diff mbox series

[3/6] pktcdvd: remove queue_lock around blk_queue_max_hw_sectors

Message ID 20181116081006.5083-4-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/6] block: remove the rq_alloc_data request_queue field | expand

Commit Message

Christoph Hellwig Nov. 16, 2018, 8:10 a.m. UTC
blk_queue_max_hw_sectors can't do anything with queue_lock protection
so don't hold it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/pktcdvd.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Omar Sandoval Nov. 16, 2018, 8:33 a.m. UTC | #1
On Fri, Nov 16, 2018 at 09:10:03AM +0100, Christoph Hellwig wrote:
> blk_queue_max_hw_sectors can't do anything with queue_lock protection
> so don't hold it.

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/block/pktcdvd.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
> index 4adf4c8861cd..f5a71023f76c 100644
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -2203,9 +2203,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write)
>  		 * Some CDRW drives can not handle writes larger than one packet,
>  		 * even if the size is a multiple of the packet size.
>  		 */
> -		spin_lock_irq(&q->queue_lock);
>  		blk_queue_max_hw_sectors(q, pd->settings.size);
> -		spin_unlock_irq(&q->queue_lock);
>  		set_bit(PACKET_WRITABLE, &pd->flags);
>  	} else {
>  		pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);
> -- 
> 2.19.1
>
diff mbox series

Patch

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 4adf4c8861cd..f5a71023f76c 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2203,9 +2203,7 @@  static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write)
 		 * Some CDRW drives can not handle writes larger than one packet,
 		 * even if the size is a multiple of the packet size.
 		 */
-		spin_lock_irq(&q->queue_lock);
 		blk_queue_max_hw_sectors(q, pd->settings.size);
-		spin_unlock_irq(&q->queue_lock);
 		set_bit(PACKET_WRITABLE, &pd->flags);
 	} else {
 		pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);